feat: Add SSE stream filtering and dynamic upstream support#2
Merged
emretinaztepe merged 1 commit intomainfrom Feb 27, 2026
Merged
Conversation
Add real-time filtering of Server-Sent Event streams and agent-specified dynamic upstreams, enabling Wardgate to proxy streaming LLM APIs (OpenAI, Anthropic, etc.) while maintaining credential isolation and sensitive data filtering. SSE filtering: - Per-chunk scanning of SSE data fields as they stream through - Supports redact (inline replacement) and block (stream termination) - SSE metadata lines (id, event, retry) and [DONE] sentinels pass through - Configurable via sse_mode: filter (default) or passthrough - 1MB per-line limit to protect against oversized payloads Dynamic upstreams: - Endpoints can declare allowed_upstreams glob patterns instead of a fixed upstream URL - Agents specify the target per-request via X-Wardgate-Upstream header - Glob matching with scheme enforcement, case-insensitive hostnames, and path segment boundary checks - Header is stripped before forwarding to upstream Documentation: - Added walkthrough for configuring SSE endpoints (OpenAI example) - Updated architecture and configuration reference docs Signed-off-by: Emre Tinaztepe <emre@binalyze.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add real-time filtering of Server-Sent Event streams and agent-specified dynamic upstreams, enabling Wardgate to proxy streaming LLM APIs (OpenAI, Anthropic, etc.) while maintaining credential isolation and sensitive data filtering.
SSE filtering:
Dynamic upstreams:
Documentation:
What
Why
Checklist
go test ./...)go fmt ./...)git commit -s) per the DCODCO Sign-Off
All commits must include a
Signed-off-byline (usegit commit -s). This certifies that you wrote or have the right to submit the code under the project's AGPL-3.0 license. See the Developer Certificate of Origin for details.