Open
Conversation
12 tasks
There was a problem hiding this comment.
Pull request overview
Migrates the Composer handler’s OIDC credential storage from a handler-local map + RWMutex to the shared oidc.OIDCRegistry, aligning Composer with the repo’s collision-free OIDC credential matching (host bucket + longest path-prefix).
Changes:
- Replaced Composer’s
oidcCredentialsmap + mutex with an*oidc.OIDCRegistryand updated request-time auth to useTryAuth. - Updated the OIDC integration test expectations to reflect Composer’s new “full URL” registration key in log lines.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/handlers/composer.go | Uses OIDCRegistry for OIDC registration + request authentication, removing handler-local OIDC map/mutex. |
| internal/handlers/oidc_handling_test.go | Updates expected log lines for Composer OIDC registration to include the full URL key. |
7369e0b to
0cbba9f
Compare
0cbba9f to
94cdb6e
Compare
Replace manual OIDC credential map and mutex with the shared OIDCRegistry type. OIDC key changes from hostname-only to full URL (via url or registry field), fixing credential collisions when multiple Composer repositories share a host with different paths.
94cdb6e to
a69a6c4
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.
What
Migrate the Composer handler from manual OIDC credential map + mutex to the shared
OIDCRegistrytype introduced in #78.Why
Part of the phased migration to fix OIDC credential collisions when multiple registries share a host (#87).
Composer was storing OIDC credentials keyed by hostname only. Two Composer repositories on the same host with different paths would collide. The
OIDCRegistrypreserves the full URL (viaurlorregistryfield), fixing this.Key behavior change
OIDC registration key changes from hostname-only to full URL, reflected in updated expected log lines in the OIDC integration test.
Behavior changes
Credential selection is now deterministic. The old code iterated over a Go map (
map[string]*OIDCCredential), so with multiple OIDC credentials on the same host, which one matched was nondeterministic.OIDCRegistry.TryAuthuses longest path-prefix matching, ensuring the most specific credential always wins. This is the core fix for OIDC credential collision when multiple registries share a host #87.Host matching uses
strings.ToLowerinstead of IDNA normalization. The oldTryAuthOIDCRequestWithPrefixusedhelpers.AreHostnamesEqual(IDNAToASCII), whileOIDCRegistry.TryAuthuses lowercase comparison. This is acceptable because all real OIDC registries (Azure DevOps, JFrog, AWS CodeArtifact, Cloudsmith) use ASCII hostnames — no package registry uses internationalized domain names.