Scoped API tokens for headless importers #3
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
Implements ADR 0003. Users mint named, revocable, non-expiring API tokens scoped to writing
DailyMetrics.Access tokens live 15 minutes and refresh tokens rotate — revoking the old one on use. An automation that loses network between "old token revoked" and "new token persisted" is locked out permanently and silently, and iOS Shortcuts has no durable place to keep a rotating secret. So the session flow cannot serve automations.
A token must not be able to read entries, change a password, or delete data. Scope is enforced at the extractor, not per handler, so a new endpoint cannot accidentally become token-accessible by omission.
Because these never expire, listing and revoking them is required surface, not optional polish. The token value is shown once at mint time and stored hashed.
Acceptance criteria
Blocked by
None - can start immediately.