-
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-949] Add endpoint to fetch events by service account #3336
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.
LGTM 😄
...e/SecretsManager/AuthorizationHandlers/ServiceAccounts/ServiceAccountAuthorizationHandler.cs
Outdated
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.
Just a couple of small side conversations that should be non-blocking. 👍
5cab0ef
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 !
73a7bce
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.
changes look good 👍 😄
Type of change
Objective
The purpose of this PR is to add a Secrets Manager endpoint for fetching events by service account.
Code changes
bitwarden_license/src/Commercial.Core/SecretsManager/AuthorizationHandlers/ServiceAccounts/ServiceAccountAuthorizationHandler.cs:
bitwarden_license/test/Commercial.Core.Test/SecretsManager/AuthorizationHandlers/ServiceAccounts/ServiceAccountAuthorizationHandlerTests.cs:
src/Core/SecretsManager/AuthorizationRequirements/ServiceAccountOperationRequirement.cs:
Add operation for the authz handler for reading service account events.
src/Api/Controllers/EventsController.cs:
src/Api/Utilities/ApiHelpers.cs:
Extract the private method
GetDateRange
into the ApiHelpers utility so it can be used in this controller and the SM controller.src/Api/SecretsManager/Controllers/SecretsManagerEventsController.cs:
Add a new controller for fetching Secrets Manager events.
src/Core/Repositories/IEventRepository.cs:
Add a new method to fetch events by organization and service account.
src/Core/Repositories/TableStorage/EventRepository.cs:
Add a new method to fetch events by organization and service account.
src/Infrastructure.Dapper/Repositories/EventRepository.cs:
Add a new method to fetch events by organization and service account.
Fix missing Secrets Manager columns in the create many events flow.
src/Infrastructure.EntityFramework/Repositories/EventRepository.cs:
src/Infrastructure.EntityFramework/Repositories/Queries/EventReadPageByOrganizationIdServiceAccountIdQuery.cs:
Add a new method and EF query to fetch events by organization and service account.
src/Sql/SecretsManager/dbo/Stored Procedures/Event/Event_ReadPageByOrganizationIdServiceAccountId.sql:
Add stored procedure for reading service account events.
test/Api.IntegrationTest/SecretsManager/Controllers/SecretsManagerEventsControllerTests.cs:
Add integration tests for new controller.
test/Api.Test/SecretsManager/Controllers/SecretsManagerEventsControllerTests.cs:
Add unit tests for new controller.
util/Migrator/DbScripts/2023-10-09_00_Event_ReadPageByOrganizationIdServiceAccountId.sql:
Migration to add the new stored procedure.
Before you submit
dotnet format --verify-no-changes
) (required)