Skip to content

[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
branch-1.3from
cherry-pick-c9f861ca-to-branch-1.3
Closed

[DO NOT MERGE] [Cherry-pick to branch-1.3] [#12670] improve(authz): Show full NameIdentifier in denial messages (#12671)#12681
github-actions[bot] wants to merge 1 commit into
branch-1.3from
cherry-pick-c9f861ca-to-branch-1.3

Conversation

@github-actions

Copy link
Copy Markdown

Cherry-pick Information:

  • Original commit: c9f861c
  • Target branch: branch-1.3
  • Status: ⚠️ Has conflicts - manual resolution required

Do not merge until conflict markers are resolved and the
cherry-pick-conflict label is removed.

Please review and resolve the conflicts before merging.

…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
@github-actions github-actions Bot added cherry-pick Automatically opened cherry-pick PR cherry-pick-conflict Cherry-pick has conflicts; needs human resolution before merge labels Aug 27, 2026
@github-actions
github-actions Bot requested a review from jerryshao August 27, 2026 14:03
@jerryshao

Copy link
Copy Markdown
Contributor

@jarredhj0214 can you manually raise a PR to fix the conflicts?

@jarredhj0214

Copy link
Copy Markdown
Contributor

@jarredhj0214 can you manually raise a PR to fix the conflicts?

ok

@jarredhj0214

Copy link
Copy Markdown
Contributor

@jarredhj0214 can you manually raise a PR to fix the conflicts?

ok

Created a manual backport PR: #12702. thanks

@jerryshao jerryshao closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick Automatically opened cherry-pick PR cherry-pick-conflict Cherry-pick has conflicts; needs human resolution before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants