Repository navigation
fix(auth): revoke one access token by prefix and stop rewriting last use - #15407
Merged
diegosouzapw merged 1 commit intoOct 6, 2026
Merged
diegosouzapw merged 1 commit into
diegosouzapw merged 1 commit into
Conversation
Revoking by a display prefix updated every live token that shared it, while the route reported a single success. A prefix that matches more than one live token now revokes none and the route returns 409. An exact id still revokes that one token, and revoking an already-revoked token returns success so a retry after a lost response does not 404. Every successful verification also rewrote last_used_at, and one request verifies the same token more than once. The stamp is now reused for 60 seconds, so a repeat check inside that window does not write. Signed-off-by: Minxi Hou <houminxi@gmail.com>
diegosouzapw
merged commit Oct 6, 2026
acecd16
into
cheaper-inference:release/v3.8.52
43 of 51 checks passed
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.
Summary
token_prefixhas no unique constraint, so a shared prefix is possible.last_used_at, and one management request verifies the same token more than once. The stored stamp is now reused for 60 seconds.Related Issues
Validation
node --import tsx/esm --test tests/unit/access-tokens-db.test.ts tests/unit/cli-token-delete-route.test.ts(18 pass)eslinton the changed files, with the repo suppression filerelease/v3.8.52@23a1148486Tests Added Or Updated
tests/unit/access-tokens-db.test.ts(updated)tests/unit/cli-token-delete-route.test.ts(added)Coverage Notes
Reviewer Notes
token_prefix. Existing rows can already share a prefix, so the revoke refuses the ambiguous case instead of assuming it cannot happen.