Repository navigation
Report a seat whose bound credential the realm has refused - #338
Merged
Merged
Conversation
GraemeF
marked this pull request as ready for review
October 22, 2026 03:24
A seat whose bot key was invalidated kept answering bound from memory and failed every write the same way for the life of the process. The adapter now records the first 401 on any call made under the bound credential, the events-queue poll included, and current_identity reports credential_rejected without minting. A fresh bind clears it. The seat does not re-acquire on its own: regenerating the key evicts any other holder of the persona, so two colliding seats would rotate it against each other until the persona is on attach mode.
The tests describe port behaviour, so they run against every adapter. The contract gains an optional hook that invalidates the bound credential.
GraemeF
force-pushed
the
worktree-comms-d5qb
branch
from
October 22, 2026 10:44
28af82f to
90461ed
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.
A seat whose bot key was invalidated kept answering
boundand failed every write until its process was restarted.The Zulip adapter now records the first 401 on any call made under the bound credential, which includes the events-queue poll. A new
identity.credentialRejectedport method reads that record without minting.current_identityanswerscredential_rejectedwith the identity and a message when it is set. A fresh bind clears it.The seat does not re-acquire by itself. Regenerating the key evicts any other holder of the persona, so two colliding seats would rotate it against each other. Re-acquire becomes safe once the persona is on attach mode, and is a separate change.
current_identityhas a newstatevalue, so a caller that treats anything other thanboundas unbound will read it as unbound.Tests. The
credentialRejectedtests sit in the shared identity contract and run against both adapters. The contract gains an optionalrevokeBoundCredentialhook, which the Zulip in-process realm implements by rotating the bot's key. The memory adapter has no credentials to refuse, so it omits the hook and the two tests that need a refused credential skip there. ItscredentialRejectedstays false, which the other two tests check.