feat(be): let an app sign its own session out - #4245
Open
sea-snake wants to merge 1 commit into
Open
Conversation
|
✅ No security or compliance issues detected. Reviewed everything up to 52b32db. Security Overview
Detected Code Changes
|
sea-snake
force-pushed
the
feat/app-revoke-session
branch
from
August 19, 2026 01:48
0c075d2 to
9ce7a2c
Compare
sea-snake
force-pushed
the
feat/app-revoke-session
branch
from
August 19, 2026 02:57
9ce7a2c to
354343e
Compare
sea-snake
force-pushed
the
feat/app-revoke-session
branch
from
August 19, 2026 03:47
354343e to
a650a94
Compare
sea-snake
force-pushed
the
feat/app-revoke-session
branch
from
August 19, 2026 06:28
a650a94 to
2b70415
Compare
sea-snake
force-pushed
the
feat/app-revoke-session
branch
from
August 19, 2026 07:07
2b70415 to
678bf30
Compare
sea-snake
force-pushed
the
feat/app-revoke-session
branch
from
August 19, 2026 08:17
678bf30 to
783da5a
Compare
sea-snake
force-pushed
the
feat/app-revoke-session
branch
from
August 19, 2026 08:37
783da5a to
69ab376
Compare
sea-snake
force-pushed
the
feat/app-revoke-session
branch
from
August 19, 2026 10:21
69ab376 to
4919341
Compare
sea-snake
force-pushed
the
feat/app-revoke-session
branch
from
August 20, 2026 10:57
4919341 to
1b98bba
Compare
sea-snake
force-pushed
the
feat/app-revoke-session
branch
from
August 20, 2026 13:08
1b98bba to
b943144
Compare
sea-snake
force-pushed
the
feat/app-revoke-session
branch
from
August 20, 2026 13:52
b943144 to
418c0f2
Compare
sea-snake
force-pushed
the
feat/app-revoke-session
branch
from
August 20, 2026 15:24
418c0f2 to
6aea53c
Compare
sea-snake
force-pushed
the
feat/app-revoke-session
branch
from
August 20, 2026 16:10
6aea53c to
74e2eb4
Compare
sea-snake
force-pushed
the
feat/app-revoke-session
branch
2 times, most recently
from
August 21, 2026 08:54
60d1855 to
6b7e6f3
Compare
sea-snake
force-pushed
the
feat/app-revoke-session
branch
from
August 21, 2026 10:38
6b7e6f3 to
81e4d21
Compare
Signing out of an app cleared browser state and invalidated nothing. Now it removes the session record, so the app's access ends within one delegation lifetime instead of running to the delegation's original expiry. The method needs no authorization check beyond the match refresh already performs: a caller cannot produce another session's principal, so it can only ever remove its own. It returns nothing and always succeeds, so a client that retries, or that signs out twice, does not have to reason about whether its session was already gone. Revoking anything else is the II frontend's operation, not something a dapp can trigger. Implements docs/ongoing/revocable-app-sessions.md §8.1 (S14, S15). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sea-snake
force-pushed
the
feat/app-revoke-session
branch
from
August 21, 2026 17:06
81e4d21 to
52b32db
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.
Design: #4224 (
docs/ongoing/revocable-app-sessions.md§8.1 — S14, S15). Overview: #4230.Motivation
Signing out of an app cleared browser state and invalidated nothing already issued. This is
what a user pressing "log out" should actually trigger.
Changes
app_revoke_session : () -> (). It removes the session record, so the app's access endswithin one delegation lifetime instead of running to the original expiry.
cannot produce another session's principal, so it can only ever remove its own.
retries, or that signs out twice, gets the same answer without having to reason about
whether its session was already gone.
clears the record.
The app deliberately cannot revoke anything else. "Sign out everywhere" is the II
frontend's operation (#4246), not something a dapp can trigger.
Revocation latency is exactly the app-delegation TTL, by construction: revoking stops new
mints, and one already issued runs out.
mcp.rsdocuments the same residue for its grants.Tests
New
session_removal_tests(3): removing one session leaves the others, removing twicereports nothing removed, and removing the last session keeps the account reference.
PocketIC (3): a refresh that worked before sign-out returns
NoMatchingSessionafter,signing out three times in a row succeeds every time, and signing one browser out leaves
another browser's session on the same account working.
All 765 canister unit tests pass, plus the
sessionssuite.