[Cherry-pick to branch-1.3] [#12729] fix(authz): Authorize generic view operations (#12797) - #12868
Merged
Merged
Conversation
### What changes were proposed in this pull request? - Register generic `ViewOperations` with `GravitinoInterceptionService`. - Add authorization expressions and metadata for list, create, load, alter, and drop endpoints. - Filter listed views by ownership or `SELECT_VIEW`. - Set the generic View creator as owner and preserve authorization mappings across rename. - Reuse `CREATE_VIEW`, `SELECT_VIEW`, and owner-based mutation semantics without introducing an `ALTER_VIEW` privilege. - Update authorization, OpenAPI, and View design documentation. ### Why are the changes needed? Generic View REST operations currently bypass metadata authorization, allowing requests to reach catalog lookup before privilege checks. Fix: #12729 ### Does this PR introduce _any_ user-facing change? Yes. When authorization is enabled: - Generic View endpoints enforce metadata-operation authorization. - View listings only return authorized entries. - Newly created Views are owned by their creator. - Alter and drop operations are owner-based. This does not add an explicit `INVOKER`/`DEFINER` option, `DEFINER` execution, or new engine integration. The current Iceberg engine path continues to use invoker behavior. ### How was this patch tested? - Ran 50 focused authorization, interceptor, REST, ownership-hook, and Iceberg View tests. - Ran Spotless checks for all affected Java modules. - Ran `./gradlew :docs:build --no-daemon`. - Ran `git diff origin/main...HEAD --check`. # Conflicts: # docs/security/access-control.md # server/src/test/java/org/apache/gravitino/server/web/filter/TestGravitinoInterceptionService.java
Contributor
|
@mchades can you please fix the conflicts? |
Contributor
|
@mchades please update the PR title/descriptio/label. |
Contributor
|
fixed |
jerryshao
approved these changes
Sep 3, 2026
Author
Code Coverage Report
Files
|
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
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.
Cherry-pick Information:
branch-1.3Resolution:
branch-1.3privilege table and applied only the View metadata authorization wording.Validation:
./gradlew :core:test --tests org.apache.gravitino.hook.TestViewHookDispatcher --no-daemon./gradlew :server:test --tests org.apache.gravitino.server.web.filter.TestGravitinoInterceptionService --tests org.apache.gravitino.server.web.rest.TestViewOperations --tests org.apache.gravitino.server.web.rest.authorization.TestViewAuthorizationExpression --no-daemon./gradlew :iceberg:iceberg-rest-server:test --tests org.apache.gravitino.iceberg.service.rest.authorization.TestIcebergViewAuthorizationExpression --no-daemon./gradlew :docs:build --no-daemongit diff --check