Repository navigation
[#13839] fix(server): Enforce metadata tag permissions on branch-1.3 - #13843
Conversation
…h-1.3 Adapt the server fix from apache#13794 (5ef4945) to branch-1.3. Group the complete CAN_ACCESS_METADATA expansion so object access cannot bypass tag permissions. Cover both REST authorization expressions with table and view permissions, and add a Java client HTTP regression for denied and authorized tag reads. Co-authored-by: Akshay Thorat <ak007t@gmail.com>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open finding
What changed in this PR
Backports a server authorization fix to branch-1.3 to ensure metadata-object tag reads can’t bypass tag permissions, and adds regression coverage for both REST routes and the Java client.
Changes:
- Groups the full
CAN_ACCESS_METADATAauthorization sub-expression to enforce correct operator precedence. - Adds a server-side unit test verifying tag reads require both metadata access and tag permissions across both REST resources.
- Extends Java client integration coverage to include
getTag()authorization via metadata-backed tag APIs.
| File | Description |
|---|---|
| server/src/test/java/org/apache/gravitino/server/web/rest/authorization/TestMetadataObjectTagAuthorizationExpression.java | Adds a regression test to validate tag-read authorization isn’t bypassed via metadata access. |
| server-common/src/main/java/org/apache/gravitino/server/authorization/expression/AuthorizationExpressionConverter.java | Fixes precedence by wrapping the full CAN_ACCESS_METADATA OR-chain in parentheses. |
| clients/client-java/src/test/java/org/apache/gravitino/client/integration/test/authorization/TagOperationsAuthorizationIT.java | Extends IT coverage to assert getTag() obeys tag permissions when accessed via metadata objects. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| for (String type : new String[] {"TABLE", "VIEW"}) { | ||
| MockAuthorizationExpressionEvaluator evaluator = | ||
| new MockAuthorizationExpressionEvaluator( | ||
| AuthorizationExpressionConverter.replaceCanAccessMetadataPrivilege(expression) | ||
| .replace("entityType", "'" + type + "'")); |
|
Do we need to fix this issue in the main branch? |
yes, the same fixed included in #13794 |
Code Coverage Report
Files
|

What changes were proposed in this pull request?
Apply the server fix from #13794 to
branch-1.3: group the completeCAN_ACCESS_METADATAexpression and add regression coverage for both tag REST routes and Java client tag reads, using 1.3's supported types and privileges.Why are the changes needed?
Metadata access could bypass tag permissions and expose associated tags to unauthorized users.
Fix: #13839 (branch-1.3)
Does this PR introduce any user-facing change?
Tag reads through metadata objects now enforce tag permissions.
How was this patch tested?
server-commontests, 43 server authorization tests, and 10TagOperationsAuthorizationITtests passed.git diff --checkpassed.