[PM-38273] feat(admin-console): Add InjectOrganizationAttribute and OrganizationModelBinder#7659
Conversation
…ModelBinder for automatic organization parameter binding
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR introduces Code Review DetailsNo findings at this time. Prior review threads (signature mismatch breaking controller tests, missing binder unit tests, naming overlap with |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7659 +/- ##
==========================================
+ Coverage 60.43% 60.59% +0.15%
==========================================
Files 2140 2147 +7
Lines 94622 95086 +464
Branches 8443 8507 +64
==========================================
+ Hits 57188 57613 +425
- Misses 35429 35449 +20
- Partials 2005 2024 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jrmccannon
left a comment
There was a problem hiding this comment.
We should add unit tests to this and apply it to a simple endpoint.
…tionModelBinder for organization parameter binding with unit tests
…zation for organization parameter
…Details method to use bound organization
…n GetResetPasswordDetails method - Updated test cases to pass the organization directly instead of relying on repository calls. - Ensured that the tests correctly assert NotFoundException when the organization user does not match the bound organization. - Improved clarity in test setup by explicitly binding the organization to the method calls.
…ion functionality - Introduced OrganizationUsersControllerBindOrganizationTests to validate the behavior of the GET reset-password-details endpoint. - Implemented tests for successful retrieval of reset password details, handling of non-existent organization users, and cases where the user belongs to a different organization. - Ensured comprehensive coverage of scenarios to verify correct status responses and organization binding logic.
|



🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-38273
📔 Objective
This PR contains the implementation of InjectOrganizationAttribute (renamed to Bind because of conflicting Billing one) needed for #7527, split to their own PR to manage PR size.