mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-20 00:25:11 +00:00
src/pages/connections.ts wires the page: GET renders sign-in or, with a page session, the user's grants (client name from grant metadata, date, scopes in plain words) each with a Disconnect form; POST sign-in goes through the same Authenticator as consent, ends the upstream session it used (only the identity is kept, in the KV page session), and redirects; POST revoke is CSRF- and session-gated and scoped to the signed-in user (a foreign or unknown grant id is a no-op); POST sign-out destroys the page session. Same CSP/no-store/frame-denial as the consent page. Limitation recorded in docs/backend-handoff.md: revoking a grant makes its upstream session cryptographically unreachable but cannot log it out — the props can no longer be decrypted. Tests (7, end to end through the Worker with the fake upstream): form and headers, CSRF refusal, wrong password re-render without a session cookie, sign-in + listing, disconnect (token → 401, gone from the list), revoke refused without a session and a bogus id ignored, sign-out. pnpm check: typecheck, eslint, prettier, 252 tests passing. Claude-Session: https://claude.ai/code/session_01H3gfN2NCx3hBXSrZXYHUQ3