Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-14863] Force unlock when keys are cleared / on first unlock and fix account switching behavior #11994

Merged
merged 13 commits into from
Dec 2, 2024

Conversation

quexten
Copy link
Contributor

@quexten quexten commented Nov 14, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-14863

📔 Objective

The intended behavior is that:

  • When switching accounts, public keys are cleared from the agent, listing keys should force an unlock (even if the user has no keys, which we cannot know at that point)
  • When first starting the app, same as above
  • When locking your account, but not switching, public keys should still be listed

📸 Screenshots

Screen.Recording.2024-11-14.at.14.43.19.mov

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@quexten quexten requested a review from coroiu November 14, 2024 13:41
@quexten quexten marked this pull request as ready for review November 14, 2024 13:41
@quexten quexten requested review from a team as code owners November 14, 2024 13:41
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 0% with 35 lines in your changes missing coverage. Please review.

Project coverage is 33.52%. Comparing base (36750b3) to head (b28ee8d).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...desktop/src/platform/services/ssh-agent.service.ts 0.00% 29 Missing ⚠️
...esktop/src/platform/main/main-ssh-agent.service.ts 0.00% 4 Missing ⚠️
apps/desktop/src/platform/preload.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11994      +/-   ##
==========================================
- Coverage   33.53%   33.52%   -0.02%     
==========================================
  Files        2884     2884              
  Lines       90079    90106      +27     
  Branches    17132    17135       +3     
==========================================
  Hits        30208    30208              
- Misses      57485    57512      +27     
  Partials     2386     2386              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Nov 14, 2024

Logo
Checkmarx One – Scan Summary & Detailsf3b6286d-0b7d-4ca5-a108-b4a62fa862f5

No New Or Fixed Issues Found

apps/desktop/desktop_native/core/Cargo.toml Outdated Show resolved Hide resolved
apps/desktop/desktop_native/core/src/ssh_agent/mod.rs Outdated Show resolved Hide resolved
apps/desktop/desktop_native/core/src/ssh_agent/mod.rs Outdated Show resolved Hide resolved
apps/desktop/src/platform/services/ssh-agent.service.ts Outdated Show resolved Hide resolved
Comment on lines 120 to 121
// cipherid is empty has the special meaning of "unlock in order to list public keys"
if (cipherId == "") {
Copy link
Contributor

@coroiu coroiu Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: I might be misunderstanding how this works, but my first thought is that we should use a proper message variable or message type to indicate this and not add hidden meaning to unrelated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that makes sense. We are extending this for other information aswell (information about the ssh request in the future, and process information in #12065) so we need to extend this either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I get the feeling that we're gonna need to take a proper look at how to consolidate this with passkeys, but not in this PR :)

apps/desktop/src/platform/services/ssh-agent.service.ts Outdated Show resolved Hide resolved
@quexten quexten requested a review from coroiu November 21, 2024 14:41
apps/desktop/src/platform/services/ssh-agent.service.ts Outdated Show resolved Hide resolved
apps/desktop/src/platform/services/ssh-agent.service.ts Outdated Show resolved Hide resolved
Comment on lines 120 to 121
// cipherid is empty has the special meaning of "unlock in order to list public keys"
if (cipherId == "") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I get the feeling that we're gonna need to take a proper look at how to consolidate this with passkeys, but not in this PR :)

@quexten quexten requested a review from coroiu November 28, 2024 21:27
coroiu
coroiu previously approved these changes Nov 29, 2024
Copy link
Contributor

@coroiu coroiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just ping me again when you've resolved the conflict 👍

@quexten quexten enabled auto-merge (squash) November 29, 2024 16:30
@quexten quexten merged commit 050417a into main Dec 2, 2024
36 of 38 checks passed
@quexten quexten deleted the km/PM-14863/allow-unlock-on-list branch December 2, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants