-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[PM-28842] Add validation to prevent excessive master password policy values #6807
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: main
Are you sure you want to change the base?
Conversation
Added data annotations for MinComplexity and MinLength properties to enforce validation rules. MinComplexity must be between 0 and 4, and MinLength must be between 12 and 128.
…andling Added a ValidateModel method to enforce validation rules for policy data. Updated error messages to provide clearer feedback on validation failures. Enhanced unit tests to cover new validation scenarios for MinLength and MinComplexity properties.
…nComplexity and MinLength Modified test cases to use updated values for MinComplexity (4) and MinLength (128). Added new tests to verify that excessive values for these properties return BadRequest responses. Ensured consistency across integration tests for both Admin and Public controllers.
|
Fixed Issues (1)Great job! The following issues were fixed in this Pull Request
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6807 +/- ##
==========================================
+ Coverage 55.03% 55.07% +0.03%
==========================================
Files 1934 1934
Lines 85581 85787 +206
Branches 7656 7677 +21
==========================================
+ Hits 47098 47244 +146
- Misses 36695 36751 +56
- Partials 1788 1792 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Added XML documentation comments for MinComplexity and MinLength properties to clarify their purpose and constraints. This improves code readability and provides better context for developers using the model.
…omplexity rules Implemented new test cases to verify the behavior of the ValidateAndSerialize method in PolicyDataValidator. Tests cover scenarios for minimum and maximum values, as well as edge cases for invalid inputs, ensuring robust validation for MasterPassword policy data.
|
Claude finished @r-tome's task in 3m 2s —— View job Overall Assessment: APPROVE This PR adds validation to prevent organization owners from setting unreasonably large values for master password policy's minimum length and complexity. The implementation is well-designed with comprehensive test coverage across unit and integration test layers. Code Review DetailsSecurity
Correctness
Test Coverage
Code Quality
Breaking Changes
No issues found. The implementation is production-ready. 🤖 Generated with Claude Code Co-Authored-By: Claude Opus 4.5 [email protected] |


🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-28842
📔 Objective
Fixes an issue where organization owners could set unreasonably large values for the master password policy's minimum length (e.g., 1000).
Clients PR
⏰ Reminders before review
🦮 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