Skip to content

Report a seat whose bound credential the realm has refused - #338

Merged
GraemeF merged 4 commits into
mainfrom
worktree-comms-d5qb
Oct 22, 2026
Merged

GraemeF merged 4 commits into
mainfrom
worktree-comms-d5qb

Conversation

@GraemeF

@GraemeF GraemeF commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

A seat whose bot key was invalidated kept answering bound and 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.credentialRejected port method reads that record without minting. current_identity answers credential_rejected with 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_identity has a new state value, so a caller that treats anything other than bound as unbound will read it as unbound.

Tests. The credentialRejected tests sit in the shared identity contract and run against both adapters. The contract gains an optional revokeBoundCredential hook, 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. Its credentialRejected stays false, which the other two tests check.

@GraemeF
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
GraemeF force-pushed the worktree-comms-d5qb branch from 28af82f to 90461ed Compare October 22, 2026 10:44
@GraemeF
GraemeF merged commit 675bdbb into main Oct 22, 2026
2 checks passed
@GraemeF
GraemeF deleted the worktree-comms-d5qb branch October 22, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant