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
3 times, most recently
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. |
ewels
force-pushed
the
claude/wave-proxy-auth-ix28b5
branch
from
August 31, 2026 07:34
2460c8b to
afd5d31
Compare
Member
Author
|
Following up on the comment above: this PR has now been reworked to do exactly that — it pulls in the shared libseqera implementation instead of carrying a duplicate fix.
One behavioural note from adopting the shared library: no-proxy entries follow lib-httpx semantics (bare hostnames also match sub-domains, Generated by Claude Code |
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. The proxy selector and proxy-scoped authenticator are provided by the io.seqera:lib-httpx library (HxProxyConfig), mirroring the equivalent support implemented in Nextflow, so both products share the same proxy semantics. 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
August 31, 2026 07:59
afd5d31 to
16ed793
Compare
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.). It mirrors the approach used to fix the same problem in Nextflow (nextflow-io/nextflow#7331): the proxy selector and proxy-scoped authenticator come from the sharedio.seqera:lib-httpxlibrary (HxProxyConfig), so both products share the same proxy semantics.Changes
io.seqera:lib-httpx:2.6.0(new dependency): providesHxProxyConfig— per-protocol HTTP/HTTPS proxy entries with aProxySelectorhonouring the no-proxy list, and anAuthenticatorscoped toRequestorType.PROXYand the configured proxy host/port so credentials are only ever released to the proxy itself.ProxyConfig(new, modelled on Nextflow'snextflow.util.ProxyConfig): parses[http[s]://][user:pass@]host[:port]proxy URIs (percent-encoded credentials supported, with+shielded from the form-decoding rule) and resolves theHxProxyConfigfrom either an explicit URI or theHTTPS_PROXY/HTTP_PROXY/NO_PROXYenvironment variables (per-protocol proxies supported via env vars).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 the environment variables when not set — and applies the result toHttpClientFactory.HttpClientFactory: clients are built withHxProxyConfig.toProxySelector()/.toAuthenticator()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).docs/install/reference.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).No-proxy semantics follow lib-httpx (same as Nextflow): bare host names match the host and its sub-domains,
.domain/*.domainsuffixes match sub-domains only,*disables proxying, and loopback targets always bypass the proxy. CIDR entries are not supported.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/install/reference.md:Tests
ProxyConfigTest: URI/credential parsing, env-var resolution (per-protocol proxies, lowercase variants, credentials), no-proxy matching via the selector (suffix/wildcard/loopback), authenticator scoping (requestor type, host, port).HttpClientFactoryProxyTest: integration test against an in-process authenticating proxy (FakeProxyServer, supporting Basic auth, plain forwarding and CONNECT tunnelling), with target servers bound to a non-loopback address since loopback targets always bypass the proxy:keytool), which requires-Djdk.http.auth.tunneling.disabledSchemes=— added to thetesttask inbuild.gradle.All 44 new tests pass. Pre-existing network-dependent suites 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