You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "yuqi1129 (via GitHub)" <gi...@apache.org> on 2026/08/26 03:58:04 UTC
[PR] [#12622] improvement(server): apply the list authorization short-circuit to every list shape [gravitino]
yuqi1129 opened a new pull request, #12623:
URL: https://github.com/apache/gravitino/pull/12623
### What changes were proposed in this pull request?
Move the parent-scope short-circuit and the `preloadToCache` / `preloadOwner` calls from `MetadataAuthzHelper.filterByExpression(..., NameIdentifier[])` into the generic `filterByExpression(..., E[], Function)`, and let the identifier overload delegate to the generic one.
Every list endpoint now passes the same point regardless of the shape it holds its results in, so a caller with a parent-scope grant is filtered with one expression evaluation and one deny check instead of one evaluation per object.
### Why are the changes needed?
`listCatalogs?details=true` carries `Catalog[]` and went through the generic overload, which had neither the short-circuit nor the preloads, so it ran the per-object loop over every catalog in the metalake. Catalogs are the only entity type with a `details=true` variant, which is why tables and schemas were unaffected and this went unnoticed.
The list endpoints for functions, groups, jobs, policies, roles, tags and users also use the generic overload and gain the preloads.
Fix: #12622
### Does this PR introduce _any_ user-facing change?
No. Filtering results are unchanged; only the work done to reach them is. No API or property is added.
### How was this patch tested?
- New `testListShortCircuitAppliesToNonIdentifierResults` filters a non-identifier array through the generic overload. It fails without this change and passes with it. It asserts `hasDenyPolicy` is consulted exactly once, which only the short-circuit does; asserting on the returned elements alone would not catch the regression, because the metalake-scope grant satisfies the per-object expression as well.
- `./gradlew :server-common:test :server:test -PskipITs` — `TestMetadataAuthzHelper` 10, `TestCatalogOperations` 9, `TestCatalogAuthorizationExpression` 5, no failures.
- `./gradlew :server-common:spotlessCheck :server-common:javadoc :server:compileJava :iceberg:iceberg-rest-server:compileJava -PskipITs`.
- `TestHttpsServerAuthentication` mutual-TLS cases fail intermittently in a full `:server-common:test` run on `main` as well, with different cases failing across runs; unrelated to this change.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#12622] improvement(server): apply the list authorization short-circuit to every list shape [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 closed pull request #12623: [#12622] improvement(server): apply the list authorization short-circuit to every list shape
URL: https://github.com/apache/gravitino/pull/12623
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#12622] improvement(server): apply the list authorization short-circuit to every list shape [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on PR #12623:
URL: https://github.com/apache/gravitino/pull/12623#issuecomment-5421536675
@roryqi
Can you help to review the PR?
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#12622] improvement(server): apply the list authorization short-circuit to every list shape [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on PR #12623:
URL: https://github.com/apache/gravitino/pull/12623#issuecomment-5422196462
> Shall we backport to branch-1.3?
It's an important improvement, and I suppose we should cherry-pick it to branch-1.3
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#12622] improvement(server): apply the list authorization short-circuit to every list shape [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 merged PR #12623:
URL: https://github.com/apache/gravitino/pull/12623
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#12622] improvement(server): apply the list authorization short-circuit to every list shape [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on PR #12623:
URL: https://github.com/apache/gravitino/pull/12623#issuecomment-5422129828
Shall we backport to branch-1.3?
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#12622] improvement(server): apply the list authorization short-circuit to every list shape [gravitino]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12623:
URL: https://github.com/apache/gravitino/pull/12623#issuecomment-5420962096
<!-- coverage-report -->
### Code Coverage Report
|Overall Project|68.13% **`-0.02%`**|:green_circle:|
|:-|:-|:-:|
|Files changed|59.88%|:red_circle:|
<br>
|Module|Coverage||
|:-|:-|:-:|
|aliyun|19.74%|:red_circle:|
|api|52.94%|:green_circle:|
|authorization-common|85.96%|:green_circle:|
|authorization-ranger|4.38%|:red_circle:|
|aws|53.54%|:green_circle:|
|azure|32.1%|:red_circle:|
|catalog-common|9.9%|:red_circle:|
|catalog-fileset|80.02%|:green_circle:|
|catalog-glue|69.24%|:green_circle:|
|catalog-hive|82.96%|:green_circle:|
|catalog-jdbc-common|45.69%|:green_circle:|
|catalog-jdbc-doris|82.44%|:green_circle:|
|catalog-jdbc-mysql|79.33%|:green_circle:|
|catalog-jdbc-postgresql|83.39%|:green_circle:|
|catalog-jdbc-starrocks|79.16%|:green_circle:|
|catalog-kafka|76.99%|:green_circle:|
|catalog-lakehouse-generic|59.35%|:green_circle:|
|catalog-lakehouse-hudi|79.1%|:green_circle:|
|catalog-lakehouse-iceberg|85.93%|:green_circle:|
|catalog-lakehouse-paimon|84.26%|:green_circle:|
|catalog-model|77.99%|:green_circle:|
|cli|44.48%|:green_circle:|
|client-java|78.07%|:green_circle:|
|common|52.29%|:green_circle:|
|core|83.4%|:green_circle:|
|filesystem-hadoop3|76.45%|:green_circle:|
|flink|0.0%|:red_circle:|
|flink-common|50.29%|:green_circle:|
|flink-runtime|0.0%|:red_circle:|
|gcp|32.2%|:red_circle:|
|hadoop-auth|68.0%|:green_circle:|
|hadoop-common|17.84%|:red_circle:|
|hive-metastore-common|53.4%|:green_circle:|
|iceberg-aliyun-bundle|0.0%|:red_circle:|
|iceberg-common|64.75%|:green_circle:|
|iceberg-rest-server|75.38%|:green_circle:|
|idp-basic|85.98%|:green_circle:|
|integration-test-common|0.0%|:red_circle:|
|jobs|62.92%|:green_circle:|
|lance-common|32.81%|:red_circle:|
|lance-rest-server|64.78%|:green_circle:|
|lineage|53.02%|:green_circle:|
|optimizer|83.17%|:green_circle:|
|optimizer-api|21.95%|:red_circle:|
|server|88.02%|:green_circle:|
|server-common|79.6% **`-1.26%`**|:green_circle:|
|spark|28.57%|:red_circle:|
|spark-common|48.92%|:green_circle:|
|tencent|69.84%|:green_circle:|
|trino-connector|47.41%|:green_circle:|
<details>
<summary>Files</summary>
|Module|File|Coverage||
|:-|:-|:-|:-:|
|server-common|[MetadataAuthzHelper.java](https://github.com/yuqi1129/gravitino/blob/784d3fdaefbf1501428a9d38dda9f2e724fb8eba/server-common/src/main/java/org/apache/gravitino/server/authorization/MetadataAuthzHelper.java)|59.88%|:red_circle:|
</details>
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org