feat: Add credential helpers for Docker and pip with custom domain support#269
Draft
cloudsmith-iduffy wants to merge 1 commit intoiduffy/automatic-oidcfrom
Draft
feat: Add credential helpers for Docker and pip with custom domain support#269cloudsmith-iduffy wants to merge 1 commit intoiduffy/automatic-oidcfrom
cloudsmith-iduffy wants to merge 1 commit intoiduffy/automatic-oidcfrom
Conversation
d582dec to
f570bd9
Compare
cloudsmith-iduffy
added a commit
that referenced
this pull request
Feb 28, 2026
…nd NuGet Extend the credential helper system (from PR #269) with 5 additional package manager integrations, each following the tool's native credential protocol: - Terraform: terraform-credentials-cloudsmith binary - Cargo: cargo-credential-cloudsmith binary (JSON-line protocol) - npm/pnpm: cloudsmith-token-helper binary (tokenHelper) - Conda: cloudsmith-auth plugin (conda auth handler) - NuGet: CredentialProvider.Cloudsmith binary All helpers reuse the shared CredentialProviderChain and custom domain discovery. Includes CLI commands for debugging and example documentation for each package manager. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
f570bd9 to
369a1f1
Compare
cloudsmith-iduffy
added a commit
that referenced
this pull request
Feb 28, 2026
…nd NuGet Extend the credential helper system (from PR #269) with 5 additional package manager integrations, each following the tool's native credential protocol: - Terraform: terraform-credentials-cloudsmith binary - Cargo: cargo-credential-cloudsmith binary (JSON-line protocol) - npm/pnpm: cloudsmith-token-helper binary (tokenHelper) - Conda: cloudsmith-auth plugin (conda auth handler) - NuGet: CredentialProvider.Cloudsmith binary All helpers reuse the shared CredentialProviderChain and custom domain discovery. Includes CLI commands for debugging and example documentation for each package manager. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
369a1f1 to
b3cf3c2
Compare
cloudsmith-iduffy
added a commit
that referenced
this pull request
Feb 28, 2026
…nd NuGet Extend the credential helper system (from PR #269) with 5 additional package manager integrations, each following the tool's native credential protocol: - Terraform: terraform-credentials-cloudsmith binary - Cargo: cargo-credential-cloudsmith binary (JSON-line protocol) - npm/pnpm: cloudsmith-token-helper binary (tokenHelper) - Conda: cloudsmith-auth plugin (conda auth handler) - NuGet: CredentialProvider.Cloudsmith binary All helpers reuse the shared CredentialProviderChain and custom domain discovery. Includes CLI commands for debugging and example documentation for each package manager. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b3cf3c2 to
042af5b
Compare
cloudsmith-iduffy
added a commit
that referenced
this pull request
Feb 28, 2026
…nd NuGet Extend the credential helper system (from PR #269) with 5 additional package manager integrations, each following the tool's native credential protocol: - Terraform: terraform-credentials-cloudsmith binary - Cargo: cargo-credential-cloudsmith binary (JSON-line protocol) - npm/pnpm: cloudsmith-token-helper binary (tokenHelper) - Conda: cloudsmith-auth plugin (conda auth handler) - NuGet: CredentialProvider.Cloudsmith binary All helpers reuse the shared CredentialProviderChain and custom domain discovery. Includes CLI commands for debugging and example documentation for each package manager. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
042af5b to
64341fe
Compare
cloudsmith-iduffy
added a commit
that referenced
this pull request
Feb 28, 2026
…nd NuGet Extend the credential helper system (from PR #269) with 5 additional package manager integrations, each following the tool's native credential protocol: - Terraform: terraform-credentials-cloudsmith binary - Cargo: cargo-credential-cloudsmith binary (JSON-line protocol) - npm/pnpm: cloudsmith-token-helper binary (tokenHelper) - Conda: cloudsmith-auth plugin (conda auth handler) - NuGet: CredentialProvider.Cloudsmith binary All helpers reuse the shared CredentialProviderChain and custom domain discovery. Includes CLI commands for debugging and example documentation for each package manager. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
64341fe to
b1e8158
Compare
cloudsmith-iduffy
added a commit
that referenced
this pull request
Feb 28, 2026
…nd NuGet Extend the credential helper system (from PR #269) with 5 additional package manager integrations, each following the tool's native credential protocol: - Terraform: terraform-credentials-cloudsmith binary - Cargo: cargo-credential-cloudsmith binary (JSON-line protocol) - npm/pnpm: cloudsmith-token-helper binary (tokenHelper) - Conda: cloudsmith-auth plugin (conda auth handler) - NuGet: CredentialProvider.Cloudsmith binary All helpers reuse the shared CredentialProviderChain and custom domain discovery. Includes CLI commands for debugging and example documentation for each package manager. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b1e8158 to
d4acf41
Compare
cloudsmith-iduffy
added a commit
that referenced
this pull request
Feb 28, 2026
…nd NuGet Extend the credential helper system (from PR #269) with 5 additional package manager integrations, each following the tool's native credential protocol: - Terraform: terraform-credentials-cloudsmith binary - Cargo: cargo-credential-cloudsmith binary (JSON-line protocol) - npm/pnpm: cloudsmith-token-helper binary (tokenHelper) - Conda: cloudsmith-auth plugin (conda auth handler) - NuGet: CredentialProvider.Cloudsmith binary All helpers reuse the shared CredentialProviderChain and custom domain discovery. Includes CLI commands for debugging and example documentation for each package manager. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
d4acf41 to
9d76440
Compare
cloudsmith-iduffy
added a commit
that referenced
this pull request
Feb 28, 2026
…nd NuGet Extend the credential helper system (from PR #269) with 5 additional package manager integrations, each following the tool's native credential protocol: - Terraform: terraform-credentials-cloudsmith binary - Cargo: cargo-credential-cloudsmith binary (JSON-line protocol) - npm/pnpm: cloudsmith-token-helper binary (tokenHelper) - Conda: cloudsmith-auth plugin (conda auth handler) - NuGet: CredentialProvider.Cloudsmith binary All helpers reuse the shared CredentialProviderChain and custom domain discovery. Includes CLI commands for debugging and example documentation for each package manager. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
9d76440 to
f4e62f2
Compare
cloudsmith-iduffy
added a commit
that referenced
this pull request
Feb 28, 2026
…nd NuGet Extend the credential helper system (from PR #269) with 5 additional package manager integrations, each following the tool's native credential protocol: - Terraform: terraform-credentials-cloudsmith binary - Cargo: cargo-credential-cloudsmith binary (JSON-line protocol) - npm/pnpm: cloudsmith-token-helper binary (tokenHelper) - Conda: cloudsmith-auth plugin (conda auth handler) - NuGet: CredentialProvider.Cloudsmith binary All helpers reuse the shared CredentialProviderChain and custom domain discovery. Includes CLI commands for debugging and example documentation for each package manager. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
f4e62f2 to
522ed12
Compare
cloudsmith-iduffy
added a commit
that referenced
this pull request
Feb 28, 2026
…nd NuGet Extend the credential helper system (from PR #269) with 5 additional package manager integrations, each following the tool's native credential protocol: - Terraform: terraform-credentials-cloudsmith binary - Cargo: cargo-credential-cloudsmith binary (JSON-line protocol) - npm/pnpm: cloudsmith-token-helper binary (tokenHelper) - Conda: cloudsmith-auth plugin (conda auth handler) - NuGet: CredentialProvider.Cloudsmith binary All helpers reuse the shared CredentialProviderChain and custom domain discovery. Includes CLI commands for debugging and example documentation for each package manager. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
522ed12 to
7dfcb8d
Compare
cloudsmith-iduffy
added a commit
that referenced
this pull request
Feb 28, 2026
…nd NuGet Extend the credential helper system (from PR #269) with 5 additional package manager integrations, each following the tool's native credential protocol: - Terraform: terraform-credentials-cloudsmith binary - Cargo: cargo-credential-cloudsmith binary (JSON-line protocol) - npm/pnpm: cloudsmith-token-helper binary (tokenHelper) - Conda: cloudsmith-auth plugin (conda auth handler) - NuGet: CredentialProvider.Cloudsmith binary All helpers reuse the shared CredentialProviderChain and custom domain discovery. Includes CLI commands for debugging and example documentation for each package manager. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
7dfcb8d to
f986f91
Compare
cloudsmith-iduffy
added a commit
that referenced
this pull request
Feb 28, 2026
…nd NuGet Extend the credential helper system (from PR #269) with 5 additional package manager integrations, each following the tool's native credential protocol: - Terraform: terraform-credentials-cloudsmith binary - Cargo: cargo-credential-cloudsmith binary (JSON-line protocol) - npm/pnpm: cloudsmith-token-helper binary (tokenHelper) - Conda: cloudsmith-auth plugin (conda auth handler) - NuGet: CredentialProvider.Cloudsmith binary All helpers reuse the shared CredentialProviderChain and custom domain discovery. Includes CLI commands for debugging and example documentation for each package manager. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6989862 to
d6d8581
Compare
e3b1e4a to
df70f37
Compare
d6d8581 to
545d0af
Compare
eeb649d to
5c40265
Compare
Add credential helpers that automatically authenticate package managers
with Cloudsmith registries using the credential provider chain
(Environment Variable → Config File → Keyring → OIDC).
Supported formats:
Docker docker-credential-cloudsmith
Terraform terraform-credentials-cloudsmith
Cargo cargo-credential-cloudsmith
pnpm cloudsmith-token-helper
NuGet CredentialProvider.Cloudsmith
pip/twine keyring backend (auto-discovered)
Conda conda plugin (auto-discovered)
Configure `~/.docker/config.json`:
{
"credHelpers": {
"docker.cloudsmith.io": "cloudsmith"
}
}
Then:
docker pull docker.cloudsmith.io/myorg/myrepo/myimage:latest
Install the helper and configure `~/.terraformrc`:
mkdir -p ~/.terraform.d/plugins
ln -sf "$(which terraform-credentials-cloudsmith)" ~/.terraform.d/plugins/
credentials_helper "cloudsmith" {
args = []
}
Requires CLOUDSMITH_ORG and CLOUDSMITH_REPO environment variables.
Token format is org/repo/token per Cloudsmith's Terraform registry API.
Configure `~/.cargo/config.toml`:
[registries.cloudsmith]
index = "sparse+https://cargo.cloudsmith.io/myorg/myrepo/"
credential-provider = ["cargo-credential-cloudsmith"]
Then:
cargo add my-crate --registry cloudsmith
Configure `~/.npmrc` (requires absolute path to helper):
registry=https://npm.cloudsmith.io/myorg/myrepo/
//npm.cloudsmith.io/myorg/myrepo/:tokenHelper=/usr/local/bin/cloudsmith-token-helper
Returns "Bearer <token>" as pnpm does not auto-add the prefix.
Set NUGET_CREDENTIALPROVIDERS_PATH to the directory containing
CredentialProvider.Cloudsmith and add a package source:
<packageSources>
<add key="cloudsmith"
value="https://nuget.cloudsmith.io/myorg/myrepo/v3/index.json" />
</packageSources>
Then:
dotnet restore
Auto-discovered via the keyring.backends entry point. No configuration
needed beyond installing cloudsmith-cli:
pip install --index-url=https://dl.cloudsmith.io/basic/myorg/myrepo/python/simple/ mypkg
Auto-discovered via the conda plugin entry point. Install cloudsmith-cli
into conda's base Python environment. Configure `~/.condarc`:
channel_settings:
- channel: https://conda.cloudsmith.io/myorg/myrepo/
auth: cloudsmith
channels:
- https://conda.cloudsmith.io/myorg/myrepo/
- defaults
Then:
conda install my-package
- cloudsmith_cli/credential_helpers/common.py: shared resolve_credentials(),
extract_hostname(), is_cloudsmith_domain() used by all helpers
- CredentialProviderChain defaults to the standard 4-provider chain
- Networking config (proxy, TLS, headers) read from CLOUDSMITH_API_PROXY,
CLOUDSMITH_WITHOUT_API_SSL_VERIFY, CLOUDSMITH_API_USER_AGENT,
CLOUDSMITH_API_HEADERS env vars and config.ini
- Custom domain discovery via GET /orgs/{org}/custom-domains/ with
1-hour filesystem cache in ~/.cloudsmith/cache/custom_domains/
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
5c40265 to
d12ab03
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.
This PR adds credential helper infrastructure for Docker and pip package managers,
enabling automatic authentication to Cloudsmith registries without manual login
commands or embedding credentials in URLs.
This builds upon #267 (OIDC authentication) and extends the credential provider
chain to Docker and pip workflows.
Command:
cloudsmith credential-helper dockerBinary:
docker-credential-cloudsmith(for Docker CLI integration)Supports standard domains:
docker.cloudsmith.io,*.docker.cloudsmith.ioSupports custom vanity domains via API auto-discovery
Auto-discovered by pip/twine via
keyring.backendsentry pointSupports standard domains:
python.cloudsmith.io,dl.cloudsmith.ioSet
CLOUDSMITH_ORG=my-orgto enable custom domain discoveryFetches domains from
GET /orgs/{org}/custom-domains/API endpointCaches results in
~/.cloudsmith/cache/custom_domains/for 1 hourAutomatic, no manual configuration needed
Both helpers use the same credential provider chain
Order: Environment Variable → Config File → Keyring → OIDC
Consistent authentication behavior across all package managers
Extensible design for future helpers (npm, cargo, maven, etc.)
New feature
Documentation update
✅ Fully backward compatible
✅ No breaking changes
✅ Existing authentication methods unchanged
✅ Optional features - enable by configuration
Environment setup:
Before configuration:
After configuration:
Environment setup:
Test installation (no credentials in URL):
Custom domains are discovered automatically when
CLOUDSMITH_ORGis set:~/.cloudsmith/cache/custom_domains/