Repository navigation
fix(api): bound authentication error response bodies - #23
hostodo-hermes-operations[bot] wants to merge 1 commit into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Required Hostodo review-role round at
The shared API client's 401 body is capped at 2 MiB, exact-boundary/read-error/body-close coverage is present, and expired/revoked classification is preserved for bounded responses. Follow-ups, not blockers for this scoped PR: device-flow login uses another unbounded response reader, other non-401 responses remain unbounded, and this repository has no Go test/build CI job. Visible checks: Semgrep passed; CodeRabbit skipped the bot-authored PR. The literal Cursor Codex/ |
Summary
ErrAuthenticationResponseTooLargewhen an untrusted auth response exceeds the boundWhy
api.Client.doRequestpreviously called unboundedio.ReadAll(resp.Body)on every 401 before returning an authentication error. Commands using the shared client could therefore exhaust local memory on an unexpectedly large proxy or authentication-failure response. This also bypassed command-specific response caps in downstream callers such asodo-cli-adminnode placement.Verification
go test -count=1 ./...— PASSgo vet ./...— PASSgo build ./...— PASSgofmt/git diff --check— PASS9349b49395aa5d21d75b1860199f651abc9547fb3e2d1fe3eda188c0c53305d1— PASSDependency
This is the shared-client dependency for
hostodo/odo-cli-admin#25. Merge this library fix before the admin CLI PR; the admin CLI will pin the reviewed commit so its 2 MiB node-placement response limit also covers HTTP 401 responses.Merge gate
Do not merge. Hostodo code requires the required review gates and Hassan's explicit approval in the current Slack conversation.