[PM-34883] - Add InjectOrganizationUserAttribute#7536
Conversation
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR introduces Code Review DetailsNo findings. |
|
New Issues (3)Checkmarx found the following issues in this Pull Request
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7536 +/- ##
=======================================
Coverage 59.25% 59.26%
=======================================
Files 2081 2082 +1
Lines 92036 92060 +24
Branches 8179 8181 +2
=======================================
+ Hits 54534 54556 +22
Misses 35563 35563
- Partials 1939 1941 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
eliykat
left a comment
There was a problem hiding this comment.
Looks good, I've left some feedback below to explore/consider, but this approach will work just fine as well.
|
* Added InjectOrganizationUserAttribute and updated account-recovery put to use it. * Changes from code review





🎟️ Tracking
PM-34883
📔 Objective
This adds an attribute that can be used to decorate api endpoints and allow for the target organizationUser (via the route)
to be validated in a more standardized way. This will pull the id out of the route (id or whatever string is provided via the constructor) and will validate the target OrganizationUser belongs to the organization from the route. Since we've fetched the org user already, we'll provide it to the controller method so we don't have to get it again.
I've implemented this on
organization/{orgId}/users/{id}/recover-account.