jarredhj0214 opened a new pull request, #12732:
URL: https://github.com/apache/gravitino/pull/12732
### 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:
- 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.
Part of #12287.
### Does this PR introduce _any_ user-facing change?
Yes.
New REST APIs:
- `POST /api/bulk/metalakes/{metalake}/roles/add`
- `POST /api/bulk/metalakes/{metalake}/roles/remove`
The APIs use the existing `gravitino.server.bulk.maxItems` limit 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:compileTestJava`
-
`JAVA_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
-PskipITs`
-
`JAVA_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 -PskipITs`
- `git diff --check`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]