Support an authenticating egress proxy for outbound HTTP clients - #1076
Open
ewels wants to merge 1 commit into
Open
Support an authenticating egress proxy for outbound HTTP clients#1076ewels wants to merge 1 commit into
ewels wants to merge 1 commit into
Conversation
ewels
force-pushed
the
claude/wave-proxy-auth-ix28b5
branch
2 times, most recently
from
July 7, 2026 22:05
5c78170 to
2107550
Compare
Allow Wave to work behind a corporate egress proxy that requires authentication. The Java HttpClient instances created by HttpClientFactory now accept a proxy configuration resolved from the wave.httpclient.proxy.* settings, falling back to the HTTPS_PROXY/HTTP_PROXY/NO_PROXY environment variables, and send the proxy credentials via an Authenticator scoped to proxy requests originating from the configured proxy host. When an authenticating proxy is configured, the jdk.http.auth.tunneling.disabledSchemes and jdk.http.auth.proxying.disabledSchemes system properties are defaulted to empty at bootstrap - unless already set by the operator - since the JDK disables Basic authentication on HTTPS CONNECT tunnelling by default. No proxy configured means unchanged behaviour. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018zJyj9FkzUpMNuH51ScqAQ Signed-off-by: Claude <noreply@anthropic.com>
ewels
force-pushed
the
claude/wave-proxy-auth-ix28b5
branch
from
July 8, 2026 20:21
2107550 to
2460c8b
Compare
Member
Author
|
Note that another approach here could be to pull in libseqera to do more of the work and avoid having a duplicate fix to the other linked PRs. As that's a bigger change with wider architectural decisions to make I will leave that alone for now though. |
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
Addresses nextflow-io/nextflow#7305.
An on-prem Wave deployment behind a corporate egress proxy could not reach container registries or Seqera Platform: the outbound
java.net.http.HttpClientinstances created byHttpClientFactoryhad no proxy selector and — crucially — no proxy authenticator (java.net.http.HttpClientignoresAuthenticator.setDefault(); the authenticator must be set on the client builder).This PR adds egress proxy support to
HttpClientFactory, the single chokepoint through which all outbound clients are created (ProxyClient,StreamServiceImpl, registry auth/lookup, Tower connector, etc.).Changes
HttpProxyConfig(new): models the proxy settings — host, port, credentials and no-proxy list. Parses[http[s]://][user:pass@]host[:port]URIs (percent-encoded credentials supported) and provides:ProxySelectorthat routes requests via the proxy, honouring the no-proxy list (exact hosts,.domain/*.domainsuffixes, IPv4 CIDR blocks,*). Patterns are compiled at construction time since the selector runs on every outbound request. Loopback targets always bypass the proxy, unless the proxy itself is a loopback address;Authenticatorscoped toRequestorType.PROXYand the configured proxy host/port, so credentials are only ever released to the proxy itself.HttpClientFactory: clients are now built with the proxy selector and authenticator when a proxy is configured, via asetProxyConfig(...)bridge that invalidates the cached clients. With no proxy configured, no.proxy(...)call is made and behaviour is unchanged (requests still route viaProxySelector.getDefault(), i.e.-Dhttps.proxyHostet al. keep working).HttpClientConfig(now a@Contextbean): owns the new settingswave.httpclient.proxy.uri,.username,.password,.no-proxyalongside the existingwave.httpclient.*options, resolves them at startup — falling back to theHTTPS_PROXY/HTTP_PROXY/NO_PROXYenvironment variables when not set — and applies the result toHttpClientFactory.docs/configuration.md, including an explicit statement of scope (the Wave process's internal HTTP clients; Micronaut declarative clients, AWS SDK clients, and out-of-process build/scan/blob-cache jobs have their own proxy configuration paths).The
disabledSchemesdependencyBy default the JDK ships
jdk.http.auth.tunneling.disabledSchemes=Basic, which silently blocks Basic authentication on the HTTPS CONNECT tunnel — i.e. exactly the path used to reachhttps://registries through a proxy. When a proxy with credentials is configured,HttpClientConfigdefaults bothjdk.http.auth.tunneling.disabledSchemesandjdk.http.auth.proxying.disabledSchemesto empty at startup, unless the operator has already set them, in which case the operator's value wins.Because these properties are read once by the JDK HTTP stack, setting them explicitly on the JVM is the belt-and-braces alternative for containerised deploys, documented in
docs/configuration.md:Tests
HttpProxyConfigTest: URI/credential parsing, env-var fallback and precedence, no-proxy matching (suffix/wildcard/CIDR/loopback), selector routing, authenticator scoping.HttpClientFactoryProxyTest: integration test against an in-process authenticating proxy (FakeProxyServer, supporting Basic auth, plain forwarding and CONNECT tunnelling):keytool), which requires-Djdk.http.auth.tunneling.disabledSchemes=— added to thetesttask inbuild.gradle.All 45 new tests pass. Pre-existing network-dependent suites (
ProxyClientTest,RegistryLookupServiceTest) fail identically with and without this change in the sandbox environment (registry credentials/egress policy), i.e. no regression.Backwards compatibility
No proxy configured (neither settings nor environment variables) → no behaviour change. Note that deployments that already export
HTTPS_PROXY/HTTP_PROXYwill now have those honoured by Wave's outbound clients;NO_PROXYis honoured accordingly.🤖 Generated with Claude Code
https://claude.ai/code/session_018zJyj9FkzUpMNuH51ScqAQ