Skip to content

refactor(aibridge): share client request header stripping - #29720

Closed
pawbana wants to merge 7 commits into
mainfrom
pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-3
Closed

pawbana wants to merge 7 commits into
mainfrom
pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-3

Conversation

@pawbana

@pawbana pawbana commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Move PrepareClientHeaders and its header lists from intercept to utils so the reverse proxy can strip the same client headers as interception. No behavior change.

  • utils.PrepareClientHeaders: unchanged header lists (hop-by-hop, transport, auth, proxy, Agent Firewall). Callers set the upstream credential afterwards.
  • intercept.BuildUpstreamHeaders calls it and restores the SDK credential and actor headers as before.
  • Tests moved unchanged.

Generated by Coder Agents on behalf of @pawbana.

@linear-code

linear-code Bot commented Sep 22, 2026

Copy link
Copy Markdown

AIGOV-615

@pawbana pawbana removed their assignment Sep 22, 2026
@pawbana
pawbana added this pull request to stack #29736 September 22, 2026 16:14
@pawbana
pawbana force-pushed the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-2 branch 19 times, most recently from e718154 to 7ca2815 Compare September 23, 2026 14:34
@pawbana
pawbana force-pushed the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-3 branch 5 times, most recently from eb687de to 81f64a5 Compare September 23, 2026 15:14
@pawbana
pawbana force-pushed the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-3 branch from 81f64a5 to 5f56ab9 Compare September 23, 2026 15:26
@pawbana pawbana changed the title fix(aibridge): enforce the upstream forwarding security boundary refactor(aibridge): share proxy and Agent Firewall header stripping Sep 23, 2026
@pawbana
pawbana force-pushed the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-3 branch from 5f56ab9 to 06bbc31 Compare September 23, 2026 15:29
@pawbana
pawbana marked this pull request as ready for review September 24, 2026 11:47
@pawbana
pawbana force-pushed the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-2 branch from 7ca2815 to fdd1bd8 Compare September 24, 2026 11:53
@pawbana
pawbana force-pushed the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-3 branch from 06bbc31 to b5d6fb5 Compare September 24, 2026 11:53
Move the hop-by-hop, transport, and auth header lists next to the proxy
and Agent Firewall lists so interception and proxy mode strip the same
headers through utils.StripClientRequestHeaders.
@pawbana pawbana changed the title refactor(aibridge): share proxy and Agent Firewall header stripping refactor(aibridge): share client request header stripping Sep 24, 2026
Move PrepareClientHeaders to utils so it can be shared
between interception and proxy modes.
@pawbana
pawbana force-pushed the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-3 branch 2 times, most recently from 1b68dab to 2073fab Compare September 24, 2026 15:24
Restore the original per-group subtests from intercept so the test move
is verbatim apart from the package qualifier.
@pawbana
pawbana removed this pull request from stack #29736 September 24, 2026 17:36
Comment thread aibridge/utils/http.go
actorHeaderPrefixLower = "x-ai-bridge-actor"
)

// hopByHopHeaders are connection-level headers specific to the connection

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer if we have this in something like aibridge/headers instead of utils. Possibly with the actor headers logic?

@pawbana
pawbana force-pushed the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-2 branch 2 times, most recently from 5f648df to 5810943 Compare September 28, 2026 10:39
Base automatically changed from pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-2 to main September 28, 2026 10:55
@pawbana

pawbana commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

Done in #29718

@pawbana pawbana closed this Sep 28, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants