Gate a route or nav node on a session, not only a permission #103

Merged
lilleman merged 12 commits from session-gate into main 2026-09-03 17:47:05 +02:00
Owner

Adds a third coarse gate to the plugin contract: session: true takes any signed-in user, with no
grant to hold. src/auth/gate.ts is the one home of the rule the plugin router, the host's own
route table, the menu and discovery all read.

Every route and nav node now names exactly one gate, spelled true: discovery refuses a
declaration that names none, names two, or spells a flag anything but true, so a forgotten gate
fails the boot instead of publishing a page.

HOST_API_VERSION goes to 0.4.0. A host built before this reads session as no gate at all and
would serve the page to anonymous visitors, so the minor is what makes it refuse the plugin instead.

The reference plugin gains /scheduling/mine, scoped at the upstream by the visitor's identity id
rather than their email, and re-filtered in the handler so a backend that ignores the scope cannot
leak through the page.

Adds a third coarse gate to the plugin contract: `session: true` takes any signed-in user, with no grant to hold. `src/auth/gate.ts` is the one home of the rule the plugin router, the host's own route table, the menu and discovery all read. Every route and nav node now names **exactly one** gate, spelled `true`: discovery refuses a declaration that names none, names two, or spells a flag anything but `true`, so a forgotten gate fails the boot instead of publishing a page. `HOST_API_VERSION` goes to 0.4.0. A host built before this reads `session` as no gate at all and would serve the page to anonymous visitors, so the minor is what makes it refuse the plugin instead. The reference plugin gains `/scheduling/mine`, scoped at the upstream by the visitor's identity id rather than their email, and re-filtered in the handler so a backend that ignores the scope cannot leak through the page.
lilleman added 5 commits 2026-09-02 09:00:15 +02:00
lilleman added 4 commits 2026-09-02 18:25:02 +02:00
lilleman added 1 commit 2026-09-02 19:51:48 +02:00
Merge branch 'main' into session-gate
CI / full-gate (push) Successful in 2m53s
1fb19f6c26
lilleman added 1 commit 2026-09-03 12:00:21 +02:00
Merge branch 'main' into session-gate
CI / full-gate (push) Successful in 2m51s
76fa6a96ea
lilleman added 1 commit 2026-09-03 17:23:11 +02:00
Offer a signed-in visitor the page they can reach, and say where the assignee join belongs
CI / full-gate (push) Successful in 2m53s
Mirror / github-mirror (push) Successful in 4s
9912dd64f1
lilleman merged commit 9912dd64f1 into main 2026-09-03 17:47:05 +02:00
lilleman deleted branch session-gate 2026-09-03 17:47:05 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: larvit/plainpages#103