Skip to content

OIDC token exchange drops the registry path prefix #124

Closed
pnpm/pnpm
#17006

Description

@zkochan

Both CLIs build the trusted-publishing exchange URL by joining an absolute path onto the registry URL:

  • v12: pnpm/crates/publish/src/oidc/auth_token.rs (Url::join("/-/npm/v1/oidc/token/exchange/package/<name>"))
  • v11: pnpm11/releasing/commands/src/publish/oidc/authToken.ts (new URL('/-/npm/...', registry))

For a registry hosted under a path (for example https://example.com/npm/), the exchange goes to https://example.com/-/npm/v1/oidc/..., while the publish and dist-tag requests keep /npm/. npm-registry-fetch keeps the prefix.

Fix both stacks with a relative join against the normalized registry URL, and add a path-prefixed registry test for publish and dist-tag.

Found during the review of pnpm/pnpm#16840, which reuses this exchange for pnpm dist-tag. The behavior predates that PR.


Written by an agent (Claude Code, claude-opus-5-5).

Activity

  1. added 2 commits that reference this issue on Oct 17, 2026
    aa0ed44
    648c8e0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions