Pin Go authentication and user-command payloads
Added literal command-code and complete-payload assertions for login, logout, lookup, listing, password-change, and deletion requests, including numeric and named user identifiers.
apache/iggy · #4334
Protocol-contract coverage
Apache Iggy's Go SDK now detects byte-level changes to six authentication and user-management commands before they can diverge from the server's binary decoders.
Problem
The Go SDK's session and user commands had MarshalBinary implementations without direct wire-format assertions, so changes to command codes, identifier variants, length prefixes, or field order could escape focused tests.
Approach
Adds serialization tests for LoginWithPersonalAccessToken, LogoutUser, GetUser, GetUsers, ChangePassword, and DeleteUser, with expected bytes checked against the corresponding Rust protocol definitions and server decoders.
Impact and scope
- Makes the cross-language binary contract explicit for six authentication and user-management commands.
- Covers both numeric and named user identifiers, protecting their different discriminators, lengths, and payload layouts.
- Changes tests only; no production encoder, public API, authentication behavior, or runtime command path was modified.
- The personal-access-token assertion covers the legacy command-code 44 format; the live TCP client uses the separately tested VSR login path.
- The related Go SDK testing issue remains open, so this contribution covers one additional command family rather than claiming the entire issue.
Validation
- Passed the complete Go suite with cache disabled, the complete race-enabled Go suite, go vet, and the applicable pre-commit and pre-push hooks.
- All 53 executed hosted checks passed, including Go build, lint, tests, E2E, race-enabled BDD, examples, and Codecov checks; ten unrelated language jobs were skipped by change detection.
- One Apache Iggy member and two contributors approved the final result; the functional test commit is authored by Goutam Adwant and a contributor merged the latest master branch before approval.