Skip to content

feat: access-token rotate gives a token a new secret in place - #107

Merged
joshiste merged 5 commits into
mainfrom
feat/access-token-rotate
Nov 27, 2026
Merged

joshiste merged 5 commits into
mainfrom
feat/access-token-rotate

Conversation

@joshiste

@joshiste joshiste commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

access-token rotate gives an access token a new secret in place, using POST /api/access-tokens/v2/{id}/rotate (steadybit/platform#2334, #2357).

  • The token keeps its id, name, type, teams and expiry.
  • --grace-period (0s–168h) lets the previous secret keep working while whatever uses it switches over; without it the previous secret stops working at once.
  • --expires-at sets a new expiry: a date, an RFC 3339 time, or never.
  • -t json|yaml prints the id, the token and previousSecretExpiresAt, for a script to read.
  • On a platform without the rotate endpoint (404 for a token the token list shows), it says the platform can't rotate yet and points to recreate, instead of reporting the token as not found.
  • recreate is deprecated (cobra Deprecated): it still works, but help no longer lists it.
  • The spec is refreshed from dev, which brings the rotate operation.

Merge only after the platform release that ships rotate: the CLI builds against the prod spec, so api-compatibility fails until then.

Tests: TestRotate covers the query parameters, both outputs, a 404 and an invalid date; TestRotateOnAPlatformWithoutRotate covers the older platform. e2e/platform.sh now rotates instead of recreating, against dev. It checks that the id stays the same and that the previous secret works during the grace period. After a second rotate with never and no grace period, it checks that both earlier secrets stop working and the expiry is gone.

Ticket: https://steadybitgmbh.kanbanize.com/ctrl_board/2/cards/27433

@joshiste
joshiste marked this pull request as ready for review November 27, 2026 10:33
It brings the rotate operation of the access tokens.

(ticket 27433)
The token keeps its id, name, type, teams and expiry. --grace-period lets
the previous secret keep working while whatever uses it switches over,
--expires-at sets a new expiry or never. recreate is deprecated.

(ticket 27433)
A platform without the rotate endpoint answers 404, which read as a missing
token. The token list now tells the two apart.

(ticket 27433)
@joshiste
joshiste force-pushed the feat/access-token-rotate branch from b554f77 to 50a6eb5 Compare November 27, 2026 12:47
The weekly platform-e2e installs the latest release, which does not have
rotate until it is released after the platform; it checks recreate then.

(ticket 27433)
@joshiste
joshiste merged commit 9a74456 into main Nov 27, 2026
13 checks passed
@joshiste
joshiste deleted the feat/access-token-rotate branch November 27, 2026 13:06
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant