Revoke captured operator sessions on logout #268

Closed
opened 2026-08-08 05:50:21 +00:00 by timmy · 0 comments
Owner

Problem

Logging out only clears the current browser cookies. A captured signed session cookie remains accepted until its eight-hour expiry, so the server does not actually end the credential.

User flow

Sign in → use privileged dashboard → sign out → every replay of that specific session is rejected before Gitea, while other independently signed-in sessions remain active.

Acceptance criteria

  • Each signed operator session has an opaque identifier backed by a durable server-side active-session registry under STACKCHAIN_STATE_DIR.
  • Sign-in registers the session; authenticated requests require an unexpired registry entry.
  • Logout revokes the current session before clearing browser cookies.
  • A copied pre-logout cookie returns 401 after logout and does not reach Gitea.
  • Revoking one session does not revoke another; revocation survives registry reconstruction/restart.
  • Legacy cookies without an identifier fail closed; expired entries are rejected and pruned.
  • Session-store failures fail closed with sanitized 503 responses, while /healthz remains independent.
  • Behavioral tests prove RED then GREEN and the full suite passes.

Non-duplication evidence

All 137 historical issue titles, 127 PR titles, recent commits, and releases through v0.1.0-rc.411 were inspected. Existing #258/#259 added signed cookies and browser-side logout but no server-side revocation, copied-cookie replay test, or session registry.

## Problem Logging out only clears the current browser cookies. A captured signed session cookie remains accepted until its eight-hour expiry, so the server does not actually end the credential. ## User flow Sign in → use privileged dashboard → sign out → every replay of that specific session is rejected before Gitea, while other independently signed-in sessions remain active. ## Acceptance criteria - Each signed operator session has an opaque identifier backed by a durable server-side active-session registry under `STACKCHAIN_STATE_DIR`. - Sign-in registers the session; authenticated requests require an unexpired registry entry. - Logout revokes the current session before clearing browser cookies. - A copied pre-logout cookie returns 401 after logout and does not reach Gitea. - Revoking one session does not revoke another; revocation survives registry reconstruction/restart. - Legacy cookies without an identifier fail closed; expired entries are rejected and pruned. - Session-store failures fail closed with sanitized 503 responses, while `/healthz` remains independent. - Behavioral tests prove RED then GREEN and the full suite passes. ## Non-duplication evidence All 137 historical issue titles, 127 PR titles, recent commits, and releases through `v0.1.0-rc.411` were inspected. Existing #258/#259 added signed cookies and browser-side logout but no server-side revocation, copied-cookie replay test, or session registry.
timmy self-assigned this 2026-08-08 05:50:21 +00:00
timmy closed this issue 2026-08-08 05:57:07 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
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: stackchain/stackchain-dashboard#268
No description provided.