PM-40295: bug: Add MP Policy checks on vault unlock - #7165
PM-40295: bug: Add MP Policy checks on vault unlock#7165david-livefront wants to merge 1 commit into
Conversation
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR extracts master password policy logic out of Code Review Details
|
| * The password that needs to be checked against any organization policies before | ||
| * the user can complete the login flow. This value is stored using the user ID. | ||
| */ | ||
| private val mutablePasswordsToCheckFlow = MutableStateFlow(value = mapOf<String, String>()) |
There was a problem hiding this comment.
@vvolkgang Once the KeystoreManager is ready, I would like to encrypt this data.
b5a621e to
b29e1e3
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7165 +/- ##
==========================================
+ Coverage 86.36% 86.51% +0.15%
==========================================
Files 916 917 +1
Lines 65833 65886 +53
Branches 9718 9730 +12
==========================================
+ Hits 56854 57000 +146
+ Misses 5509 5418 -91
+ Partials 3470 3468 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
68addd6 to
bd2e4c2
Compare
2f21e9f to
4156730
Compare
4156730 to
d4b422c
Compare
| ) | ||
| } | ||
| val password = when (initUserCryptoMethod) { | ||
| is InitUserCryptoMethod.MasterPasswordUnlock -> initUserCryptoMethod.password |
There was a problem hiding this comment.
💭 Perhaps move this to InitUserCryptoMethodExtensions? updateKdfIfNeeded down below is doing the same. Not a blocker and can be dealt with later.
|
|
||
| // Cache the password to verify against any password policies after the sync completes. | ||
| passwordsToCheckMap.put(userId, it) | ||
| storePasswordToCheck(userId = userId, password = it) |
There was a problem hiding this comment.
Let's circle back on this later and research how we could restructure the sync + policy check process to remove this need.
🎟️ Tracking
PM-40295
📔 Objective
This PR moves all the MasterPassword Policy logic into a new class and adds the policy check on vault unlock as well as login.