Skip to content

⭐ User Contract

Terrence Daniels edited this page Aug 14, 2026 · 1 revision

user-contract is the shared gRPC contract module — one hand-written user.proto, everything else (LoginRequest, LoginResponse, ValidateTokenRequest, ValidateTokenResponse, UserIdentityServiceGrpc) is protoc-generated. Its row on the services-reference.html diagram covers where it fits.

ValidateToken has zero real callers anywhere in this repo. The original plan was for api-gateway-service to call it on every guarded request; what actually got built verifies tokens locally against a shared HMAC secret instead (see Saga Flow) — a legitimate pattern on its own, but tested API surface built against a stated intent that was never wired up. Flagged during the code-review audit, not fixed — see docs/code-review.md.

No generated code is unit-tested directly — that would test protoc's own codegen, not this repo's logic. UserContractSerializationTest instead round-trips every message through toByteArray()parseFrom(), including an expires_in_seconds test at the Long.MAX_VALUE boundary to catch a varint-encoding bug a "happy path" number could never expose.

Clone this wiki locally