Expose refreshable on CredentialItem - #67
Merged
Merged
Conversation
GET /v1/credentials now returns refreshable per credential: true when a live refresh token can still mint a replacement. The list includes an expired credential while that holds, because revoking it is what stops the renewal and a row that never lists can never be revoked. Optional on the wire, so a client reading an older API build is unaffected.
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
GET /v1/credentialsreturns a newrefreshablefield per credential:truewhen a live refresh token can still mint a replacement for that credential.The endpoint also now includes an expired credential while that flag holds. Previously an agent idle past its 24h access expiry disappeared from the list entirely even though its 90-day refresh token could still renew it, so there was nothing left to revoke. Callers that render the list should treat
refreshableas "this credential can still come back", and can filter onexpires_atthemselves if they want only currently-valid access tokens.Version bumped to 2.7.0: additive optional field, no caller has to change anything.
Type of change
Public API
CredentialItemgainsrefreshable?: boolean. Optional, so a client pointed at a build that does not emit it still typechecks and readsundefined. No signature or wire-format change; no migration required.Worth knowing even though it is not a type change: the list can now contain credentials whose
expires_atis in the past. Code that assumed every returned credential was currently valid should checkexpires_atrather than assume.Test plan
tests/sessions-credentials.test.tscovers both wire shapes: a credential carryingrefreshable: true, and one omitting the key entirely (assertingundefinedrather than a throw). Reproduce withbun run test.Checklist