Skip to content

Token expiry and rotation metadata for sc serve tokens (P29) #209

Closed

Description

@tonibergholm

sct- bearer tokens have no expiry field. Rotation today is add-new plus remove-old, with nothing to automate it or remind the operator. Deferred in ROADMAP.md (P29).

Acceptance criteria

  • A token can be created with an expiry (sc serve token add --expires <duration|date>); no expiry stays the default.
  • Scope/TokenEntry in crates/repo/src/serve_tokens.rs carry the expiry in serve-tokens.toml, and old files without it still load.
  • verify rejects an expired token, so the connection gets the same 401 as an unknown token (ADR-0040; keep the mandatory-auth behavior from fix(repo): answer 401 before 404 on a mandatory-auth listener #207).
  • sc serve token list shows expiry and flags expired tokens.
  • A way to rotate in one step (sc serve token rotate <label>: new secret under the same label and scope, old one removed), printing the new token once.
  • Tests for expiry boundaries, a file without the field, and rotation. Update ADR-0040 and ROADMAP.md.

Open point: whether an expired token should keep a tombstone entry in the file or be dropped on the next write. Pick the simpler one and record it in the ADR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentTriage: ready for an agent to pick up

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions