Skip to content

feat: Reuse existing SSO auth sessions - #410

Open
cloudsmith-iduffy wants to merge 1 commit into
cloudsmith-iduffy-integrate-sso-credentialsfrom
cloudsmith-iduffy-reuse-sso-auth-sessions
Open

feat: Reuse existing SSO auth sessions#410
cloudsmith-iduffy wants to merge 1 commit into
cloudsmith-iduffy-integrate-sso-credentialsfrom
cloudsmith-iduffy-reuse-sso-auth-sessions

Conversation

@cloudsmith-iduffy

@cloudsmith-iduffy cloudsmith-iduffy commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reuse a renewable SSO session before prompting for a Workspace or opening a browser during ordinary cloudsmith auth
  • report session status and access-token expiry in human-readable and structured output
  • preserve the existing explicit and deprecated --token, --force, and --json flows, including token rotation behavior and warnings

Validation

  • pytest -q cloudsmith_cli/cli/tests/commands/test_auth.py
  • pre-commit run --files cloudsmith_cli/cli/commands/auth.py cloudsmith_cli/cli/tests/commands/test_auth.py CHANGELOG.md
  • git diff --check

Top layer of native stack #411, based on #408.

@cloudsmith-iduffy
cloudsmith-iduffy force-pushed the cloudsmith-iduffy-reuse-sso-auth-sessions branch from b510a9b to a551611 Compare September 3, 2026 21:26
@cloudsmith-iduffy
cloudsmith-iduffy marked this pull request as ready for review September 7, 2026 11:07
@cloudsmith-iduffy
cloudsmith-iduffy requested a review from a team as a code owner September 7, 2026 11:07
Copilot AI lite review requested due to automatic review settings September 7, 2026 11:07
@cloudsmith-iduffy

Copy link
Copy Markdown
Contributor Author

@copilot resolve all conflicts

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.

Pull request overview

This PR updates the cloudsmith auth command to reuse an existing renewable SSO session (when available) so users can avoid unnecessary workspace prompts/browser flows, and it surfaces SSO session status + access-token expiry in both human-readable and JSON output.

Changes:

  • Add an early-path in cloudsmith auth to renew/reuse an existing SSO session and short-circuit the browser flow when successful.
  • Add structured JSON reporting for SSO session status, method, expiry timestamp, and renewal errors.
  • Extend CLI tests to cover the “reuse session” behavior, JSON output, and an actionable offline failure mode.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
cloudsmith_cli/cli/commands/auth.py Adds SSO session reuse + reporting helpers and wires them into the authenticate command flow.
cloudsmith_cli/cli/tests/commands/test_auth.py Adds regression tests for session reuse, JSON output shape, and offline-expired-session behavior.
CHANGELOG.md Documents the new SSO session reuse and expiry reporting behavior for cloudsmith auth.

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

Comment thread cloudsmith_cli/cli/commands/auth.py
@cloudsmith-iduffy
cloudsmith-iduffy force-pushed the cloudsmith-iduffy-reuse-sso-auth-sessions branch 2 times, most recently from 4c7bbc4 to e45a9a0 Compare September 7, 2026 11:23

Copilot AI commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve all conflicts

Resolved the branch conflicts and pushed the follow-up fixes in 4c7bbc4 (merge resolution), 418c7ad (bounded auth callback wait), and 519e72d (sanitized OIDC decode warnings).

@cloudsmith-iduffy
cloudsmith-iduffy force-pushed the cloudsmith-iduffy-reuse-sso-auth-sessions branch from 519e72d to e45a9a0 Compare September 7, 2026 11:24
@cloudsmith-iduffy cloudsmith-iduffy changed the title Reuse existing SSO auth sessions feat: Reuse existing SSO auth sessions Sep 7, 2026
@cloudsmith-iduffy
cloudsmith-iduffy force-pushed the cloudsmith-iduffy-reuse-sso-auth-sessions branch from e45a9a0 to 9ec0669 Compare September 7, 2026 12:12
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.

3 participants