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-923] Add project service accounts access policies management endpoints #3993
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd-bitwarden
previously approved these changes
Apr 24, 2024
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 great! 👍 🎉
cd-bitwarden
approved these changes
May 1, 2024
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.
Your most recent changes look good!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of change
Objective
The purpose of this change is to add new project service accounts access policies management endpoints to support the new client design.
Client PR bitwarden/clients#8789
Code changes
bitwarden_license/src/Commercial.Core/SecretsManager/AuthorizationHandlers/AccessPolicies/ProjectServiceAccountsAccessPoliciesAuthorizationHandler.cs:
src/Core/SecretsManager/AuthorizationRequirements/ProjectServiceAccountsAccessPoliciesOperationRequirement.cs:
Add authz handler for processing
ProjectServiceAccountsAccessPoliciesUpdates
.bitwarden_license/src/Commercial.Core/SecretsManager/Commands/AccessPolicies/UpdateProjectServiceAccountsAccessPoliciesCommand.cs:
src/Core/SecretsManager/Commands/AccessPolicies/Interfaces/IUpdateProjectServiceAccountsAccessPoliciesCommand.cs:
Add command for executing
ProjectServiceAccountsAccessPoliciesUpdates
.bitwarden_license/src/Commercial.Core/SecretsManager/Queries/AccessPolicies/ProjectServiceAccountsAccessPoliciesUpdatesQuery.cs:
Add query to calculate what
ProjectServiceAccountsAccessPoliciesUpdates
need to be made.bitwarden_license/src/Commercial.Core/SecretsManager/SecretsManagerCollectionExtensions.cs:
Add new command, query, and authz handler to DI.
bitwarden_license/src/Commercial.Infrastructure.EntityFramework/SecretsManager/Repositories/AccessPolicyRepository.cs:
src/Core/SecretsManager/Repositories/IAccessPolicyRepository.cs
Add repository updates to handle
ProjectServiceAccountsAccessPolicies
.bitwarden_license/src/Commercial.Infrastructure.EntityFramework/SecretsManager/Repositories/ServiceAccountRepository.cs:
src/Core/SecretsManager/Repositories/IServiceAccountRepository.cs:
src/Core/SecretsManager/Repositories/Noop/NoopServiceAccountRepository.cs:
Add repository methods to get access for many service accounts and check that all service accounts are in the same organization.
bitwarden_license/test/Commercial.Core.Test/SecretsManager/AuthorizationHandlers/AccessPolicies/ProjectServiceAccountsAccessPoliciesAuthorizationHandlerTests.cs:
Add unit tests for the new authz handler.
bitwarden_license/test/Commercial.Core.Test/SecretsManager/Commands/AccessPolicies/UpdateProjectServiceAccountsAccessPoliciesCommandTests.cs:
Add unit tests for the new command.
bitwarden_license/test/Commercial.Core.Test/SecretsManager/Queries/AccessPolicies/ProjectServiceAccountsAccessPoliciesUpdatesQueryTests.cs:
src/Core/SecretsManager/Queries/AccessPolicies/Interfaces/IProjectServiceAccountsAccessPoliciesUpdatesQuery.cs:
Add unit tests for the new query.
src/Api/SecretsManager/Controllers/AccessPoliciesController.cs:
Add new management endpoints.
src/Api/SecretsManager/Models/Request/ProjectServiceAccountsAccessPoliciesRequestModel.cs:
Add request model for new management endpoints.
src/Api/SecretsManager/Models/Response/ProjectServiceAccountsAccessPoliciesResponseModel.cs:
Add response model for new management endpoints.
src/Api/SecretsManager/Models/Response/ProjectServiceAccountsAccessPoliciesResponseModel.cs:
Add response model for new management endpoints.
src/Core/SecretsManager/Models/Data/AccessPolicyUpdates/ProjectServiceAccountsAccessPoliciesUpdates.cs:
Add data model to represent updates to a project's service accounts access policies.
src/Core/SecretsManager/Models/Data/ProjectServiceAccountsAccessPolicies.cs:
Add data model to represent a project's service accounts access policies.
test/Api.IntegrationTest/SecretsManager/Controllers/AccessPoliciesControllerTests.cs:
Add integration tests for the new management endpoints.
test/Api.Test/SecretsManager/Controllers/AccessPoliciesControllerTests.cs:
Add unit tests for the new management endpoints.
test/Core.Test/SecretsManager/Models/ProjectServiceAccountsAccessPoliciesTests.cs:
Add unit tests for the data models methods.
Before you submit
dotnet format --verify-no-changes
) (required)