Support dualstack (.on.aws) repository endpoint hostnames#36
Open
zeevox wants to merge 1 commit into
Open
Conversation
AWS CodeArtifact dualstack endpoints use the form <domain>-<account>.codeartifact.<region>.on.aws (note: no '.d.' segment, and AAAA records). The backend currently bails on any hostname outside *.amazonaws.com, so IPv6-forward consumers using dualstack index URLs silently get no credentials. Accept both hostname forms: try each pattern in HOST_REGEXES and widen the fast-path suffix check. Positive-path test parametrized over both forms; negative cases added for dualstack maven paths and unknown .on.aws hosts.
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.
AWS CodeArtifact dualstack endpoints use the form
<domain>-<account>.codeartifact.<region>.on.aws— no.d.segment, and they carry AAAA records (resolvable today, verified against a live domain). The backend currently returns early for any hostname not ending in.amazonaws.com, so consumers using dualstack index URLs (IPv6-forward setups, NAT-cost-sensitive VPCs) silently get no credentials and fall through to 401s.This PR:
HOST_REGEXwithHOST_REGEXES, tried in order — classic form unchanged, dualstack form added with identical capture groups (domain, account, region);(".amazonaws.com", ".on.aws");test_get_credential_supported_hostover both hostname forms and adds dualstack negative cases (maven path, unknown .on.aws host).pytest: 32 passed.