Skip to main content
← Back to list
01Issue
FeatureShippedSwamp CLI
Assigneesstack72

Relationships

↑ child of #662

#694 serve-auth: swamp access token rotate command

Opened by stack72 · 6/19/2026· Shipped 6/19/2026

Parent

Related to #662 (serve authentication & authorization).

Problem

When a server token is leaked, the admin must manually revoke the old token and mint a new one with a different name:

```bash swamp access token revoke sarah-token swamp access token mint sarah-token-2 --principal user:sarah ```

The old token name can't be reused because the revoked instance still exists. The admin has to choose a new name, and the user has to update their stored credential.

Solution

Add a `swamp access token rotate ` command that atomically:

  1. Revokes the existing token
  2. Mints a new token with the same name (or a derived name like `-v2`) for the same principal
  3. Outputs the new plaintext once

```bash swamp access token rotate sarah-token → Token rotated. New token: sarah-token.newSecret123... Previous token has been revoked. Give the new token to the user. ```

The principal is read from the existing token record — the admin doesn't need to re-specify it.

Considerations

  • The ServerToken model's `create` method throws if an instance already exists (even if revoked). The rotate command may need to either: create a new instance with a derived name, or modify the model to support re-creation after revocation.
  • The user must update their stored credential with `swamp auth server-login` after rotation.
  • This is a local-only command (same as `token mint`) — requires vault access.

Priority

Low — revoke + re-mint works for now. This is a UX improvement for the token compromise workflow.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 3 MOREPR_MERGED+ 1 MORENOTIFICATION_SKIPPED

Shipped

6/19/2026, 9:45:40 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack726/19/2026, 8:47:29 PM
stack72 linked parent of #6626/19/2026, 5:38:50 PM

Sign in to post a ripple.