Repository navigation
proxy registry: attach the token over http only to private hosts or with an explicit opt-in - #4317
Merged
Daniel Meppiel (danielmeppiel) merged 17 commits intoNov 21, 2026
Conversation
…r with an explicit opt-in PROXY_REGISTRY_TOKEN travels over http:// only to a loopback or RFC 1918 private host, or when PROXY_REGISTRY_ALLOW_HTTP=1 authorizes it. Otherwise the token is not sent and a [!] line names the URL and the opt-in. utils/net.is_local_network_host classifies the host. Guard: transport-platform-proxy-http-token (one mutation case). Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 12:51
Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A critical leading-zero IP parsing mismatch can expose bearer tokens outside permitted networks, and the required installed-CLI regression for token transmission and warnings is missing.
2 open issues
What changed in this PR
This PR tightens proxy-registry authentication for #4314: HTTP token transmission is limited to loopback or RFC 1918 hosts unless PROXY_REGISTRY_ALLOW_HTTP=1 explicitly permits it.
Changes:
- Centralizes the token decision and adds a redacted warning when the token is withheld.
- Adds unit regressions, an architecture guard, a mutation case, and a bug-ledger entry.
- Documents the opt-in’s changed meaning and the authentication behavior.
| File | Description |
|---|---|
tests/unit/utils/test_credential_rendering.py |
Updates warning-redaction tests for console output. |
tests/unit/test_artifactory_support.py |
Tests token withholding, private hosts, opt-in, and HTTPS. |
tests/unit/scripts/test_architecture_runner.py |
Registers the guard in the expected rule inventory. |
tests/integration/test_architecture_owner_rule_mutations.py |
Adds a mutation that bypasses the token decision. |
tests/fixtures/lifecycle_bug_ledger.json |
Records #4314 and its regression tests. |
src/apm_cli/utils/net.py |
Adds loopback and RFC 1918 host classification. |
src/apm_cli/deps/registry_proxy.py |
Enforces the HTTP token policy and emits warnings. |
src/apm_cli/deps/artifactory_orchestrator.py |
Clarifies the transport docstring; no functional change. |
scripts/architecture_linter/groups/transport_platform.py |
Includes the new guard in the transport group. |
scripts/architecture_linter/checks/transport_proxy_http_token.py |
Adds ownership checks for the token decision and opt-in. |
docs/src/content/docs/reference/environment-variables.md |
Updates the HTTP opt-in reference. |
docs/src/content/docs/enterprise/registry-proxy.md |
Explains allowed hosts and token withholding. |
CHANGELOG.md |
Records the user-visible authentication change. |
.apm/architecture/owners/transport-auth-platform.json |
Extends credential ownership and registers the guard. |
Review effort: Balanced
Integer, hexadecimal and leading-zero host forms are read differently by socket resolvers, so they never qualify for the private-network exception. Co-authored-by: Copilot App <[email protected]>
…equest-header capture The header capture proxy also records plain-HTTP requests for its configured hosts. Co-authored-by: Copilot App <[email protected]>
# Conflicts: # tests/fixtures/lifecycle_bug_ledger.json
Co-authored-by: Copilot App <[email protected]>
…erer form; parse URLs in tests Co-authored-by: Copilot App <[email protected]>
# Conflicts: # .apm/architecture/owners/transport-auth-platform.json # docs/src/content/docs/enterprise/registry-proxy.md # docs/src/content/docs/reference/environment-variables.md # tests/unit/test_artifactory_support.py
…nstead of patching it Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
… transport_platform RULES, bug ledger) Co-authored-by: Copilot App <[email protected]>
# Conflicts: # scripts/architecture_linter/groups/transport_platform.py # tests/fixtures/lifecycle_bug_ledger.json
…en' into s16 # Conflicts: # tests/fixtures/lifecycle_bug_ledger.json
This was referenced Nov 20, 2026
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-s16-proxy-http-token
branch
November 21, 2026 05:24
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
registries.<name>.url acceptance now delegates its loopback / RFC 1918 host decision to utils/net.py is_local_network_host (#4317), so one owner classifies local-network hosts. The RFC 1918 edge tests (10.x, 172.16.x, 192.168.x accepted; 172.15.255.255 and 172.32.0.1 refused) stay the oracle. The registry URL scheme guard now requires the delegation. apm-spec-waiver: req-sc-006 behaviour unchanged; host classification moves to its shared owner Co-authored-by: Copilot App <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
registries.<name>.url acceptance now delegates its loopback / RFC 1918 host decision to utils/net.py is_local_network_host (#4317), so one owner classifies local-network hosts. The RFC 1918 edge tests (10.x, 172.16.x, 192.168.x accepted; 172.15.255.255 and 172.32.0.1 refused) stay the oracle. The registry URL scheme guard now requires the delegation. apm-spec-waiver: req-sc-006 behaviour unchanged; host classification moves to its shared owner Co-authored-by: Copilot App <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
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.


Description
PROXY_REGISTRY_TOKENis sent overhttp://only to a loopback or RFC 1918 private host (10/8, 172.16/12, 192.168/16), or whenPROXY_REGISTRY_ALLOW_HTTP=1explicitly authorizes it. Otherwise the token is not sent, and a[!]line names the (redacted) URL and the opt-in.https://is unchanged.deps/registry_proxy.http_token_allowed, consumed byRegistryConfig.from_env; host classification:utils/net.is_local_network_host(loopback plus RFC 1918), part of thecredential-origin-scopeowner.PROXY_REGISTRY_ALLOW_HTTP=1now authorizes sending the token overhttp://to other hosts (documented inenterprise/registry-proxy.mdandreference/environment-variables.md).transport-platform-proxy-http-token: one decision function, one consumer, and no other module reads the opt-in. One sortedMutationCase.Issue and approved scope
Issue: Fixes #4314
Human scope-approval comment: #4314 (comment)
Does this PR complete the issue, or what remains? It completes the issue.
Type of change
Testing
Tested locally
All existing tests pass (CI pending)
Added tests for new functionality (if applicable)
pytest tests/unit/test_artifactory_support.py tests/unit/utils/test_credential_rendering.py -k "http_url or proxy_plaintext or local_network"-> 14 passedpytest tests/quality/test_lifecycle_bug_ledger.py-> 2 passedpytest tests/integration/test_proxy_registry_http_token_lifecycle.py tests/integration/test_registry_credential_origin_lifecycle.py(installed CLI, header capture) -> 6 passedguard clean on this branch; the mutation case is caught
ruff check/ruff format --check(0.15.12) on changed files -> cleanChangelog
## [Unreleased]inCHANGELOG.md.