Conversation
… in OrganizationUser
…add tests for reset password key validation
… and add unit test for empty or whitespace reset password key handling
…keys and add unit tests for filtering out invalid keys
…ment and adjust tests for whitespace reset password keys
…keys, including filtering out whitespace-only keys, and add corresponding unit tests for validation logic.
…whitespace-only test cases for account recovery key validation.
…hod for ResetPasswordEnrolled status and update corresponding unit test for clarity.
…rganizationUser's validation method for ResetPasswordKey, ensuring consistent validation across the application. Add unit tests for OrganizationUser to verify key validation logic.
|
Claude finished @r-tome's task in 3m 19s —— View job Pull Request Review: PM-21179 Add interface to check if user is enrolled in account recoverySummaryThis PR centralizes the validation of reset password keys into the
Assessment
Key ObservationsBehavioral consistency fix: Several call sites previously used Complete migration verified: No remaining instances of the old Client compatibility properly handled: The Clean design: The static method appropriately handles validation for DTOs and request models that carry a Incremental Changes Review (post-initial feedback)The following commits were added after the initial review:
VerdictApprove -- This is a well-structured refactoring that improves consistency, fixes a subtle validation gap (whitespace-only keys), and provides comprehensive test coverage. The incremental changes properly address the client compatibility concern raised during review. No issues found. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6993 +/- ##
==========================================
+ Coverage 60.72% 60.75% +0.03%
==========================================
Files 2013 2013
Lines 88125 88129 +4
Branches 7848 7848
==========================================
+ Hits 53512 53545 +33
+ Misses 32712 32679 -33
- Partials 1901 1905 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Great job! No new security vulnerabilities introduced in this pull request |
quexten
left a comment
There was a problem hiding this comment.
Looks like this may re-introduce a regression to key-rotation, since clients are still sending empty strings. Your approach is the correct one, but is blocked by this client mis-behavior.
…d keys and adjust tests for client-side bug. Add comments for future migration after resolving PM-31001.
Patrick-Pimentel-Bitwarden
left a comment
There was a problem hiding this comment.
👍 Auth changes are minimal
…ccount-recovery # Conflicts: # test/Core.Test/Services/UserServiceTests.cs
… from the file header.
|




🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-21179
📔 Objective
Centralizes the logic for determining whether an organization user is enrolled in account recovery by introducing two methods on
OrganizationUser:IsValidResetPasswordKey(string?)IsEnrolledInAccountRecovery()This removes scattered
string.IsNullOrEmpty/string.IsNullOrWhiteSpacechecks across the codebase and replaces them with a single consistent implementation.It also fixes an inconsistency where some call sites treated whitespace-only keys as valid (
IsNullOrEmpty) while others did not (IsNullOrWhiteSpace).