A guardian gets in by the guardian rule alone; no site cookie outlives its SSO session. Release 0.2.2. #8

Merged
oliver.maklott merged 1 commit from guardian-only-by-guardian-rule into main 2026-11-25 09:42:02 +01:00

Fixes two findings of the ADR 0007 quality check.

A guardian gets in by the guardian rule alone. Before, a guardian's login counted as "any account", so a guardian of one pupil got into every other pupil's authenticated site (and into any site whose audience claim the token happened to carry), also with guardians switched off there.

  • A login is a guardian's when its roles (or claimPaths) hold guardianRole (new, default aivopod:guardian) or its token carries guardianClaimPath at all.
  • Such a login keeps no claims; its site cookie is marked k: 'g'; admits lets it in only when the site takes guardians and the owner is one of its children. A guardian without children admits nowhere.

No site cookie outlives its SSO session. The SSO session now keeps its end; a ticket's cookie gets min(now + ttl, session end). Before, a cookie issued late in a guardian's 2 h session got a fresh 2 h, so a revoked guardian kept access up to about 4 h (8 h + 8 h for normal sessions).

Upgrade note: site cookies are signed under a new purpose (site2); cookies of 0.2.1 and older cannot tell a guardian apart and are not accepted, so everyone signs in once more.

Also: subjectHash is exported from access.ts with a fixed test vector (https://login.example.org + student-1 → UH-RUVt2gJYjVNsnfR4RLc) that the Sites pack pins too; the tests' guardian claims have Aivopod's real shape (groups: ['aivopod:sites-gate'], roles, aivopod_guardian_of); README and example config describe guardianRole.

Tests: 19 passed (5 new: guardian refused on authenticated, claim-audience, plain and other-pupil sites and admitted on both of the child's; claim-only guardian; childless guardian; cookie capped at the SSO session for guardians and normal logins; role found in roles with claimPaths: ["groups"]; hash vector).

Release 0.2.2.

🤖 Generated with Claude Code

Fixes two findings of the ADR 0007 quality check. **A guardian gets in by the guardian rule alone.** Before, a guardian's login counted as "any account", so a guardian of one pupil got into every other pupil's `authenticated` site (and into any site whose audience claim the token happened to carry), also with guardians switched off there. - A login is a guardian's when its `roles` (or `claimPaths`) hold `guardianRole` (new, default `aivopod:guardian`) or its token carries `guardianClaimPath` at all. - Such a login keeps no claims; its site cookie is marked `k: 'g'`; `admits` lets it in only when the site takes guardians and the owner is one of its children. A guardian without children admits nowhere. **No site cookie outlives its SSO session.** The SSO session now keeps its end; a ticket's cookie gets `min(now + ttl, session end)`. Before, a cookie issued late in a guardian's 2 h session got a fresh 2 h, so a revoked guardian kept access up to about 4 h (8 h + 8 h for normal sessions). **Upgrade note:** site cookies are signed under a new purpose (`site2`); cookies of 0.2.1 and older cannot tell a guardian apart and are not accepted, so everyone signs in once more. Also: `subjectHash` is exported from `access.ts` with a fixed test vector (`https://login.example.org` + `student-1` → `UH-RUVt2gJYjVNsnfR4RLc`) that the Sites pack pins too; the tests' guardian claims have Aivopod's real shape (`groups: ['aivopod:sites-gate']`, `roles`, `aivopod_guardian_of`); README and example config describe `guardianRole`. Tests: 19 passed (5 new: guardian refused on `authenticated`, claim-audience, plain and other-pupil sites and admitted on both of the child's; claim-only guardian; childless guardian; cookie capped at the SSO session for guardians and normal logins; role found in `roles` with `claimPaths: ["groups"]`; hash vector). Release 0.2.2. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- A login is a guardian's when its roles hold guardianRole (default
  aivopod:guardian) or its token carries guardianClaimPath. Such a login
  keeps no claims, its site cookie is marked (k: 'g') and admits only
  where the site takes the owner's guardians: never as any account
  (authenticated), by claims, as owner or as visitor. A guardian without
  children admits nowhere.
- The SSO session keeps its end; a site cookie issued from it ends then
  too, so revoking a guardian link acts within one guardian session (2 h)
  instead of up to about 4 h.
- Site cookies are signed under a new purpose: those of 0.2.1 and older,
  which cannot tell a guardian apart, are no longer accepted.
- subjectHash in access.ts, with a fixed test vector shared with the
  Sites pack; the tests' guardian claims have Aivopod's real shape.

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!8
No description provided.