You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds best-effort bulk role access-control APIs as the third part of #12287.
Changes include:
Add bulk role add request/response DTOs.
Add a core RoleAdd bulk item model.
Add AccessControlDispatcher#createRoles and #deleteRoles.
Implement bulk role create/delete logic in AccessControlManager with item-level results.
Dispatch existing per-role create/delete pre, success, and failure events for bulk role operations.
Add REST APIs for bulk role add/remove.
Add OpenAPI definitions for bulk role APIs.
Add tests for best-effort behavior, request validation, role authorization, and core manager behavior.
Why are the changes needed?
#12287 tracks best-effort bulk operations for access-control entities under a metalake. The first PR added the shared bulk foundation and bulk user APIs, and the second PR added bulk group APIs. This PR continues the epic by adding bulk role APIs using the same approach.
Hi @lasdf1234, this is the third part of #12287, adding bulk role access-control APIs following the same approach as the merged bulk user and group PRs. Could you please help review it when you have time? Thanks!
In the "access-control.md" file, add the bulk role and change "authorized once" - the role removal process is now per-item authorization.
Bulk deleteRole and single deleteRole should have the same event.
Thanks for the review. I updated access-control.md to include the bulk role APIs and clarified that bulk role removal is authorized per item. I also aligned bulk delete role events with single delete role events, and added unit tests for the bulk role request/response DTOs.
@roryqi Could you please help review this when you have free time? Thanks!
The reason will be displayed to describe this comment to others. Learn more.
Table alignment
This file contains hidden or 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
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.
What changes were proposed in this pull request?
This PR adds best-effort bulk role access-control APIs as the third part of #12287.
Changes include:
RoleAddbulk item model.AccessControlDispatcher#createRolesand#deleteRoles.AccessControlManagerwith item-level results.Why are the changes needed?
#12287 tracks best-effort bulk operations for access-control entities under a metalake. The first PR added the shared bulk foundation and bulk user APIs, and the second PR added bulk group APIs. This PR continues the epic by adding bulk role APIs using the same approach.
Part of #12287.
Does this PR introduce any user-facing change?
Yes.
New REST APIs:
POST /api/bulk/metalakes/{metalake}/roles/addPOST /api/bulk/metalakes/{metalake}/roles/removeThe APIs use the existing
gravitino.server.bulk.maxItemslimit introduced by the bulk foundation PR.How was this patch tested?
JAVA_HOME=/opt/homebrew/Cellar/openjdk@17/17.0.18/libexec/openjdk.jdk/Contents/Home ./gradlew :common:compileJava :core:compileTestJava :server:compileTestJava :clients:client-java:compileTestJavaJAVA_HOME=/opt/homebrew/Cellar/openjdk@17/17.0.18/libexec/openjdk.jdk/Contents/Home ./gradlew :core:test --tests org.apache.gravitino.authorization.TestAccessControlManager :server:test --tests org.apache.gravitino.server.web.rest.TestBulkOperations :docs:build -PskipITsJAVA_HOME=/opt/homebrew/Cellar/openjdk@17/17.0.18/libexec/openjdk.jdk/Contents/Home ./gradlew :server:test --tests org.apache.gravitino.server.web.rest.TestBulkOperations -PskipITsgit diff --check