[PM-33951] feat(admin-console): Add InjectOrganizationAttribute and OrganizationModelBinder#7659
[PM-33951] feat(admin-console): Add InjectOrganizationAttribute and OrganizationModelBinder#7659JaredScar wants to merge 7 commits into
Conversation
…ModelBinder for automatic organization parameter binding
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR introduces a Code Review DetailsNo findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7659 +/- ##
==========================================
+ Coverage 60.43% 60.44% +0.01%
==========================================
Files 2140 2141 +1
Lines 94622 94641 +19
Branches 8443 8445 +2
==========================================
+ Hits 57188 57209 +21
+ Misses 35429 35428 -1
+ Partials 2005 2004 -1 ☔ 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
| /// ]]></code> | ||
| /// </example> | ||
| [AttributeUsage(AttributeTargets.Parameter)] | ||
| public sealed class BindOrganizationAttribute() : ModelBinderAttribute(typeof(OrganizationModelBinder)); |
There was a problem hiding this comment.
Lets keep this consistent with the existing InjectOrganizationUser that already exists and changed the name to InjectOrganization
There was a problem hiding this comment.
Clarified in our DMs, but posting here for closing loop. InjectOrganizationAttribute exists via Billing, but is different with how we want to use it. Therefore this will stay named as BindOrganizationAttribute to avoid that ambiguous issue
…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.
|



🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-33951
📔 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.