Repository navigation
test(egress): catch RoundTripper wrappers that bypass egress - #121
Merged
Merged
Conversation
The transport scan only saw http.Transport literals, so a hand-written RoundTripper wrapper could replace the egress-configured client without notice. Flag RoundTripper fields, type aliases, RoundTrip implementations, and Transport assignments that do not come from egress. a2a_call's capture transport is the one intentional wrapper and is allowlisted with a reason. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
http.Transportliterals to flaghttp.RoundTripperfields and type aliases,RoundTripimplementations, andTransportassignments whose value does not come frominternal/egress.internal/a2acall/a2acall.gois explicitly allowlisted with a reason: its capture transport intentionally wraps the injected egress transport to surface non-2xx peer error codes.internal/webfetch/webfetch.gofailed the test atwebfetch.go:125with the file:line and remedy, then was reverted.Testing
go test ./internal/egress/ -run 'TestNoRaw|TestNoAdHoc' -vmake lint(0 issues)make test🤖 Generated with Claude Code