Add API key authentication foundation #33
Labels
No labels
activitypub
admin
api
articles
auth
bug
cleanup
cli
comments
compatibility
config
contacts
database
deployment
design
dev-env
docs
documentation
email
enhancement
feature
federation
feed
homepage
implementation
integration
media
openapi
priority:high
priority:low
priority:medium
proof
public-routes
public-ui
release
safety
social
sources
status:active
status:canceled
status:done
status:inprogress
status:waiting
syndication
tailwind
template
test
web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
erik/slugkit#33
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Goal
Implement the DB-backed API key foundation needed for protected Slugkit API routes and future
slugauthentication checks, without building the full admin UI or passkey flow in this slice.Spec:
docs/web-specs/03-admin-auth-keys-passkeys.mdRequirements
Acceptance criteria
Dependencies
Add admin auth and API key UIto Add API key authentication foundationSynced from todu comment by @todu on 2026-05-22T16:40:09.342Z
Scope Split
Narrowed this task from the full admin auth/passkey/API-key UI scope to the first reviewable slice: DB-backed API key authentication foundation.
Tracked deferred scope as follow-up tasks:
task-8af07ab8— Add admin login and session routestask-931b710f— Add admin API key management UItask-d352924e— Add admin passkey managementtask-99c66789— Add passkey admin authenticationReason: the original task combined API key storage, protected API middleware, admin sessions, API key UI, and passkey flows into one broad PR. The foundation slice unblocks protected API route implementation while preserving follow-up work explicitly.
Synced from todu comment by @todu on 2026-05-22T16:46:57.857Z
PR Review: Approved
PR: #56
Summary
Reviewed PR #56 at commit
a2b674b. The PR implements the narrowed API key authentication foundation: adds anapi_keysmigration, hash-only key storage, creation/listing/revocation/verification helpers, a reusable DB-backed bearer validator, and tests proving migration, redaction, revocation, invalid/missing auth failures, and valid protected-route authentication.Acceptance Criteria
db:migratesmoke.createApiKeyreturnsrawKey; DB storeskey_hashand metadata only; tests assert raw key is not persisted.listApiKeysselects metadata columns only; tests assert norawKeyorkeyHash.revoked_atexcludes keys from verification; tests cover revoked key rejection.createBearerAuthMiddleware+createApiKeyValidator.make check,./scripts/pre-pr.sh, manual migration smoke, and Forgejo CI passed.Blocking Issues
None.
Warnings
None.
Verdict
Approved for merge.
Synced from todu comment by @todu on 2026-05-22T16:49:51.075Z
Closing Summary
PR #56 merged: #56
Acceptance criteria evidence:
createApiKeyand tests asserting raw key is not persisted.listApiKeysand redaction tests.revoked_atverification behavior and tests.createBearerAuthMiddlewareandcreateApiKeyValidator.make check,./scripts/pre-pr.sh, PR CI, and main push CI.Post-merge cleanup: local and remote feature branches deleted.
Readiness: READY