Skip to content

feat(ENG-15089): deprecate cloudsmith login and handle the password login switch-off - #489

Open
BartoszBlizniak wants to merge 13 commits into
masterfrom
eng-15089-cli-deprecate-cloudsmith-login-usernamepassword-flow
Open

BartoszBlizniak wants to merge 13 commits into
masterfrom
eng-15089-cli-deprecate-cloudsmith-login-usernamepassword-flow

Conversation

@BartoszBlizniak

@BartoszBlizniak BartoszBlizniak commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Description

Cloudsmith is disabling username and password login (POST /v1/user/token/), which cloudsmith login and its cloudsmith token alias depend on.

  • While the endpoint works, both commands keep working and print a deprecation warning on stderr before the prompt:
    Warning: `cloudsmith login` is deprecated and will stop working when Cloudsmith disables username and password login. The date will be announced at https://cloudsmith.com/changelog
    Use an API key or SAML instead: set `CLOUDSMITH_API_KEY` to an API key from the Cloudsmith web app (your user menu, then Personal API Keys), or run `cloudsmith auth --workspace <workspace>` to log in with SAML.
    More: https://docs.cloudsmith.com/developer-tools/cli#getting-your-api-key
    
  • Once the server returns 410 (or 404 after the route is deleted), they fail with a clear message and the same fix, instead of a raw error. Other errors, such as outages, are unchanged.
  • The 401 hints no longer tell users to run cloudsmith token.

Type of Change

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

Additional Notes

This deprecates the commands instead of removing them (#447), since they still work today. Because the CLI reacts to the server's response, it needs no further release when the endpoint is disabled. #447 can follow as cleanup.

To try the switch-off path, point --api-host at any server that answers POST /user/token/ with a 410.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Static review identified no blocking issues in the deprecation flow, error handling, or output routing; tests were not executed.

0 open findings

What changed in this PR

Deprecates password-based login without removing working commands, preparing the CLI for the server-side shutdown.

Changes:

  • Adds deprecation warnings and actionable messages for 404/410 responses.
  • Keeps config messages off JSON stdout and updates authentication hints.
  • Adds regression tests and documents API key alternatives.
File Description
README.md Documents deprecation and API key alternatives.
cloudsmith_cli/​core/​tests/​test_config.py Tests config output routing in JSON modes.
cloudsmith_cli/​core/​config.py Routes config prompts and messages to stderr in JSON modes.
cloudsmith_cli/​cli/​tests/​test_exceptions.py Tests updated authentication hints.
cloudsmith_cli/​cli/​tests/​commands/​test_login.py Tests warnings, shutdown responses, and JSON output.
cloudsmith_cli/​cli/​exceptions.py Updates login and authentication error hints.
cloudsmith_cli/​cli/​commands/​login.py Adds warnings and handles endpoint shutdown responses.
CHANGELOG.md Records deprecation and output fixes.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused changes have regression coverage, and no blocking issues were identified.

0 open findings

🧠 Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No blocking issues were identified, and focused regression tests cover the changed behavior, though tests were not executed.

0 open findings

🧠 Review effort: Balanced

BartoszBlizniak and others added 5 commits October 16, 2026 15:51
`cloudsmith login` and its `cloudsmith token` alias now print a
deprecation warning on stderr before they prompt for credentials. The
commands keep working until username and password login is disabled.

The warning points users at getting an API key from the web app and at
`cloudsmith auth`. The 401 hint for users with no credentials no longer
recommends `cloudsmith token`, and the failed-login hint now covers the
`login` name as well as `token`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…clean

When the API returns 410 (or 404 once the route is removed),
`cloudsmith login` and `cloudsmith token` explain that username and
password login is disabled and how to get an API key, instead of the
raw error. Other errors, such as outages or wrong credentials, keep the
standard rendering.

Config file prompts and messages from `create_config_files` and
`new_config_messaging` now go to stderr for JSON output, so
`login -F json` and `--save-config` with JSON output produce parseable
stdout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… date

The warning, help text, CHANGELOG and README say the commands stop
working when username and password login is disabled, and that the date
will be announced in the public changelog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The deprecation warning uses a `Warning:` prefix and names the
  replacement.
- The disabled-login error states what failed and adds a `Fix:` line
  with the exact command.
- Use "API key" consistently, and stop telling users to "try again" in
  the 401 hints.

The success output (`Your API key/token is: ...`) is unchanged so that
scripts parsing it keep working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The deprecation warning, the disabled-login error and `--help` now end
with a `More:` line linking to the CLI docs section on getting an API
key. The SSO fix names the exact command,
`cloudsmith auth --workspace <workspace>`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BartoszBlizniak
BartoszBlizniak force-pushed the eng-15089-cli-deprecate-cloudsmith-login-usernamepassword-flow branch from 7800fe7 to 2c8e02b Compare October 16, 2026 14:51
BartoszBlizniak and others added 2 commits October 16, 2026 15:59
Keep this change to the login deprecation. Routing config file prompts
and messages to stderr for JSON output is a separate fix, so restore
`core/config.py` and its tests, and drop the CHANGELOG entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BartoszBlizniak
BartoszBlizniak marked this pull request as ready for review October 19, 2026 08:00
@BartoszBlizniak
BartoszBlizniak requested a review from a team as a code owner October 19, 2026 08:00
Comment thread cloudsmith_cli/cli/commands/login.py Outdated
Comment thread cloudsmith_cli/cli/commands/login.py Outdated
Comment thread cloudsmith_cli/cli/exceptions.py
Comment thread cloudsmith_cli/cli/exceptions.py Outdated
Comment thread cloudsmith_cli/cli/exceptions.py Outdated
@cloudsmith-iduffy

Copy link
Copy Markdown
Collaborator

@copilot please get rid of sso mentions. It should always just be saml.

Never sso, never saml sso, just simply saml.

Co-authored-by: cloudsmith-iduffy <178375997+cloudsmith-iduffy@users.noreply.github.com>

Copilot AI commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

@copilot please get rid of sso mentions. It should always just be saml.

Never sso, never saml sso, just simply saml.

Updated the login/token warnings, help, removal messages, and 401 hints to use SAML only in 15eee57. Added regression assertions; all 35 focused tests and Ruff checks pass.

Restore the original wording of the failed-login 401 hint; only the
`login` name is added so it no longer suggests the command that just
failed. Say "SAML" instead of "SSO" in the CHANGELOG entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cate-cloudsmith-login-usernamepassword-flow

# Conflicts:
#	CHANGELOG.md
@BartoszBlizniak

Copy link
Copy Markdown
Member Author

Waiting for product to see if we can provide a more accurate date before merging.

BartoszBlizniak and others added 2 commits October 19, 2026 13:16
…cate-cloudsmith-login-usernamepassword-flow

# Conflicts:
#	CHANGELOG.md

This branch has not been deployed

No deployments
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.

4 participants