don't ask the "unsafe" question in noninteractive login#699
don't ask the "unsafe" question in noninteractive login#699mangelajo merged 1 commit intojumpstarter-dev:mainfrom
Conversation
WalkthroughIn the CLI login flow, non-interactive mode now defaults Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant CLI as CLI Login
participant Prompt as Prompt Handler
participant Config as Config/Validator
rect rgb(240,248,255)
note over CLI: Interactive mode (unchanged)
User->>CLI: login
CLI->>Prompt: Ask "Allow unsafe driver client imports?"
Prompt-->>CLI: User choice (allow/deny)
CLI->>Config: Apply choice and validate allow list
Config-->>CLI: Result (ok/error)
CLI-->>User: Outcome
end
rect rgb(245,245,245)
note over CLI: Non-interactive mode (changed)
User->>CLI: login --non-interactive
CLI->>CLI: Set unsafe = False (default)
CLI->>Prompt: Skip prompt
alt allow list provided
CLI->>Config: Validate allow list
Config-->>CLI: Result (ok/error)
CLI-->>User: Outcome
else no allow list
CLI-->>User: Error: "--allow TEXT or --unsafe is required in non-interactive mode."
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
✅ Deploy Preview for jumpstarter-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/jumpstarter-cli/jumpstarter_cli/login.py (1)
87-92: Consider clarifying "safe mode" in the error message.The logic is correct, and changing the error message from "non-interactive mode" to "safe mode" better describes the actual constraint. However, "safe mode" might not be immediately clear to users.
Consider enhancing the error message for clarity:
if nointeractive: - raise click.UsageError("Allowed driver packages are required in safe mode.") + raise click.UsageError("Allowed driver packages are required in safe mode. Use --allow or --unsafe.")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/jumpstarter-cli/jumpstarter_cli/login.py(1 hunks)
⏰ 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: Redirect rules - jumpstarter-docs
- GitHub Check: Header rules - jumpstarter-docs
- GitHub Check: Pages changed - jumpstarter-docs
- GitHub Check: build
- GitHub Check: pytest-matrix (macos-15, 3.11)
- 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.12)
- GitHub Check: pytest-matrix (macos-15, 3.12)
- GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
- GitHub Check: e2e
🔇 Additional comments (1)
packages/jumpstarter-cli/jumpstarter_cli/login.py (1)
86-86: LGTM! Safe default for non-interactive mode.Defaulting
unsafetoFalsein non-interactive mode is the correct security posture, requiring callers to explicitly opt in via--unsafeflag when needed.
caller has to use --unsafe or --allow
809cbb3 to
df57e6f
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/jumpstarter-cli/jumpstarter_cli/login.py(1 hunks)
⏰ 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). (10)
- GitHub Check: Redirect rules - jumpstarter-docs
- GitHub Check: Header rules - jumpstarter-docs
- GitHub Check: Pages changed - jumpstarter-docs
- GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
- GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
- GitHub Check: pytest-matrix (macos-15, 3.12)
- GitHub Check: pytest-matrix (macos-15, 3.11)
- GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)
- GitHub Check: pytest-matrix (macos-15, 3.13)
- GitHub Check: e2e
🔇 Additional comments (1)
packages/jumpstarter-cli/jumpstarter_cli/login.py (1)
86-86: LGTM: Correct default behavior in non-interactive mode.The logic correctly defaults
unsafetoFalsein non-interactive mode, avoiding the interactive prompt. This is the secure choice and aligns with the PR objective.
|
Successfully created backport PR for |
caller has to use --unsafe or --allow
Summary by CodeRabbit