Admin API: typed /api/admin/* surface #13

Merged
arne merged 15 commits from admin-api-spec into main 2026-04-13 14:28:22 +02:00
Owner

Summary

  • Spec: docs/superpowers/specs/2026-04-13-admin-api-design.md
  • Implements the typed /api/admin/* surface that replaces direct-SQLite metadata edits.
  • New package internal/adminapi; new store methods in internal/store/admin.go.

Test plan

  • go test ./... green
  • Manual smoke: curl -H "Authorization: Bearer $BOOKS_ADMIN_TOKEN" $PUBLIC/api/admin/books?q=tolkien
  • Verify PATCH diff response shape on a real book
  • Verify 404 on /api/admin/* when BOOKS_ADMIN_TOKEN is unset
## Summary - Spec: `docs/superpowers/specs/2026-04-13-admin-api-design.md` - Implements the typed `/api/admin/*` surface that replaces direct-SQLite metadata edits. - New package `internal/adminapi`; new store methods in `internal/store/admin.go`. ## Test plan - [ ] `go test ./...` green - [ ] Manual smoke: `curl -H "Authorization: Bearer $BOOKS_ADMIN_TOKEN" $PUBLIC/api/admin/books?q=tolkien` - [ ] Verify PATCH diff response shape on a real book - [ ] Verify 404 on `/api/admin/*` when `BOOKS_ADMIN_TOKEN` is unset
arne added 14 commits 2026-04-13 14:16:34 +02:00
Second of three specs in the auth/admin/htmx roadmap. Defines the
typed /api/admin/* surface that replaces direct-SQLite metadata edits.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Task-by-task TDD plan for the /api/admin/* surface defined in
2026-04-13-admin-api-design.md. New internal/adminapi package with
store-layer methods in internal/store/admin.go.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The scaffold-era test passed a nil store to adminapi.New and asserted
a 404 from a placeholder handler. Real handlers now dereference the
store and panic on nil. The surviving token-unset and wrong-token
cases still cover the auth wiring.
Machine-readable complement to the prose spec. Covers every endpoint,
error response, and the shared ChangedResponse/Error shapes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
arne merged commit d78b653f05 into main 2026-04-13 14:28:22 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
arne/books!13
No description provided.