servertest: cover API error translation for missing and invalid input

Asserts not-found nodes/users/keys return 404 and invalid CIDR/policy
return 400. These caught the node-500 and pre-auth-key silent-success
bugs fixed alongside.
This commit is contained in:
Kristoffer Dalby
2026-06-18 07:37:25 +00:00
parent 18f7048c58
commit 92048385c2
2 changed files with 108 additions and 0 deletions
+13
View File
@@ -99,6 +99,19 @@ an empty object.
**Client impact:** scripts parsing the empty `{}` should read the `result`
field (machine-readable output) or rely on the exit code.
### Missing resources return a consistent `404`
**What:** renaming or expiring an unknown node, and expiring or deleting an
unknown pre-auth key, now return `404 Not Found`. Previously the node
operations surfaced as `500` and the pre-auth key operations reported success
without changing anything.
**Why:** a missing resource is a client error, not a server error, and an
expire or delete that matched no row should not report success.
**Client impact:** code that treated these as `500` or as a silent success
should handle `404`.
## Delivery note (not a shipped behaviour change)
The grpc-gateway HTTP facade is replaced wholesale at `/api/v1` by the ogen