Skip to content

feat(ENG-13681): add credential-helper generic command - #338

Draft
cloudsmith-iduffy wants to merge 1 commit into
custom-domainsfrom
credential-generic
Draft

feat(ENG-13681): add credential-helper generic command#338
cloudsmith-iduffy wants to merge 1 commit into
custom-domainsfrom
credential-generic

Conversation

@cloudsmith-iduffy

@cloudsmith-iduffy cloudsmith-iduffy commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Description

Stack 3/4. Base: #337.

Adds cloudsmith credential-helper generic, which resolves a credential through
the full provider chain (API key, credentials.ini, system keyring, OIDC) and
emits it as a versioned JSON document —
{"version": 1, "username": "token", "password": "<token>"} — for tools that
shell out to the CLI rather than importing it.

It takes no arguments: a Cloudsmith token is organisation-wide, so the host it
will be used against does not change which credential resolves. Errors exit
non-zero with a message on stderr and never emit a partial document.

Independent of the custom-domain work below it in the stack; it sits here only
to keep the stack linear.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring
  • Other (please describe)

Additional Notes

Test suite: 659 passed, 40 skipped at this commit.

Emits a resolved credential as a versioned JSON document on stdout, so tools
that cannot import the CLI can still authenticate through the full provider
chain (API key, credentials.ini, system keyring, OIDC).

The command takes no arguments. A Cloudsmith token is organisation-wide, so
the host it will be used against cannot change which credential resolves;
asking which hosts are Cloudsmith is a separate question, answered by
`credential-helper domains` (added next).

The document is serialised in one step and a single broad except guards the
protocol boundary, so a caller invoking this as a subprocess can never see a
partial document or a traceback. Refusals exit non-zero with a human-readable
line on stderr and nothing on stdout. The CLI wiring tests resolve the
credential from --api-key, so the chain never reads a developer's real
credentials.ini or keyring.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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