Skip to content

fix: strip client actor headers unconditionally - #30037

Merged
johnstcn merged 1 commit into
mainfrom
fix/strip-client-actor-headers
Sep 29, 2026
Merged

johnstcn merged 1 commit into
mainfrom
fix/strip-client-actor-headers

Conversation

@johnstcn

Copy link
Copy Markdown
Member

Strip all client-supplied headers matching IsActorHeader() in PrepareClientHeaders, regardless of send_actor_headers. This reserves the case-insensitive X-AI-Bridge-Actor prefix for identity injected by the gateway. Remove the redundant deletion of the three standard actor headers from BuildUpstreamHeaders.

Behavior change: intercepted requests no longer pass client actor-prefixed headers upstream when actor forwarding is off, including custom names under that prefix. Authenticated actor injection when enabled, non-prefixed headers, and passthrough routes are unchanged.

Depends on #29930. Follow-up to Lisa's review, kept separate from email opt-in.

Implementation and verification
  • Reuse the existing prefix predicate at the shared client-header filtering boundary. Delete exact keys from the cloned map so noncanonical casing is handled without mutating input.
  • Extend existing unit coverage for standard/custom prefixes, mixed casing, multiple values, forwarding off/on, authenticated reinjection, and unrelated header preservation. No additional deployment-backed integration fixture.
  • Confirm the new assertions fail before the implementation and pass afterward.
  • Verified go test ./aibridge/... ./coderd/aibridged/..., focused race tests, and full pre-commit generation, formatting, lint, and build checks.

Generated with Coder Agents on behalf of @johnstcn.

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

@johnstcn
johnstcn added this pull request to stack #29932 September 28, 2026 09:28
@johnstcn
johnstcn marked this pull request as ready for review September 28, 2026 09:28
Comment thread aibridge/intercept/client_headers.go Resolved

@mtojek mtojek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@ssncferreira ssncferreira left a comment

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.

LGTM 👍

@johnstcn
johnstcn force-pushed the fix/strip-client-actor-headers branch from 130ac45 to cec5ec0 Compare September 29, 2026 19:00
Base automatically changed from feat/actor-email-opt-in to main September 29, 2026 19:07
@johnstcn
johnstcn force-pushed the fix/strip-client-actor-headers branch from cec5ec0 to 52c2657 Compare September 29, 2026 19:07
@johnstcn
johnstcn merged commit 9fa17a1 into main Sep 29, 2026
32 checks passed
@johnstcn
johnstcn deleted the fix/strip-client-actor-headers branch September 29, 2026 19:26
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 29, 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.

3 participants