Add X-Forwarded-Prefix support for SSE endpoint URL rewriting#3210
Add X-Forwarded-Prefix support for SSE endpoint URL rewriting#3210
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3210 +/- ##
==========================================
+ Coverage 56.99% 57.06% +0.06%
==========================================
Files 348 350 +2
Lines 34635 34744 +109
==========================================
+ Hits 19740 19826 +86
- Misses 13250 13270 +20
- Partials 1645 1648 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Implement SSE endpoint URL rewriting in the TransparentProxy to support path-based ingress routing that strips path prefixes. Changes: - Add endpointPrefix and trustProxyHeaders fields to TransparentProxy - Add sseRewriteConfig type for holding rewrite configuration - Add getSSERewriteConfig() to determine rewrite config with priority: 1. Explicit endpointPrefix (highest priority) 2. X-Forwarded-Prefix header (when trustProxyHeaders is true) 3. No rewriting (default) - Add rewriteEndpointURL() to handle both relative and absolute URLs - Refactor SSE response processing with sseLineProcessor struct - Only rewrite "event: endpoint" events, pass others unchanged - Preserve existing session ID extraction functionality Fixes #3071 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Wire the endpointPrefix configuration through the transport layer: - Add EndpointPrefix to transport.Config struct - Add EndpointPrefix to runner.RunConfig struct - Update HTTPTransport to accept and pass endpointPrefix to proxy - Update factory.go to pass EndpointPrefix from config - Update runner.go to include EndpointPrefix in transport config 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add CLI support for specifying the SSE endpoint URL prefix: - Add EndpointPrefix field to RunFlags struct - Add --endpoint-prefix flag with help text - Add validation to ensure prefix starts with '/' when provided - Add WithEndpointPrefix builder option in config_builder.go 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add Kubernetes CRD support for configuring SSE endpoint URL prefix: - Add EndpointPrefix field to MCPServerSpec and MCPRemoteProxySpec - Wire field through controllers to runner config - Regenerate CRD manifests with operator-generate/operator-manifests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Regenerate CLI docs with new --endpoint-prefix flag - Add SSE Endpoint URL Rewriting section to transport architecture doc - Document priority order, CLI usage, and Kubernetes CRD examples 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Large PR Detected
This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.
How to unblock this PR:
Add a section to your PR description with the following format:
## Large PR Justification
[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformationAlternative:
Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.
See our Contributing Guidelines for more details.
This review will be automatically dismissed once you add the justification section.
Large PR justification has been provided. Thank you!
|
✅ Large PR justification has been provided. The size review has been dismissed and this PR can now proceed with normal review. |
In order to minimize the amount of transport-specific logic in the transparent proxy, create a response processor interface and put the new SSE rewrite logic behind that interface. Create a no-op implementation for HTTP streamable.
[Originally created by @jhrozek]
Implement SSE endpoint URL rewriting in the TransparentProxy to support
path-based ingress routing that strips path prefixes.
Changes:
Fixes #3071
Large PR Justification