[api] owner-scoping regression test (deferred from !8 review) #23

Closed
opened 2026-10-23 23:38:41 -05:00 by nicolas_naranjo · 0 comments
Owner

Deferred from the !8 api review and still open; now in your lane per #20.

Gap: the automata CRUD is owner-scoped (queries filter by the identity from Remote-User), but there is no regression test proving user A cannot read/modify/list user B's documents. All api tests run without a database today.

Suggested shape: a #[tokio::test] gated on TEST_DATABASE_URL (skip with an eprintln when unset, so CI and local runs stay green without postgres) that spins the router against a real pool, creates docs as two identities, and asserts cross-user reads/writes/lists/deletes 404 (per the contract error envelope).

Compose already provides a throwaway postgres: docker compose -f deploy/docker-compose.yml up postgres -d → postgres://rgxr:rgxr@localhost:5432/rgxr.

Deferred from the !8 api review and still open; now in your lane per #20. **Gap:** the automata CRUD is owner-scoped (queries filter by the identity from `Remote-User`), but there is no regression test proving user A cannot read/modify/list user B's documents. All api tests run without a database today. **Suggested shape:** a `#[tokio::test]` gated on `TEST_DATABASE_URL` (skip with an eprintln when unset, so CI and local runs stay green without postgres) that spins the router against a real pool, creates docs as two identities, and asserts cross-user reads/writes/lists/deletes 404 (per the contract error envelope). Compose already provides a throwaway postgres: `docker compose -f deploy/docker-compose.yml up postgres -d` → `postgres://rgxr:rgxr@localhost:5432/rgxr`.
Ghost added this to the SCRUM project 2026-10-24 08:43:59 -05:00
Sign in to join this conversation.
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
k8s-services/rgxr#23
No description provided.