Repository navigation
feat(http): opt-in explicit egress proxy, still no autodiscovery (#589) - #601
Merged
Merged
Conversation
HttpClientConfig gains `explicit_proxy: Option<ProxyUrl>`. None, the default, keeps the builder byte-identical (`.no_proxy()`). Some routes every request through `reqwest::Proxy::all`, added after `.no_proxy()`, so HTTP(S)_PROXY / ALL_PROXY / NO_PROXY stay ignored either way. ProxyUrl::parse matches rustsdcmcp's shipped `egress_proxy`: http or https scheme with a host, userinfo accepted (sent as Proxy-Authorization: Basic). It additionally refuses a path, query or fragment, which reqwest would drop silently. Errors never echo the input, Debug goes through SafeUrl, and there is no Display. Tests: default has no proxy; bad schemes/paths rejected without echoing the password; config/client/error Debug never carries the userinfo; a re-exec'd child proves requests CONNECT through the explicit proxy with the Basic header while env proxies point at a decoy that is never dialled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… silently (#589) hyper-util re-parses the proxy as an http::Uri (about 64 KiB max) and, on failure, returns no intercept without an error, so a ProxyUrl with a very long password left the client going direct. ProxyUrl::parse now refuses a serialized URL over 2048 bytes, without echoing it. The wiring test now asserts the client carries the proxy as its https intercept target, not just a `proxies` entry (a dropped proxy still shows `proxies: [Matcher]`). New test covers the cap boundary and the 70,000-byte case. CHANGELOG: the source break moves to a `### Changed` "Breaking for source (#589)" bullet naming the affected consumers. mecmcp-oidc's doc now says "no proxy autodiscovery". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pre-push credential gate rejects http(s) URLs with a userinfo password unless it is a placeholder; use PASSWORD in the doc and build the over-length fixture from pieces. Same bytes at runtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Fixes #589.
HttpClient::newhard-coded.no_proxy(), andHttpClientConfighad no proxy field. That blocked rustsdcmcp, which ships an explicitegress_proxy, from building on mecmcp-http.Changes
HttpClientConfig::explicit_proxy: Option<ProxyUrl>.None(the default) leaves the built client identical to before, still.no_proxy().Someaddsreqwest::Proxy::allafter.no_proxy(). That order keeps the explicit proxy, and environmentHTTP(S)_PROXY,ALL_PROXYandNO_PROXYare never read in either case. I checked this against the locked reqwest 0.13.5 and hyper-util 0.1.21 source.ProxyUrl::parsevalidation.httpandhttpsschemes only. Anhttp://proxy uses CONNECT, so TLS to the origin stays end-to-end.egress_proxy.Debug(it goes throughSafeUrl) or in errors, andProxyUrlhas noDisplay.crates/rustmistmcp-core/src/client.rs:187and:290needexplicit_proxy: Noneor..Default::default(). This calls for a minor release, 0.32.0.Verification
clippy --workspace --all-targets --all-features -D warnings, and the workspace tests with features all pass: 2386 passed, 0 failed..no_proxy(), skipping the proxy wiring, or printing the raw URL each makes a test fail.https: Intercept { uri: … }. Boundary tests: exactly 2048 bytes is accepted and wired; 2049 and 70,000 bytes are rejected without echoing the URL.codex exec review --commitpasses on both code commits. Credentialed fixture URLs use the gate-exemptPASSWORDplaceholder.Not covered
https://proxy.Url; reqwest and hyper-util keep their own copies anyway.🤖 Generated with Claude Code