Skip to content

test(egress): catch RoundTripper wrappers that bypass egress - #121

Merged
pavelanni merged 1 commit into
mainfrom
test/egress-guard
Nov 7, 2026
Merged

pavelanni merged 1 commit into
mainfrom
test/egress-guard

Conversation

@pavelanni

Copy link
Copy Markdown
Collaborator

Summary

  • Extends the egress source scan beyond http.Transport literals to flag http.RoundTripper fields and type aliases, RoundTrip implementations, and Transport assignments whose value does not come from internal/egress.
  • internal/a2acall/a2acall.go is explicitly allowlisted with a reason: its capture transport intentionally wraps the injected egress transport to surface non-2xx peer error codes.
  • Proven to catch the WP11 pattern: a temporary wrapper added to internal/webfetch/webfetch.go failed the test at webfetch.go:125 with the file:line and remedy, then was reverted.
  • Corrects a stale comment that claimed a custom dialer "bypasses the supervisor's namespace redirect" (WP01 established the redirect is below the dialer).

Testing

  • go test ./internal/egress/ -run 'TestNoRaw|TestNoAdHoc' -v
  • make lint (0 issues)
  • make test

🤖 Generated with Claude Code

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]>
@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

@pavelanni
pavelanni marked this pull request as ready for review November 7, 2026 00:54
@pavelanni
pavelanni merged commit 72ac7a9 into main Nov 7, 2026
5 checks passed
@pavelanni
pavelanni deleted the test/egress-guard branch November 7, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant