[DO NOT MERGE] [Cherry-pick to branch-1.3] [#12670] improve(authz): Show full NameIdentifier in denial messages (#12671) - #12681
Closed
github-actions[bot] wants to merge 1 commit into
Closed
Conversation
…12671) ### What changes were proposed in this pull request? This PR updates authorization denial messages generated by `GravitinoInterceptionService` to show the full `NameIdentifier` of the denied metadata object instead of only the last segment. For example, a table authorization failure now reports metadata like `metalake.catalog.schema.table` instead of `table`. A unit test is added to cover multi-segment `NameIdentifier` rendering in the no-auth response. ### Why are the changes needed? When different catalogs or schemas contain metadata objects with the same name, showing only `NameIdentifier.name()` makes authorization failures harder to diagnose. Showing the full `NameIdentifier` helps users identify the exact denied resource directly from the 403 error message. Fixes #12670 ### Does this PR introduce _any_ user-facing change? Yes. The diagnostic text in 403 authorization denial messages changes from the last metadata name segment to the full `NameIdentifier`. This does not change authorization logic, HTTP status codes, error response structure, response fields, or user permissions. ### How was this patch tested? Added a unit test in `TestGravitinoInterceptionService` to verify that authorization denial messages include the full metadata `NameIdentifier`. Ran `JAVA_HOME=/opt/homebrew/opt/openjdk@17 ./gradlew :server:test --tests org.apache.gravitino.server.web.filter.TestGravitinoInterceptionService -PskipITs`. # Conflicts: # server/src/test/java/org/apache/gravitino/server/web/filter/TestGravitinoInterceptionService.java
Contributor
|
@jarredhj0214 can you manually raise a PR to fix the conflicts? |
Contributor
ok |
Contributor
Created a manual backport PR: #12702. thanks |
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.3Do not merge until conflict markers are resolved and the
cherry-pick-conflictlabel is removed.Please review and resolve the conflicts before merging.