Skip to content

PM-32154: Feat: Update salt for new registration model - #7324

Open
david-livefront wants to merge 1 commit into
mainfrom
PM-32154-update-registration-model
Open

PM-32154: Feat: Update salt for new registration model#7324
david-livefront wants to merge 1 commit into
mainfrom
PM-32154-update-registration-model

Conversation

@david-livefront

@david-livefront david-livefront commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

🎟️ Tracking

PM-32154

📔 Objective

This PR updates the RegisterFinishRequestJson to use the new salt structure.

@david-livefront
david-livefront requested a review from a team as a code owner August 27, 2026 18:14
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context app:authenticator Bitwarden Authenticator app context t:feature Change Type - Feature Development labels Aug 27, 2026
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR reshapes RegisterFinishRequestJson to send MasterPasswordAuthentication / MasterPasswordUnlock blocks (kdf + salt + hash / wrapped user key) instead of the flat masterPasswordHash, userSymmetricKey, kdfType, and kdfIterations fields, and updates the AuthRepositoryImpl.register call site to pass kdf.toKdfRequestModel() and salt = email. The convenience secondary constructor mirrors the pattern already established by SetPasswordRequestJson and ResetPasswordRequestJson, including containedKeyId = null and reusing the same KdfJson for both blocks. Salt handling matches the existing feature-flagged v2 path in the same function (postKeysForUserPasswordRegistration(email = email, salt = email, ...)) and the hash it accompanies is derived by the SDK from the same email, so authentication and unlock data stay consistent. All four constructor call sites in the repo were updated and the affected unit tests were adjusted accordingly.

Code Review Details

No findings.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.12%. Comparing base (0945093) to head (77c440a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7324      +/-   ##
==========================================
- Coverage   86.43%   86.12%   -0.31%     
==========================================
  Files         925      899      -26     
  Lines       66843    65888     -955     
  Branches    10009     9997      -12     
==========================================
- Hits        57778    56749    -1029     
- Misses       5523     5599      +76     
+ Partials     3542     3540       -2     
Flag Coverage Δ
app-data 18.01% <100.00%> (+0.32%) ⬆️
app-ui-auth-tools 18.88% <0.00%> (+0.22%) ⬆️
app-ui-platform 16.29% <0.00%> (-0.31%) ⬇️
app-ui-vault 27.26% <0.00%> (-0.62%) ⬇️
authenticator 6.03% <0.00%> (-0.05%) ⬇️
lib-core-network-bridge 4.07% <0.00%> (-0.02%) ⬇️
lib-data-ui 1.20% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:authenticator Bitwarden Authenticator app context app:password-manager Bitwarden Password Manager app context t:feature Change Type - Feature Development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant