Commit 548ee38
authored
Expose refreshable on CredentialItem (#67)
## Summary
`GET /v1/credentials` returns a new `refreshable` field per credential:
`True` when 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 `refreshable` as "this credential can still come
back", and can filter on `expires_at` themselves if they want only
currently-valid access tokens.
Version bumped to 2.6.0: additive optional field, no caller has to
change anything. Matches the node-sdk change field for field.
## Type of change
- [ ] Bug fix (no breaking change)
- [x] New feature (no breaking change)
- [ ] Breaking change (existing callers must update)
- [ ] Docs, tests, or internal maintenance only
## Public API
`CredentialItem` gains `refreshable: NotRequired[bool]`. Optional, so a
client pointed at a build that does not emit it still type-checks and
reads as absent. 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_at` is in the past. Code that assumed
every returned credential was currently valid should check `expires_at`
rather than assume.
## Test plan
`test_list_credentials_success` covers both wire shapes: a credential
carrying `"refreshable": False`, and one omitting the key entirely
(asserting `.get()` returns `None` rather than raising). Reproduce with
`uv run pytest`.
## Checklist
- [x] Tests cover the new behavior, and the suite passes locally
- [x] Lint, format, and type checks pass
- [x] Docs and README examples updated if the public surface changed
- [x] No secrets, credentials, or personal data in the diff or the tests1 parent 3846bb0 commit 548ee38
3 files changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
423 | 427 | | |
424 | 428 | | |
425 | 429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1245 | 1245 | | |
1246 | 1246 | | |
1247 | 1247 | | |
| 1248 | + | |
1248 | 1249 | | |
1249 | 1250 | | |
1250 | 1251 | | |
| |||
1266 | 1267 | | |
1267 | 1268 | | |
1268 | 1269 | | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
1269 | 1274 | | |
1270 | 1275 | | |
1271 | 1276 | | |
| |||
0 commit comments