Architecture · All ADRs
ADR 0004 — Identity: EdDSA access tokens, rotating refresh tokens, machine credentials
Architecture decision record — status: Accepted.
Status: Accepted
Decision#
- Access tokens: Ed25519-signed JWT (
typ: gs-access+jwt), 10-minute TTL, org-bound, carrying principal type, project/environment pinning, scopes, session or credential id, and delegation context. Key ring withkid; JWKS published for offline verification; rotation = prepend a key. - Principal state is re-checked on every request (session validity, membership role, agent status, credential status) with a 3-second in-process cache. Redis revocation marks are checked on every request.
- Refresh tokens: opaque, rotating, family-tracked; presenting a consumed token revokes the family and the session (theft detection).
- Machine principals (agents, service accounts, applications) authenticate with OAuth 2.0 client credentials:
client_secret(256-bit, hashed) orprivate_key_jwt(RFC 7523, single-usejti). Rotation keeps the old credential for a configurable grace window. - API keys (
gsk_…) for server-side automation; effective scopes = key ∩ owning service account. - Passwords: scrypt (N=2^15), uniform timing for unknown users, lockout after 10 failures.
Consequences#
Every protected request has a cryptographically verified principal; stolen tokens are short-lived and revocable.