mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-10-02 03:24:42 +08:00
Follow up on issue #1168 and the base PR #1215 #### Identity RPCs (`MintJWT` / `MintCert`) * **Requests:** Added full declarative validation tags (required, formatting, enum bounds) to all fields in `MintJWTRequest` and `MintCertRequest`. * **Handlers:** Validation now occurs immediately after authentication (the `purpose != ATUNNEL` policy check remains in the handler). #### Notes * **Stricter Validation:** Empty `atespace`/`actor_name` can no longer mint malformed JWT subjects. UIDs must now be valid UUIDs. * **Better Errors:** `MintJWT` empty-audience error is now an `InvalidArgument` (was `Unknown`) checked *before* disk I/O. `MintCert`'s atespace-on-global-ref error is now typed `Forbidden` (was `Invalid`). #### Testing * Added 20 new table-driven test cases (`TestValidateMintJWTRequest` / `TestValidateMintCertRequest`), as these requests previously lacked validation tests. * Updated existing verb tests to match the new generated error shapes. * All test suites (`controlapi`, `functionaltest`, etc.), `go vet`, and `gofmt` pass cleanly. - [ ] Tests pass - [ ] Appropriate changes to documentation are included in the PR