feat: per-service custom User-Agent override for proxy#260
Merged
Conversation
Instead of globally replacing the client User-Agent (which breaks downstreams like GitHub that validate UA), add an opt-in custom_user_agent field on UserService and DownstreamService. When set, the proxy replaces the client UA with the configured value. When unset (default), the client UA passes through unchanged. Applied in all four proxy paths: direct HTTP, node HTTP, direct WS, and node WS. Validated at 256 chars max with control character rejection. Exposed on all service update APIs and the frontend key-detail page. Closes #184
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.
Summary
custom_user_agent: Option<String>toUserServiceandDownstreamServicemodels/user-services,/keys,/services) and the frontend key-detail pageReplaces the global UA replacement approach in #256 with a per-service opt-in override. This avoids breaking downstreams like GitHub (which returns 403 without a valid User-Agent) while still letting users fix WAF-blocked services like the Chrono LLM gateway.
Closes #184
Supersedes #256
Test plan
cargo test-- 1356 tests pass (1165 backend + 139 CLI + 52 node-agent)cargo clippy-- cleannpm run build(frontend) -- cleannpm run lint(frontend) -- no new warningsforward_request_passes_through_user_agent_by_default-- verifies passthroughforward_request_overrides_user_agent_when_service_has_custom-- verifies overridecustom_user_agenton a service via API, verify downstream receives it