[PM-24788] Remove Org-Based Policy Requirements Queries#7038
[PM-24788] Remove Org-Based Policy Requirements Queries#7038sven-bitwarden merged 7 commits intomainfrom
Conversation
|
Claude finished @bnagawiecki's task in 3m 58s —— View job Re-Review: PM-24788 Remove Org-Based Policy Requirements QueriesPrevious Finding Status
Incremental Changes Reviewed (since last review at
|
| Commit | Description | Assessment |
|---|---|---|
14270061d |
Merge from main |
Clean merge; brought formatting fix in constructor and DefaultUserCollectionRestore FF removal (from PR #7071) |
Verification
- No remaining references to
GetManyByOrganizationIdAsync<T>()orRequiresDefaultCollectionOnConfirmanywhere in the codebase - Merge from main cleanly applied:
DefaultUserCollectionRestorefeature flag removal inRestoreOrganizationUserCommandnow runs default collection logic unconditionally, consistent with the rest of this PR's approach - Minor constructor formatting fix in
ConfirmOrganizationUserCommandis cosmetic only - All test mocks correctly use
GetAsync<T>(IEnumerable<Guid>)with appropriateArg.Ismatchers UseMyItemsDisabledtests correctly omit stale mock setups (code returns early before policy query)
Result
Approved -- All previous findings resolved. Merge from main introduces no new issues.
| .ToList(); | ||
|
|
||
| if (confirmedOrganizationUsers.Count == 1) | ||
| if (confirmedOrganizationUsers.Count > 0) |
There was a problem hiding this comment.
The difference between these two methods (== 1 vs > 1) was whether or not it used the by-org or by-user policy requirements query.
Since we removed the by-org query, and the by-user query delegates to the by-multiple-users query, these methods don't need to be separate anymore.
|
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7038 +/- ##
==========================================
- Coverage 56.45% 56.44% -0.01%
==========================================
Files 2013 2013
Lines 88109 88089 -20
Branches 7862 7855 -7
==========================================
- Hits 49739 49719 -20
- Misses 36554 36555 +1
+ Partials 1816 1815 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
# Conflicts: # src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/ConfirmOrganizationUserCommand.cs # src/Core/AdminConsole/OrganizationFeatures/OrganizationUsers/RestoreUser/v1/RestoreOrganizationUserCommand.cs
|
@r-tome fixed some merge conflicts and got the tests restored |
|




🎟️ Tracking
PM-24788
📔 Objective
Previously within the policy requirements feature, we could only gather enforcement data for individual users, or for organizations. #6876 enabled retrieving policy requirements for multiple users, which is much more efficient in scenarios where out of an entire organization, we need policy requirements for a handful of users.
This PR adjusts the areas that had previously used the by-org query to load by the user IDs on hand. It also changes the OrgDataOwnershipPolicyRequirement to return a helpful (pre-existing) model that gives back the org user ID it's applicable to.