-
Notifications
You must be signed in to change notification settings - Fork 0
[Fix] support header forwarding for temporal ACP #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
165b751
fix: support header forwarding for temporal ACP
prassanna-ravishankar 8c7ac96
switch to header only
prassanna-ravishankar 6d95eff
Merge branch 'main' into fix/header-forwarding-temporal
prassanna-ravishankar 364578d
Merge branch 'main' into fix/header-forwarding-temporal
prassanna-ravishankar b4c898f
Allow x-request-id forwarding for tracing
prassanna-ravishankar 442f6f2
Revert x-request-id changes - out of scope
prassanna-ravishankar ceaf566
remove temp example
prassanna-ravishankar 56c555e
Remove x-request-id from BLOCKED_HEADERS
prassanna-ravishankar 6941901
Remove x-request-id from test data
prassanna-ravishankar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,37 @@ | ||
| from __future__ import annotations | ||
|
|
||
| # Header filtering rules for FastACP server | ||
| # These rules match the gateway's security filtering | ||
|
|
||
| # Prefixes to skip (case-insensitive beginswith checks) | ||
| FASTACP_HEADER_SKIP_PREFIXES: tuple[str, ...] = ( | ||
| "content-", | ||
| # Hop-by-hop headers that should not be forwarded | ||
| HOP_BY_HOP_HEADERS: set[str] = { | ||
| "connection", | ||
| "keep-alive", | ||
| "proxy-authenticate", | ||
| "proxy-authorization", | ||
| "te", | ||
| "trailer", | ||
| "transfer-encoding", | ||
| "upgrade", | ||
| "content-length", | ||
| "content-encoding", | ||
| "host", | ||
| "user-agent", | ||
| "x-forwarded-", | ||
| "sec-", | ||
| ) | ||
| } | ||
|
|
||
| # Exact header names to skip (case-insensitive matching done by lowercasing keys) | ||
| FASTACP_HEADER_SKIP_EXACT: set[str] = { | ||
| "x-agent-api-key", | ||
| "connection", | ||
| "accept-encoding", | ||
| # Sensitive headers that should never be forwarded | ||
| BLOCKED_HEADERS: set[str] = { | ||
| "authorization", | ||
| "cookie", | ||
| "content-length", | ||
| "transfer-encoding", | ||
| "x-agent-api-key", | ||
| "x-request-id", | ||
| } | ||
|
|
||
| # Legacy constants for backward compatibility | ||
| FASTACP_HEADER_SKIP_EXACT: set[str] = HOP_BY_HOP_HEADERS | BLOCKED_HEADERS | ||
|
|
||
| FASTACP_HEADER_SKIP_PREFIXES: tuple[str, ...] = ( | ||
| "x-forwarded-", # proxy headers | ||
| "sec-", # security headers added by browsers | ||
| ) | ||
|
|
||
|
|
||
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.