feat(api): scoped write access to the read-only REST API #25
Loading…
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?
Summary
The
/api/v1REST API is currently 100% read-only — all mutations require a session-cookie-authenticated HTMX request through the web UI. This blocks lightweight integrations (e.g. a phone shortcut, a Home Assistant automation, a physical NFC tag on a hutch) that want to do one specific, low-risk action like "mark this hutch cleaned" without a full login flow.Proposal
/api/v1, starting with the lowest-risk, highest-value ones:POST /api/v1/hutches/{id}/mark-cleanedPOST /api/v1/hutches/{id}/mark-played_get_api_user) — for write access we likely want to start enforcing role on the API layer too (e.g. requirestaffor above for write endpoints), rather than opening writes to any read-only key holder.user_id/source marker) for traceability.Open questions