Skip to content

Implement master password policy requirement#7537

Merged
BTreston merged 9 commits intomainfrom
ac/pm-35484-implement-master-password-policy-requirement
Apr 29, 2026
Merged

Implement master password policy requirement#7537
BTreston merged 9 commits intomainfrom
ac/pm-35484-implement-master-password-policy-requirement

Conversation

@BTreston
Copy link
Copy Markdown
Contributor

@BTreston BTreston commented Apr 23, 2026

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-35926

📔 Objective

This pr implements the MasterPasswordPolicyRequirement using the IPolicyRequirement pattern:

  • Adds MasterPasswordPolicyRequirement: a new policy requirement class that aggregates enforced master password options (min length, complexity, character requirements) across all applicable org policies, no exempt roles
  • Adds MasterPasswordPolicyRequirementFactory to create the requirement and registers it in DI.
  • Refactors PolicyService to use IPolicyRequirementQuery instead of directly querying IPolicyRepository, migrating master password enforcement to the new requirements framework.
  • Includes unit tests for the new requirement class and updates existing PolicyServiceTests.

📸 Screenshots

@BTreston
Copy link
Copy Markdown
Contributor Author

The unrelated files are getting hit by dotnet format

@BTreston BTreston marked this pull request as ready for review April 23, 2026 17:27
@BTreston BTreston requested review from a team as code owners April 23, 2026 17:27
@BTreston BTreston requested a review from jrmccannon April 23, 2026 21:02
Copy link
Copy Markdown
Contributor

@djsmith85 djsmith85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in util/Setup are unrelated to this PR. Did they get added due to some IDE formatting?

@BTreston
Copy link
Copy Markdown
Contributor Author

BTreston commented Apr 24, 2026

Changes in util/Setup are unrelated to this PR. Did they get added due to some IDE formatting?

They are getting hit by dotnet format @djsmith85

jrmccannon
jrmccannon previously approved these changes Apr 27, 2026
Copy link
Copy Markdown
Contributor

@jrmccannon jrmccannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I assume build errors will go away once package upgrades are completed.

@BTreston BTreston changed the title [PM-35484] Implement master password policy requirement Implement master password policy requirement Apr 27, 2026
@BTreston
Copy link
Copy Markdown
Contributor Author

This will be fixed up and addressed as a separate tech debt ticket. Moving back to draft in the meantime.

@BTreston BTreston marked this pull request as draft April 27, 2026 18:21
@BTreston BTreston marked this pull request as ready for review April 28, 2026 15:41
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

Logo
Checkmarx One – Scan Summary & Details41158a9b-a88d-4bd6-b5fc-17c095230535

Great job! No new security vulnerabilities introduced in this pull request

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.30%. Comparing base (9c02f0c) to head (86b1ae7).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7537      +/-   ##
==========================================
+ Coverage   59.26%   59.30%   +0.04%     
==========================================
  Files        2082     2083       +1     
  Lines       92060    92071      +11     
  Branches     8181     8180       -1     
==========================================
+ Hits        54556    54604      +48     
+ Misses      35563    35526      -37     
  Partials     1941     1941              

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

Copy link
Copy Markdown
Contributor

@djsmith85 djsmith85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for platform, although I'm still confused why the lint issues aren't flagged on main and also pass here 🤷

No functional changes found

@BTreston BTreston merged commit 3724ecf into main Apr 29, 2026
48 checks passed
@BTreston BTreston deleted the ac/pm-35484-implement-master-password-policy-requirement branch April 29, 2026 17:21
jaasen-livefront pushed a commit that referenced this pull request Apr 29, 2026
* implement master password policy requirement

* revert unrelated chagned files

* fix aggregate pattern in factory, move away from ctor

* remove admin/owner exemption

* revert mp exemption in policyService
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants