Skip to content

fix: make authentication persistence atomic - #59

Draft
cloudcarver wants to merge 1 commit into
mainfrom
agent/security-token-lifecycle
Draft

fix: make authentication persistence atomic#59
cloudcarver wants to merge 1 commit into
mainfrom
agent/security-token-lifecycle

Conversation

@cloudcarver

@cloudcarver cloudcarver commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • persist opaque-key expiry and enforce it in database reads and consumes
  • atomically consume refresh tokens and create replacement token pairs in one transaction
  • add a database uniqueness constraint for usernames and map conflicts to HTTP 409
  • invalidate legacy keys safely during migration
  • add concurrent replay, expiry-without-worker, and concurrent sign-up coverage

Validation

  • go test ./...
  • go test -race ./pkg/auth ./pkg/macaroons/... ./pkg/service ./pkg/controller
  • go test -tags smoke -count=1 -run TestAuthAPI... ./e2e
  • go vet ./...

Closes #33
Closes #34
Closes #53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Security] Enforce unique usernames atomically [Security] Enforce token expiry synchronously [Security] Make refresh-token rotation atomic

1 participant