Skip to content

Conversation

@mzieniukbw
Copy link
Contributor

@mzieniukbw mzieniukbw commented Aug 5, 2025

๐ŸŽŸ๏ธ Tracking

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

๐Ÿ“” Objective

Adds MasterPasswordUnlockData model with MasterPasswordUnlockResponseModel mapping. This wi
Adds UserDecryptionOptionsResponseModel into the identity success token response. This model includes the master password unlock field.
The /sync response model is autogenerated by OpenApi and already includes user decryption option and the master password unlock fields.
Includes Uniffi and WASM bindings for MasterPasswordUnlock.

In further PR's we plan to use the MasterPasswordUnlock in InitUserCryptoMethod enum - this is still in discussion.

โฐ 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

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2025

Logo
Checkmarx One โ€“ Scan Summary & Details โ€“ 4010f713-a4e0-4f3f-b693-3269a3aac793

Great job! No new security vulnerabilities introduced in this pull request

@codecov
Copy link

codecov bot commented Aug 5, 2025

Codecov Report

โŒ Patch coverage is 90.36697% with 21 lines in your changes missing coverage. Please review.
โœ… Project coverage is 76.53%. Comparing base (e05ba6e) to head (4a00571).
โš ๏ธ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
...twarden-core/src/key_management/user_decryption.rs 0.00% 18 Missing โš ๏ธ
...twarden-core/src/key_management/master_password.rs 98.49% 3 Missing โš ๏ธ
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #376      +/-   ##
==========================================
+ Coverage   76.41%   76.53%   +0.12%     
==========================================
  Files         265      267       +2     
  Lines       24433    24651     +218     
==========================================
+ Hits        18670    18867     +197     
- Misses       5763     5784      +21     

โ˜” View full report in Codecov by Sentry.
๐Ÿ“ข Have feedback on the report? Share it here.

๐Ÿš€ New features to boost your workflow:
  • โ„๏ธ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • ๐Ÿ“ฆ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mzieniukbw mzieniukbw requested review from a team and quexten and removed request for a team August 5, 2025 11:08
@mzieniukbw mzieniukbw marked this pull request as ready for review August 5, 2025 14:51
@mzieniukbw mzieniukbw requested a review from a team as a code owner August 5, 2025 14:51
@mzieniukbw mzieniukbw requested a review from justindbaur August 5, 2025 14:51
Copy link
Contributor

@quexten quexten left a comment

Choose a reason for hiding this comment

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

Some initial comments, some of these are required, some are idiomatic (but probably required since the quality bar for SDK seems to be set much higher).

I'd like a review from someone with more rust experience such as @Hinton or @dani-garcia too. I believe specifically the request parsing is something that has not existed in the SDK so far, and there may be a better way to do this that we're unaware of.

@mzieniukbw mzieniukbw requested a review from quexten August 8, 2025 09:42
@mzieniukbw mzieniukbw requested a review from quexten August 25, 2025 17:28
quexten
quexten previously approved these changes Aug 26, 2025
quexten
quexten previously approved these changes Aug 27, 2025
@mzieniukbw mzieniukbw requested review from Hinton and quexten September 1, 2025 10:22
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 1, 2025

@mzieniukbw mzieniukbw merged commit 03d02e6 into main Sep 3, 2025
50 checks passed
@mzieniukbw mzieniukbw deleted the km/pm-24051-add-master-password-unlock-decryption-options-to-identity-sync-response branch September 3, 2025 14:32
nikwithak added a commit that referenced this pull request Sep 23, 2025
โ€ฆdds it to identity success response model (#376)

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

Adds `MasterPasswordUnlockData` model with
`MasterPasswordUnlockResponseModel` mapping. This wi
Adds `UserDecryptionOptionsResponseModel` into the identity success
token response. This model includes the master password unlock field.
The `/sync` response model is autogenerated by OpenApi and already
includes user decryption option and the master password unlock fields.
Includes Uniffi and WASM bindings for `MasterPasswordUnlock`.

In further PR's we plan to use the `MasterPasswordUnlock` in
`InitUserCryptoMethod` enum - this is still in discussion.

- 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

<!-- Suggested interactions but feel free to use (or not) as you desire!
-->

- ๐Ÿ‘ (`:+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
mzieniukbw added a commit that referenced this pull request Oct 16, 2025
## ๐ŸŽŸ๏ธ Tracking

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

## ๐Ÿ“” Objective

- Initialise user crypto with `MasterPasswordUnlock` - added
`initialize_user_crypto_master_password_unlock` function into
`InternalClient`'s crypto.
- Auth's login methods (password, and api_key specifically) use
`MasterPasswordUnlockData` when present in response and uses new
function.
- KM team have decided that the double KDF derivation issue is something
we are ok with for login.
- Moved `set_login_method` to be the after the `initialize_user_crypto`
function in execution order, since the latter overrides the
`set_login_method`. Move everywhere (all login methods) for consistency.
- Removed `kdf` as init arg of `password.rs`, consistently use
`prelogin` now.
- Update user's KDF settings with `MasterPasswordUnlock` via
`update_user_master_password_unlock` in `InternalClient`, triggered in
sync.

Continuation of #376 

## โฐ 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

<!-- Suggested interactions but feel free to use (or not) as you desire!
-->

- ๐Ÿ‘ (`:+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
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.

5 participants