Support org-level JFrog OIDC credential aliases for npm registry auth - #243
v-thavaahariharangit with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: v-thavaahariharangit <164553783+v-thavaahariharangit@users.noreply.github.com>
Co-authored-by: v-thavaahariharangit <164553783+v-thavaahariharangit@users.noreply.github.com>
Co-authored-by: v-thavaahariharangit <164553783+v-thavaahariharangit@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues were identified, and regression coverage was added.
Pull request overview
Adds org-level JFrog OIDC credential alias support for npm registry authentication.
Changes:
- Normalizes JFrog URL, provider, audience, and identity-mapping aliases.
- Adds regression coverage for org-level alias parsing.
File summaries
| File | Description |
|---|---|
internal/oidc/oidc_credential.go |
Resolves supported JFrog credential aliases. |
internal/oidc/oidc_credential_test.go |
Tests org-level alias parsing. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
I think this PR is fixing the wrong layerI traced both credential producers and both failing runs. The evidence says the 403/401 isn't a key-parsing problem, so these aliases won't fix it. 1. The credential already parses correctlyBoth linked runs show the proxy recognizing the credential with the current keys: It arrives with canonical keys ( 2. The real failure is downstream, at token exchangeThis is JFrog rejecting the exchanged GitHub OIDC token — a trust / provider-name / audience / identity-mapping mismatch on the JFrog side (or in the values we send it), not a key-name mismatch the alias fallback addresses. 3. The added aliases have no producer
The test fixture here (alias keys, no Suggested next stepRather than adding key aliases, let's inspect the exchange request itself — the exact provider name, audience, and identity-mapping the proxy sends to JFrog's OIDC token endpoint — and diff it against the JFrog integration/identity-mapping config for |
What are you trying to accomplish?
Repository-level npm JFrog OIDC config worked, but equivalent org-level config failed token exchange (
403 FORBIDDEN) and fell through to unauthenticated registry calls (401).This change makes JFrog OIDC parsing accept org-level key variants so both config sources resolve to the same runtime credential.
Anything you want to highlight for special attention from reviewers?
urlorregistryjfrog-oidc-provider-nameoroidc-provider-nameaudienceoroidc-audienceidentity-mapping-name,oidc-identity-mapping-name, orjfrog-oidc-identity-mapping-nameCreateOIDCCredentialJFrog parsing; request matching/auth flow remains unchanged.How will you know you've accomplished your goal?
When org-level aliases are provided, JFrog parameters resolve identically to repo-level fields and the credential is recognized as JFrog OIDC:
internal/oidc/oidc_credential_test.gofor alias-based JFrog parsing.End to end test, error recreated here:
https://github.com/dsp-testing/npm-org-level-oidc-testing/actions/runs/34606745479/job/103286925315
https://github.com/thavaahariharangit-org/npm-orglevel-oidc-fr-13771/actions/runs/34583164318/job/103211204246
Checklist