Skip to content

feat: add OIDC credential auto-discovery#276

Open
cloudsmith-iduffy wants to merge 2 commits intoiduffy/credential-provider-chainfrom
iduffy/oidc-base
Open

feat: add OIDC credential auto-discovery#276
cloudsmith-iduffy wants to merge 2 commits intoiduffy/credential-provider-chainfrom
iduffy/oidc-base

Conversation

@cloudsmith-iduffy
Copy link
Contributor

@cloudsmith-iduffy cloudsmith-iduffy commented Mar 13, 2026

Add a new OIDC credential provider to the credential chain that
automatically detects CI/CD environments, retrieves a vendor OIDC JWT,
and exchanges it for a short-lived Cloudsmith API token.

Key changes:

  • New OidcProvider in the credential provider chain (lowest priority)
  • AWS environment detector using boto3/STS (optional aws extra)
  • OIDC token exchange
  • Token caching via system keyring with filesystem fallback
  • whoami command updated to display OIDC auth source
  • README updated with optional dependency install instructions

@cloudsmith-iduffy cloudsmith-iduffy requested a review from a team as a code owner March 13, 2026 22:26
@cloudsmith-iduffy cloudsmith-iduffy force-pushed the iduffy/credential-provider-chain branch from fd065ae to 8b57884 Compare March 14, 2026 14:01
@cloudsmith-iduffy cloudsmith-iduffy force-pushed the iduffy/credential-provider-chain branch from 8b57884 to 0b0445c Compare March 14, 2026 14:06
@cloudsmith-iduffy cloudsmith-iduffy force-pushed the iduffy/credential-provider-chain branch from 0b0445c to 987c32f Compare March 14, 2026 14:10
@cloudsmith-iduffy cloudsmith-iduffy force-pushed the iduffy/oidc-base branch 2 times, most recently from 4586a50 to 603470a Compare March 14, 2026 14:14
@cloudsmith-iduffy cloudsmith-iduffy force-pushed the iduffy/credential-provider-chain branch from 987c32f to 65d8c53 Compare March 14, 2026 14:17
@cloudsmith-iduffy cloudsmith-iduffy force-pushed the iduffy/credential-provider-chain branch from 65d8c53 to 646c50a Compare March 14, 2026 14:23
@cloudsmith-iduffy cloudsmith-iduffy force-pushed the iduffy/credential-provider-chain branch from 646c50a to 5c2b23d Compare March 14, 2026 14:26
@cloudsmith-iduffy cloudsmith-iduffy force-pushed the iduffy/oidc-base branch 3 times, most recently from 6d0be0f to 0070269 Compare March 14, 2026 14:39
@cloudsmith-iduffy cloudsmith-iduffy force-pushed the iduffy/credential-provider-chain branch from 6e1792c to 8862812 Compare March 14, 2026 14:43
@cloudsmith-iduffy cloudsmith-iduffy marked this pull request as draft March 14, 2026 14:49
@cloudsmith-iduffy cloudsmith-iduffy force-pushed the iduffy/credential-provider-chain branch 2 times, most recently from 368db92 to a60887d Compare March 15, 2026 10:34
cloudsmith-iduffy and others added 2 commits March 15, 2026 21:58
Add AWS OIDC support as the final provider in the credential chain
(Keyring → CLIFlag → OIDC). When CLOUDSMITH_ORG and CLOUDSMITH_SERVICE_SLUG
are set, the CLI auto-detects the CI/CD environment, retrieves a vendor
OIDC JWT via STS GetWebIdentityToken, and exchanges it for a short-lived
Cloudsmith API token.

- AWS detector with boto3 session reuse and default audience ('cloudsmith')
- Token cache (keyring with filesystem fallback) checked before detection
- OIDC token exchange against POST /openid/{org}/
- CLI options: --oidc-org, --oidc-service-slug, --oidc-audience,
  --oidc-discovery-disabled
- Optional dependency: pip install cloudsmith-cli[aws]
- Warning-level logs on OIDC failures for CI/CD debuggability

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@cloudsmith-iduffy cloudsmith-iduffy changed the title feat: add OIDC credential auto-discovery for CI/CD environments feat: add OIDC credential auto-discovery Mar 15, 2026
@cloudsmith-iduffy cloudsmith-iduffy marked this pull request as ready for review March 15, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant