Skip to content

Fix CAS ticket validation in Cloudflare Workers - #24

Merged
DIodide merged 1 commit into
mainfrom
feat/cas-worker-redirect
Sep 27, 2026
Merged

DIodide merged 1 commit into
mainfrom
feat/cas-worker-redirect

Conversation

@DIodide

@DIodide DIodide commented Sep 27, 2026

Copy link
Copy Markdown
Member

The deployed CAS callback returned 502 because Cloudflare Workers rejects fetch with redirect: "error" before making a request. Node's fetch accepts this value, so the unit tests did not catch the runtime difference.

Use redirect: "manual" and reject non-2xx responses, preserving the requirement that validation never follows redirects. Add a redirect-response regression case.

Validation: all 30 auth tests and TypeScript pass. The bundled auth handler was also exercised in the actual Workers runtime with Miniflare: live Princeton CAS rejects an invalid ticket as expected, a mocked successful CAS response creates a readable signed session, and a mocked redirect is rejected without being followed. CI runs the production build.

@DIodide
DIodide merged commit 33dcdf4 into main Sep 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant