-
Notifications
You must be signed in to change notification settings - Fork 21
Conversation
In order to force a new login and get token with full lifetime if current one is about to expire Signed-off-by: Benny Zlotnik <[email protected]>
✅ Deploy Preview for jumpstarter-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughAdds a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/jumpstarter-cli-common/jumpstarter_cli_common/oidc.py (1)
123-128: Consider updating the comment to be more generic.The comment references "force" but this method only knows about the
promptparameter. A more accurate comment would be:- # Add prompt parameter if force requested + # Add prompt parameter if providedThis keeps the abstraction clean since
authorization_code_grantdoesn't need to know about the--forceflag semantics.packages/jumpstarter-cli/jumpstarter_cli/login.py (1)
159-163: Consider addingprompt="login"torelogin_client.Since
relogin_clientis specifically for re-authentication scenarios (when tokens are expired), it may benefit from usingprompt="login"to ensure a fresh authentication rather than potentially reusing an existing IdP session:oidc = Config(issuer=issuer, client_id=client_id) - tokens = await oidc.authorization_code_grant() + tokens = await oidc.authorization_code_grant(prompt="login") config.token = tokens["access_token"]This would provide consistent behavior with
jmp login --forceand ensure users get a fresh token with full lifetime.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/jumpstarter-cli-common/jumpstarter_cli_common/oidc.pypackages/jumpstarter-cli/jumpstarter_cli/auth.pypackages/jumpstarter-cli/jumpstarter_cli/login.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)
Ruff should be used for code formatting and linting, excluding
jumpstarter-protocolpackage
Files:
packages/jumpstarter-cli/jumpstarter_cli/auth.pypackages/jumpstarter-cli-common/jumpstarter_cli_common/oidc.pypackages/jumpstarter-cli/jumpstarter_cli/login.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: build
- GitHub Check: pytest-matrix (macos-15, 3.12)
- GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)
- GitHub Check: pytest-matrix (macos-15, 3.13)
- GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
- GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
- GitHub Check: pytest-matrix (macos-15, 3.11)
- GitHub Check: e2e
- GitHub Check: Redirect rules - jumpstarter-docs
- GitHub Check: Header rules - jumpstarter-docs
- GitHub Check: Pages changed - jumpstarter-docs
🔇 Additional comments (4)
packages/jumpstarter-cli-common/jumpstarter_cli_common/oidc.py (1)
85-85: LGTM on the signature extension.The optional
promptparameter follows the OIDC specification and integrates cleanly with the existing method signature.packages/jumpstarter-cli/jumpstarter_cli/auth.py (1)
22-27: LGTM!The updated guidance messages are clear and actionable, correctly directing users to use
--forcefor credential refresh in both expired and expiring-soon scenarios.packages/jumpstarter-cli/jumpstarter_cli/login.py (2)
22-27: LGTM on the--forceflag definition.The flag is well-defined with appropriate defaults and help text.
134-135: LGTM!The
prompt="login"is correctly applied only to the authorization code grant flow, which is the appropriate OAuth flow for browser-based re-authentication. Token exchange and password grants don't support/need this parameter.
In order to force a new login and get token with full lifetime if current one is about to expire
Summary by CodeRabbit
Release Notes
--forceflag to the login command enabling on-demand credential refresh.jmp login --forcewhen credentials expire or are expiring soon.✏️ Tip: You can customize this high-level summary in your review settings.