feat: Harden automatic SSO renewal - #407
Open
cloudsmith-iduffy wants to merge 1 commit into
Open
Conversation
cloudsmith-iduffy
force-pushed
the
cloudsmith-iduffy-harden-sso-renewal
branch
2 times, most recently
from
September 3, 2026 21:21
6724cf5 to
fd9a17a
Compare
cloudsmith-iduffy
changed the base branch from
cloudsmith-iduffy-remove-auth-token-flag
to
master
September 3, 2026 21:27
cloudsmith-iduffy
marked this pull request as ready for review
September 7, 2026 11:07
Contributor
Author
|
@copilot resolve all conflicts |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a more defensive SSO renewal implementation intended to refresh tokens based on JWT expiry (with leeway/throttling) and to better handle refresh-token rotation and transient failures, so the CLI can keep working sessions alive without getting stuck on dead credentials.
Changes:
- Added a new shared renewal flow (
renew_sso_session) with structured outcomes and token-expiry decoding. - Adjusted keyring refresh throttling/ordering to better tolerate partial keyring failures and rotation semantics.
- Added/updated tests and documented the new SSO-refresh behavior in the changelog.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cloudsmith_cli/core/tests/test_sso.py | Adds tests for renewal outcomes (rotation success, transient failure reuse, rejection cleanup). |
| cloudsmith_cli/core/tests/test_keyring.py | Extends keyring refresh tests to cover JWT-expiry-driven refresh behavior and token storage ordering. |
| cloudsmith_cli/core/sso.py | Implements JWT-expiry decoding helpers and a new renewal API (renew_sso_session) with structured status handling. |
| cloudsmith_cli/core/keyring.py | Updates refresh-throttle persistence behavior and adds JWT-expiry-aware refresh decision logic. |
| CHANGELOG.md | Documents the new SSO refresh behavior and fallback semantics. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
cloudsmith-iduffy
force-pushed
the
cloudsmith-iduffy-harden-sso-renewal
branch
from
September 7, 2026 11:14
fd9a17a to
f9e8117
Compare
Contributor
cloudsmith-iduffy
force-pushed
the
cloudsmith-iduffy-harden-sso-renewal
branch
from
September 7, 2026 11:22
7499df7 to
f9e8117
Compare
cloudsmith-iduffy
force-pushed
the
cloudsmith-iduffy-harden-sso-renewal
branch
from
September 7, 2026 12:08
f9e8117 to
20a61ff
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.
Summary
Validation
pytest -q cloudsmith_cli/core/tests/test_sso.py cloudsmith_cli/core/tests/test_keyring.py cloudsmith_cli/core/tests/test_keyring_provider.py cloudsmith_cli/cli/tests/test_decorators.pypre-commit run --files CHANGELOG.md cloudsmith_cli/cli/decorators.py cloudsmith_cli/cli/tests/test_decorators.py cloudsmith_cli/core/credentials/models.py cloudsmith_cli/core/credentials/providers/keyring_provider.py cloudsmith_cli/core/keyring.py cloudsmith_cli/core/sso.py cloudsmith_cli/core/tests/test_keyring.py cloudsmith_cli/core/tests/test_keyring_provider.py cloudsmith_cli/core/tests/test_sso.pyStacked on #406.