Skip to content

Forward proxy env vars from the host#635

Open
brettfo wants to merge 1 commit into
mainfrom
dev/brettfo/proxy-job-token
Open

Forward proxy env vars from the host#635
brettfo wants to merge 1 commit into
mainfrom
dev/brettfo/proxy-job-token

Conversation

@brettfo

@brettfo brettfo commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Updates the proxy container's environment:

  • JOB_TOKEN (from host) and DEPENDABOT_API_URL (from params.ApiUrl) — forwarded together, only when JOB_TOKEN is set and non-empty. The proxy injects JOB_TOKEN as an Authorization header for the DEPENDABOT_API_URL host, so gating avoids clobbering auth in the default/Azure flows where --api-url is the Azure DevOps host.
  • PROXY_CACHE — uses the host value when set, falls back to true.
  • OPENSSL_FORCE_FIPS_MODE — forwarded when the host has it set.

Adds tests covering each variable.

@brettfo brettfo requested review from a team as code owners June 26, 2026 20:15
@brettfo brettfo force-pushed the dev/brettfo/proxy-job-token branch 2 times, most recently from 16ab831 to 6019bf9 Compare June 26, 2026 20:57
@brettfo brettfo changed the title Pass JOB_TOKEN to the proxy container Pass JOB_TOKEN and DEPENDABOT_API_URL to the proxy container Jun 26, 2026
@brettfo brettfo force-pushed the dev/brettfo/proxy-job-token branch 3 times, most recently from 11df025 to 142e24f Compare June 26, 2026 21:47
Extract proxy environment construction into a proxyEnv helper. Forward
JOB_TOKEN (from the host) and DEPENDABOT_API_URL (from params.ApiUrl)
together, and only when JOB_TOKEN is set and non-empty.

The proxy uses DEPENDABOT_API_URL to choose which host to inject the
JOB_TOKEN into as an Authorization header. Forwarding it without a token
would cause the proxy to clobber auth on requests to that host (e.g. the
Azure DevOps host in LOCAL_AZURE_ACCESS_TOKEN flows), so the two are
gated on JOB_TOKEN being present.

Also honor a host-provided PROXY_CACHE value, falling back to true when
it is unset or empty, and forward OPENSSL_FORCE_FIPS_MODE through to the
proxy when the host has it set.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@brettfo brettfo force-pushed the dev/brettfo/proxy-job-token branch from 142e24f to 6aa03f2 Compare June 26, 2026 22:44
@brettfo brettfo changed the title Pass JOB_TOKEN and DEPENDABOT_API_URL to the proxy container Forward proxy env vars from the host Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants