feat(api): cover nodes, access, members, audit #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/api-coverage"
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
feat/blueprints).Changes
POST /nodes,PATCH/DELETE /nodes/:id,POST /nodes/:id/token. A token is returned only by the response that creates the node or replaces its token, never in a listing; the OpenAPI schema has separateNodeandNodeWithTokenshapes, and the contract test checks that nothing else carries a token.GET/PATCH /resources/:id/access(sso,password,pin; text sets,nullremoves; empty and non-text values are422). Passwords and PINs are write-only: reads showpassword_setandpin_set. Rules (GET,POST,PATCH,DELETE) and share links (GET,POST,DELETE; the link's token only in the creating response). Raw TCP/UDP resources answer422.GET /membersandDELETE /members/:id(the last admin is refused with422). There is deliberately no way to add or promote a member: a key must not be able to grant a person access to the organization, the same reasoning that keeps keys from managing keys. A test pins the route set.GET /audit-eventswithcategory,limit(1 to 100) and an opaquebeforecursor, readable by read keys too so a log collector needs no more. This reverses a decision of #9 (audit log readable by admin users only);Audit.list_events/2now accepts an API-key scope.get_event!andsubscribestay admin-user only. The cursor is built from plain text, never a serialized term.create_share_linkno longer requires a person (created_by_idis nullable, nilified on user delete). A write key can already clear a resource's password, so this grants no new reach.Scopedocs updated.Verification
mix format --check-formatted,mix compile --warnings-as-errors,mix credo --strict(no issues),mix dialyzer(0 errors).mix test: 877 passed on SQLite and on PostgreSQL. No migration.422. The dev database was restored afterwards.