[PM-34595] Update provider controllers to use authz attribute#7450
[PM-34595] Update provider controllers to use authz attribute#7450
Conversation
There was a problem hiding this comment.
I have not used the base class helper here because I'm not sure this should be a 401 (more likely a 403) and I don't want to encourage other consumers to include error messages in their 401 responses. However, it was out of scope to address further here.
|
Great job! No new security vulnerabilities introduced in this pull request |
Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR migrates four provider controllers ( Code Review DetailsNo findings. |
|
@JimmyVo16 and @sven-bitwarden this will be of interest to you given our tech debt priorities - this is just some work that I already had stashed, and I expect the other controllers will follow this pattern. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7450 +/- ##
==========================================
+ Coverage 58.66% 58.87% +0.20%
==========================================
Files 2066 2066
Lines 91089 91059 -30
Branches 8106 8092 -14
==========================================
+ Hits 53440 53610 +170
+ Misses 35740 35534 -206
- Partials 1909 1915 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
test/Api.Test/AdminConsole/Controllers/ProviderClientsControllerTests.cs
Show resolved
Hide resolved
JimmyVo16
left a comment
There was a problem hiding this comment.
Overall looks good and approved. Just one question about the [AllowAnonymous].
|




🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-34595
📔 Objective
Primary objective: update provider controllers to use the
Authorizeattribute and the requirements added in #7389 . Add some basic tests for each controller - each endpoint is not tested comprehensively, but there are 'sentinel' tests to assure us that the attributes are working as intended end-to-end.Secondary objective: break inheritance relationship between
ProviderClientsControllerand the base controller classes still owned and used by Billing. This should be done to clarify our cross-team interfaces, and because the base controller implements its own authorization checks which are now duplicative. Changes:TryGetBillableProviderlogic into our controller as a private method - remove the role check which is handled by the attribute📸 Screenshots