-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SM-378] Enable SM on a user basis #2590
Conversation
# Conflicts: # src/Core/Models/Data/Organizations/OrganizationUsers/OrganizationUserInviteData.cs
@@ -14,6 +15,8 @@ public static class Claims | |||
public const string ProviderAdmin = "providerprovideradmin"; | |||
public const string ProviderServiceUser = "providerserviceuser"; | |||
|
|||
public const string SecretsManagerAccess = "accesssecretsmanager"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:/ Feels like there should be a better way to handle these things.
# Conflicts: # src/Api/Controllers/ProjectsController.cs
# Conflicts: # src/Api/SecretsManager/Controllers/SecretsController.cs # src/Api/SecretsManager/Controllers/ServiceAccountsController.cs
test/Api.IntegrationTest/SecretsManager/Controllers/ProjectsControllerTest.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I definitely see that there will be a few conflicts when I merge this into my PR though 😅
I left a couple comments, nothing major just curious about 1 or 2 things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Any places we should use UnauthorizedAccessException
or just use NotFoundException
everywhere now?
@Thomas-Avery I noticed we should have used forbidden but we don't have an exception for that and changed to not found. Open for re-adding forbidden though but it's a balance point between if we should disclose the existence of items you don't have permission to or just pretend they don't exists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we good with the stored proceduresOrganizationUser_CreateWithCollections
that flows into OrganizationUser_Create
not supporting the new flag?
Same question with OrganizationUser_UpdateWithCollections
-> OrganizationUser_Update
@Thomas-Avery not sure I follow, those are updated? https://github.com/bitwarden/server/pull/2590/files#diff-f74fe3dc4ae507f56ff7d9dfdfc3d3d0d3cdf13a7045020441bb2063b73fb9a0R21 |
My apologies, I must have been in the view that just showed the changes since my last review. Approved |
Type of change
Objective
Adds support for enabling access to secrets manger on a per user basis. And adds checks to the list projects and secrets endpoints to verify access.
Left to add:
Code changes
AccessSecretsManager
to request/response model (enables setting permission).AccessSecretsManager
function on theCurrentContext
used to determine if the user and org is allowed to access the secrets manager.AccessSecretsManager
to the user table.Before you submit
dotnet format --verify-no-changes
) (required)