Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The migration can fail with an unsafe enum-value error, and the form handlers can trigger global session revocation when administrators click Cancel or Sign out.
6 open issues
Ignore unrelated forms in the revocation submit handler · New Pass the submitter so Cancel does not revoke sessions · New Add the enum value in a separate committed migration · New Map revocation reason codes to actionable messages · New Audit terminal authorization failures after rollback · New Update callback tests for the operation-based verification contract · New
What changed in this PR
Adds an administrator emergency sign-out flow to Hub’s existing authentication system, without changing product data, public links, or Copilot connection state.
Changes:
- Adds provider-verified authorization and transactional global session revocation.
- Connects
/settings/sessionsto live counts, confirmation, cancellation, and signed-out completion. - Extends security audits, documentation, Storybook states, and automated coverage.
| File | Description |
|---|---|
hub/test/database/end-all-hub-sessions-migration/index.db.test.ts |
Tests upgrades and authorization target constraints. |
hub/server/routes/index.ts |
Registers session-revocation endpoints and middleware. |
hub/server/routes/api/session-revocation/index.test.ts |
Tests access, confirmation, and cookie clearing. |
hub/server/routes/api/session-revocation/get/index.ts |
Returns administrator-only authentication counts. |
hub/server/routes/api/session-revocation/authorizations/start/post/index.ts |
Starts confirmed authorization through the session provider. |
hub/server/routes/api/session-revocation/authorizations/get/index.ts |
Returns the verified revocation authorization. |
hub/server/routes/api/session-revocation/authorizations/continue/post/index.ts |
Continues revocation and clears the actor’s cookie. |
hub/server/routes/api/session-revocation/authorizations/cancel/post/index.ts |
Cancels a session-bound revocation authorization. |
hub/server/routes/api/security-audits/present-security-audit/index.ts |
Presents revocation actors and allowlisted context. |
hub/server/routes/api/auth/types.ts |
Defines revocation dependencies and operation types. |
hub/server/routes/api/auth/create-authentication-route-dependencies/index.ts |
Wires revocation services into authentication routes. |
hub/server/routes/api/auth/callback/get/index.ts |
Redirects verified operations to their confirmation page. |
hub/server/routes/api/administrators/read-administrator-session/index.ts |
Shares administrator-session lookup with revocation routes. |
hub/server/routes/api/administrators/authorizations/start/rate-limit/index.ts |
Makes authorization rate limiting reusable. |
hub/server/repositories/session-revocation-states/get-session-revocation-status/index.ts |
Reads the revision and current authentication counts. |
hub/server/repositories/sensitive-authorizations/verify-sensitive-authorization/index.ts |
Supports the global revocation operation type. |
hub/server/repositories/sensitive-authorizations/lock-sensitive-authorization/index.ts |
Includes revocation in locked authorization records. |
hub/server/repositories/sensitive-authorizations/get-sensitive-authorization/index.ts |
Supports authorizations without membership targets. |
hub/server/repositories/sensitive-authorizations/get-sensitive-authorization-audit-data/index.ts |
Includes revocation in authorization audit data. |
hub/server/repositories/sensitive-authorizations/create-sensitive-authorization/index.ts |
Validates operation-specific target counts. |
hub/server/repositories/sensitive-authorizations/cancel-sensitive-authorization/index.ts |
Supports cancelling revocation authorizations. |
hub/server/repositories/sensitive-authorizations/cancel-open-sensitive-authorizations/index.ts |
Cancels other open sensitive authorizations. |
hub/server/repositories/security-audits/parse-security-audit-event/types.ts |
Adds the global session-termination audit type. |
hub/server/repositories/security-audits/parse-security-audit-event/index.ts |
Validates revocation audit events. |
hub/server/repositories/security-audits/get-security-audit-data/index.ts |
Maps revocation events to stored audit records. |
hub/server/repositories/security-audits/create-security-audit/types.ts |
Defines revocation audit payloads. |
hub/server/repositories/hub-sessions/end-all-open-hub-sessions/index.ts |
Ends and counts open Hub sessions. |
hub/server/domains/session-revocation/errors.ts |
Defines revocation denial and persistence errors. |
hub/server/domains/session-revocation/end-all-hub-sessions/index.ts |
Coordinates authorization checks and atomic revocation. |
hub/server/domains/session-revocation/end-all-hub-sessions/index.db.test.ts |
Tests successful revocation and stale-state rollback. |
hub/server/domains/administrator-authorization/verify-administrator-authorization/index.ts |
Extends verification to the revocation operation. |
hub/server/create-app/index.ts |
Applies authentication security and bounded parsing. |
hub/schema/sensitive-authorization-operation.enum.prisma |
Adds END_ALL_HUB_SESSIONS. |
hub/schema/migrations/20261112170000_end_all_hub_sessions/migration.sql |
Adds the operation and updates target constraints. |
hub/docs/frontend.md |
Documents the real sessions-page flow. |
hub/docs/authentication.md |
Documents revocation endpoints, safeguards, and scope. |
hub/docs/architecture.md |
Summarizes the global revocation boundary. |
hub/client/pages/session-revocation-page/types.ts |
Supports provider-verified page data. |
hub/client/pages/session-revocation-page/stories.tsx |
Updates scope and confirmation/result stories. |
hub/client/pages/session-revocation-page/index.tsx |
Renders verified authorization and optional confirmation. |
hub/client/pages/session-revocation-page/index.test.tsx |
Tests initial and provider-verified forms. |
hub/client/application/hub/view-models/settings-public/index.ts |
Aligns mock-page copy with Hub-only revocation. |
hub/client/application/hub/view-models/session-revocation-page-data/index.ts |
Builds counts, confirmation, and completion data. |
hub/client/application/hub/view-models/administrator-workspace/index.ts |
Adds sessions navigation and section selection. |
hub/client/application/hub/session-revocation-contracts/types.ts |
Exposes typed status and authorization responses. |
hub/client/application/hub/session-revocation-contracts/index.ts |
Validates revocation API responses. |
hub/client/application/hub/routes/settings-sessions/index.tsx |
Loads live counts and starts provider verification. |
hub/client/application/hub/routes/settings-session-revocation-authorization/index.tsx |
Handles verified continuation, cancellation, and completion. |
hub/client/application/hub/routes/session-revocation-flow.test.tsx |
Exercises real-mode loading, authorization, and completion. |
hub/client/application/hub/routes.ts |
Registers the revocation confirmation page. |
hub/client/application/hub/requests/start-session-revocation-authorization/index.ts |
Posts explicit confirmation to start authorization. |
hub/client/application/hub/requests/get-session-revocation-status/index.ts |
Fetches current revocation status. |
hub/client/application/hub/requests/get-session-revocation-authorization/index.ts |
Fetches the verified authorization. |
hub/client/application/hub/requests/continue-session-revocation-authorization/index.ts |
Submits the verified revocation operation. |
hub/client/application/hub/requests/cancel-session-revocation-authorization/index.ts |
Submits authorization cancellation. |
Review effort: Max (auto)
Contributor
weastler
approved these changes
Nov 12, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
alliscode
force-pushed
the
alliscode-end-all-hub-sessions
branch
from
November 12, 2026 23:50
e06525a to
e0d20b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Why
Hub administrators need one emergency control that immediately ends existing Hub authentication without changing product data, public links, or Copilot connection state.
What changes
/settings/sessionsnow shows current session and pending-authorization counts, requires explicit confirmation, and repeats authorization through the provider used by the current session. Continuing the verified operation atomically advances the global revocation revision, cancels other pending sensitive authorizations, ends every open Hub session, records the security audit, clears the actor's cookie, and keeps the signed-out result visible.The flow supports GitHub, Entra, and local developer sign-in. Stale authorization, session, or administrator authority leaves the revocation state unchanged.
Storybook screenshots
Hub/Pages/Security/End all sessions / Confirmation — dark theme, 1280 × 720
Hub/Pages/Security/End all sessions / Provider Verified — dark theme, 1280 × 720
Hub/Pages/Security/End all sessions / Only Your Session — dark theme, 1280 × 720
Hub/Pages/Security/End all sessions / Denied — dark theme, 1280 × 720
Hub/Pages/Security/End all sessions / Ended — dark theme, 1280 × 263