auth: add AUTH_MODE=access (Cloudflare Access JWT)
For running behind Cloudflare Access on stppriv, where the main site's cookie is not sent. Verifies Cf-Access-Jwt-Assertion (or the CF_Authorization cookie) as RS256 against the team's certs, with issuer and audience checks. Default mode is still forward. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -44,6 +44,8 @@ There are no accounts here. `internal/auth` forwards the browser's `Cookie` head
|
||||
- **Caching:** a "yes" is cached for 30 seconds per cookie, so logging out takes up to 30 seconds to reach the tracker.
|
||||
- **Lapsed session:** the SPA sends the browser to the site's `/admin/login?redirect=/jobs/...` (`web/src/session.js`).
|
||||
|
||||
`AUTH_MODE=access` is for running behind Cloudflare Access (stppriv, `priv.<site>/jobs/`), where the site's cookie is not sent. It verifies the `Cf-Access-Jwt-Assertion` header (or the `CF_Authorization` cookie) as an RS256 JWT against `https://$ACCESS_TEAM_DOMAIN/cdn-cgi/access/certs`, with issuer `https://$ACCESS_TEAM_DOMAIN` and audience `$ACCESS_AUD`. Keys are cached for an hour. A lapsed session still sends the SPA to `/admin/login`, which stppriv serves as a "log in again" page.
|
||||
|
||||
`AUTH_MODE=dev` admits everyone, for the standalone compose. It is refused unless `DEV_MODE=true`.
|
||||
|
||||
## Development
|
||||
|
||||
Reference in New Issue
Block a user