Auth / PM-32421 - CLI - Login Command - Validate SSO account has a CLI-supported decryption path - #22411
Conversation
Consolidates the post-SSO-login decryption path check into a single guard that short-circuits on master password or Key Connector and otherwise throws a remediation-specific error for TDE, PRF passkey, or an MP-encryption org member who never set an MP. Closes the gap where TDE and PRF-only accounts reached "You are logged in!" without a viable decryption path in CLI.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22411 +/- ##
==========================================
+ Coverage 54.20% 54.21% +0.01%
==========================================
Files 4314 4314
Lines 137167 137169 +2
Branches 21712 21713 +1
==========================================
+ Hits 74347 74372 +25
+ Misses 57402 57382 -20
+ Partials 5418 5415 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Note that the PRF unsupported-path branch is currently unreachable via SSO (server only populates PRF options through the WebAuthn grant) so a future reader understands why the branch exists.
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the renamed post-SSO guard |
| // MP-encryption org without completing setup. | ||
| throw Response.error( | ||
| "In order to log in with SSO from the CLI, you must first log in" + | ||
| " through the web vault, the desktop, or the extension to set your master password.", |
There was a problem hiding this comment.
Nit (non-blocking): web vault should be web app
- 3 usages here
- 2 usages in test file
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-32421
#18992
📔 Objective
Consolidates the post-SSO-login decryption path check into a single guard that short-circuits on master password or Key Connector and otherwise throws a remediation-specific error for TDE, PRF passkey, or an MP-encryption org member who never set an MP. Closes the gap where TDE and PRF-only accounts reached "You are logged in!" without a viable decryption path in CLI.
📸 Screenshots
Only recording TDE as the tests prove the other cases + it's the core problem we are fixing with displaying a clearer error.
PM-32421.-.CLI.-.SSO.+.TDE.-.Login.Error.Improved.mov