Sites gate 0.1.0 #1

Merged
oliver.maklott merged 1 commit from gate-v1 into main 2026-11-20 11:30:11 +01:00

Phase 7 of the Sites plan (spec S10): OIDC gate for oidc sites of one deployment target.

  • GET /verify?site=<host> (Caddy forward_auth): host-bound HMAC cookie __Host-sg plus the audience from the deployer's access.json, which is re-read when it changes.
  • /login on auth.<domain> accepts only https://<host> returns for hosts listed in access.json. It signs in with code + PKCE and an ID token check (signature from the JWKS, iss/aud/azp/exp/nonce), and keeps an SSO session so the next site needs no IdP round trip.
  • One-time 60 s tickets are accepted only on their own host and together with the nonce cookie set by /verify, so a ticket cannot be planted in another browser.
  • The site cookie holds only the host, a subject hash, the claims the audience names, and the expiry.
  • Logs carry no IPs or names.

Tests run against a mock OP:

  • same school allowed, other school denied
  • ticket reuse fails, foreign return hosts refused
  • ticket host/nonce/expiry binding
  • state/aud/iss/nonce tampering
  • access.json changes apply to existing cookies
  • SSO and logout

The compiled binary was smoke-tested on a Unix socket.

🤖 Generated with Claude Code

Phase 7 of the Sites plan (spec S10): OIDC gate for `oidc` sites of one deployment target. - `GET /verify?site=<host>` (Caddy `forward_auth`): host-bound HMAC cookie `__Host-sg` plus the audience from the deployer's `access.json`, which is re-read when it changes. - `/login` on `auth.<domain>` accepts only `https://<host>` returns for hosts listed in `access.json`. It signs in with code + PKCE and an ID token check (signature from the JWKS, iss/aud/azp/exp/nonce), and keeps an SSO session so the next site needs no IdP round trip. - One-time 60 s tickets are accepted only on their own host and together with the nonce cookie set by `/verify`, so a ticket cannot be planted in another browser. - The site cookie holds only the host, a subject hash, the claims the audience names, and the expiry. - Logs carry no IPs or names. Tests run against a mock OP: - same school allowed, other school denied - ticket reuse fails, foreign return hosts refused - ticket host/nonce/expiry binding - state/aud/iss/nonce tampering - access.json changes apply to existing cookies - SSO and logout The compiled binary was smoke-tested on a Unix socket. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sites gate 0.1.0: OIDC login for protected sites of one target.
All checks were successful
Test / test (pull_request) Successful in 8s
20aaa5e602
forward_auth /verify against a host-bound signed cookie and the deployer's
access.json; login on auth.<domain> with code + PKCE, an SSO session and
one-time tickets bound to a nonce cookie on the site host; no open
redirect. Tests against a mock OIDC provider; systemd unit, config example.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
limedoc/limedoc-sites-gate!1
No description provided.