-
Notifications
You must be signed in to change notification settings - Fork 16
[PM-24683] Add updateKdf function #383
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
base: km/pm-24051-add-master-password-unlock-decryption-options-to-identity-sync-response
Are you sure you want to change the base?
[PM-24683] Add updateKdf function #383
Conversation
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## km/pm-24051-add-master-password-unlock-decryption-options-to-identity-sync-response #383 +/- ##
=======================================================================================================================
+ Coverage 76.01% 76.19% +0.18%
=======================================================================================================================
Files 261 261
Lines 23945 24156 +211
=======================================================================================================================
+ Hits 18201 18406 +205
- Misses 5744 5750 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ns-to-identity-sync-response' into km/update-kdf-sdk
## 🎟️ Tracking https://bitwarden.slack.com/archives/C054ZQSBS49/p1755188403409309 ## 📔 Objective It seems #279 accidentally required wasm in all uniffi builds via `bitwarden-vault` -> `bitwarden-collections` -> `bitwarden-core`. Since it is only required on core, this leads to build issues on anything where an impl is tagged with wasm-bindgen, but uses a struct from a third package - such as `bitwarden-crypto` that does not have the wasm feature enabled. Attempts to fix the build errors of: #383 Note: This flags out a function from the collections client. This has to be fixed by the owning team and updated, this PR just unblocks builds and fixes the imports. ## ⏰ 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 --------- Co-authored-by: Oscar Hinton <[email protected]>
…ns-to-identity-sync-response' into km/update-kdf-sdk
… into km/update-kdf-sdk
Co-authored-by: Daniel García <[email protected]>
… into km/update-kdf-sdk
@dani-garcia Yeah, the valid kdf newtype makes sense. We enforce the same correct values on e.g. keys too with custom types that can only be validly created, so there is no reason not to do that with KDF. Not adding it to this PR, but I'd definitely also like to see this as a future improvement. |
…ns-to-identity-sync-response' into km/update-kdf-sdk
@@ -20,6 +20,7 @@ uniffi = ["dep:uniffi", "bitwarden-core/uniffi"] # Uniffi bindings | |||
wasm = [ | |||
"bitwarden-collections/wasm", | |||
"bitwarden-vault/wasm", | |||
"bitwarden-collections/wasm", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left over from the upstream changes that were needed to unblock the PR. I've undone the duplicate import now.
/// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Why not mark this as deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem to play nice with uniffi / clippy, and ends up failing the CI because a warning gets emitted. I tried #[allow(deprecated)]
on it, but it did not seem to help.
&self, | ||
password: String, | ||
kdf: Kdf, | ||
) -> Result<bitwarden_core::key_management::crypto::UpdateKdfResponse> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: The other functions here uses the shorthand path.
) -> Result<bitwarden_core::key_management::crypto::UpdateKdfResponse> { | |
) -> Result<UpdateKdfResponse> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaned up!
/// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Can we just remove this function here? Or is it actively used in web?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed!
Co-authored-by: Oscar Hinton <[email protected]>
… into km/update-kdf-sdk
…ns-to-identity-sync-response' into km/update-kdf-sdk
… into km/update-kdf-sdk
|
🎟️ 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
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 confirmedissue 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