-
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-863] Add endpoint for fetching multiple secrets by IDs #3134
Conversation
New Issues
|
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.
Great job @Thomas-Avery I just had 2 easy questions about the tests, other than that it looks great.
...al.Core.Test/SecretsManager/AuthorizationHandlers/Secrets/SecretAuthorizationHandlerTests.cs
Show resolved
Hide resolved
test/Api.IntegrationTest/SecretsManager/Controllers/SecretsControllerTests.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.
LGTM Thomas :)
Type of change
Objective
Code changes
bitwarden_license/src/Commercial.Core/SecretsManager/AuthorizationHandlers/Secrets/SecretAuthorizationHandler.cs:
Adding CanReadSecret authorization.
src/Core/SecretsManager/AuthorizationRequirements/SecretOperationRequirement.cs:
Adding read option.
bitwarden_license/test/Commercial.Core.Test/SecretsManager/AuthorizationHandlers/Secrets/SecretAuthorizationHandlerTests.cs:
Adding unit tests for the CanReadSecret option.
bitwarden_license/src/Commercial.Infrastructure.EntityFramework/SecretsManager/Repositories/SecretRepository.cs:
Bug fix since service accounts can have write access now.
src/Api/SecretsManager/Controllers/SecretsController.cs:
Adding a new endpoint to fetch secrets given a list of secret IDs.
src/Api/SecretsManager/Models/Request/GetSecretsRequestModel.cs:
Request model for the new endpoint.
src/Api/SecretsManager/Models/Response/BaseSecretResponseModel.cs:
src/Api/SecretsManager/Models/Response/SecretResponseModel.cs:
Since we won't need to return access information (read, write) for the endpoint, separating out response models.
BaseSecretResponseModel
will just have secret information andSecretResponseModel
will have the extra access information.src/Core/Services/Implementations/EventService.cs:
src/Core/Services/NoopImplementations/NoopEventService.cs:
Adding a new method to the event service that will bulk insert many service account fetching secret events at once.
test/Api.IntegrationTest/SecretsManager/Controllers/SecretsControllerTests.cs:
Integration tests for the new endpoint.
test/Api.Test/SecretsManager/Controllers/SecretsControllerTests.cs:
Unit tests for the new endpoint.
Before you submit
dotnet format --verify-no-changes
) (required)