Skip to content

Conversation

quexten
Copy link
Contributor

@quexten quexten commented Aug 13, 2025

🎟️ Tracking

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

📔 Objective

Exposes functionality to update the KDF, with the new masterpassword unlock data, and masterpassword authentication data models. These can be directly passed to the server models.

⏰ 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 changed the title Add updateKdf function [PM-24683] Add updateKdf function Aug 13, 2025
Copy link
Contributor

github-actions bot commented Aug 13, 2025

Logo
Checkmarx One – Scan Summary & Details10726ffc-27df-4f47-ab6b-6991fa822fc4

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

Copy link

codecov bot commented Aug 13, 2025

Codecov Report

❌ Patch coverage is 90.65421% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.08%. Comparing base (5658d61) to head (b0030e4).
⚠️ Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
crates/bitwarden-uniffi/src/crypto.rs 0.00% 10 Missing ⚠️
...bitwarden-core/src/key_management/crypto_client.rs 0.00% 9 Missing ⚠️
crates/bitwarden-core/src/key_management/crypto.rs 99.22% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #383      +/-   ##
==========================================
+ Coverage   76.53%   77.08%   +0.54%     
==========================================
  Files         269      269              
  Lines       25312    25768     +456     
==========================================
+ Hits        19373    19862     +489     
+ Misses       5939     5906      -33     

☔ 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.

Base automatically changed from km/pm-24051-add-master-password-unlock-decryption-options-to-identity-sync-response to main September 3, 2025 14:32
@mzieniukbw mzieniukbw dismissed stale reviews from dani-garcia and themself September 3, 2025 14:32

The base branch was changed.

dani-garcia
dani-garcia previously approved these changes Sep 4, 2025
Copy link
Member

@dani-garcia dani-garcia left a comment

Choose a reason for hiding this comment

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

LGTM, just two small non-blocking nits

use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, PartialEq)]
pub struct IdentityUserDecryptionOptionsResponseModel {
Copy link
Member

Choose a reason for hiding this comment

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

Question: Why not use #[serde(rename_all = "camelCase")] rather than renaming the field?

Copy link
Member

Choose a reason for hiding this comment

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

This response model was actually leftover from a previous upstream PR. Removed since its not needed.

.master_password
.as_ref()
.map(|p| {
.map(|p| -> Result<String, CryptoError> {
Copy link
Member

Choose a reason for hiding this comment

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

Is this need here? We're already typing Ok::<String, CryptoError>( below, seems like the compiler should be able to infer it.

Copy link
Member

Choose a reason for hiding this comment

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

If we keep it we should remove the type hint for Ok.

Copy link
Member

Choose a reason for hiding this comment

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

I removed this and didn't get any compiler issues so I'm assuming its able to infer.

Copy link
Member

@Hinton Hinton left a comment

Choose a reason for hiding this comment

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

A couple of minor things and we should be good. Only the two API comments are blocking.

/// re-encrypted with the new password. This returns the new encrypted user key and the new
/// password hash but does not update sdk state.
///
/// Note: This is deprecated and `make_update_password` should be used instead
Copy link
Member

Choose a reason for hiding this comment

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

Do. we have a task for tracking the removal? And ideally a task to assign to mobile to clean up their implementation?

Copy link
Member

Choose a reason for hiding this comment

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

.master_password
.as_ref()
.map(|p| {
.map(|p| -> Result<String, CryptoError> {
Copy link
Member

Choose a reason for hiding this comment

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

If we keep it we should remove the type hint for Ok.

Copy link

@jlf0dev jlf0dev merged commit 745287f into main Sep 16, 2025
50 checks passed
@jlf0dev jlf0dev deleted the km/update-kdf-sdk branch September 16, 2025 18:48
bw-ghapp bot pushed a commit to bitwarden/sdk-swift that referenced this pull request Sep 16, 2025
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