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/28 00:59:10 UTC
[PR] [#12562] feat(lance): Add table mutation and deletion authorization [gravitino]
yuqi1129 opened a new pull request, #12696:
URL: https://github.com/apache/gravitino/pull/12696
> **Draft: depends on #12561.** This branch is stacked on it, so the diff shown here includes the earlier PRs' commits until they merge.
### What changes were proposed in this pull request?
Authorizes the Lance REST table mutation and deletion operations.
- `drop_columns` and `alter_columns` require `MODIFY_TABLE` or ownership.
- `deregister-table` and `drop-table` require ownership of the table or of one of its ancestors. `MODIFY_TABLE` alters a table but never removes it, matching the Gravitino and Iceberg REST surfaces.
- Every expression is guarded on the addressed entity type, so an identifier that resolves to a catalog or a schema cannot be authorized as if it addressed a table.
Fix: #12562
### Does this PR introduce _any_ user-facing change?
Yes. With authorization enabled, column changes, deregister, and drop are authorized and denied requests return 403 before any metadata or storage mutation. A table the caller may not remove is reported as forbidden whether or not it exists, so these endpoints cannot be used to probe for existence.
### How was this patch tested?
- `TestLanceMetadataAuthorizationMethodInterceptor`: new tests covering `MODIFY_TABLE` for column changes, ownership for removal (including that `MODIFY_TABLE` alone is not enough), and identifiers of the wrong depth.
- `LanceTableAuthorizationIT`: three new tests using a dedicated `MODIFY_TABLE`-only user, covering denied column changes, denied removal leaving the table in place, removal by the creating owner, and concealed-not-found on deregister.
- `./gradlew :lance:lance-rest-server:build :lance:lance-common:build` — 191 tests, all passing.
--
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] [#12562] feat(lance): Add table mutation and deletion authorization [gravitino]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12696:
URL: https://github.com/apache/gravitino/pull/12696#issuecomment-5447619195
<!-- coverage-report -->
### Code Coverage Report
|Overall Project|68.56% **`+0.14%`**|:green_circle:|
|:-|:-|:-:|
|Files changed|71.87%|:green_circle:|
<br>
|Module|Coverage||
|:-|:-|:-:|
|aliyun|19.74%|:red_circle:|
|api|52.6% **`+0.34%`**|: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.17% **`+12.2%`**|: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|60.55%|: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|77.92% **`-2.52%`**|:green_circle:|
|common|55.74% **`-0.19%`**|:green_circle:|
|core|83.74% **`-0.54%`**|: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.61%|:green_circle:|
|idp-basic|85.98%|:green_circle:|
|integration-test-common|0.0%|:red_circle:|
|jobs|62.92%|:green_circle:|
|lance-common|32.46% **`-8.19%`**|:red_circle:|
|lance-rest-server|66.28% **`+24.17%`**|:green_circle:|
|lineage|53.02%|:green_circle:|
|optimizer|83.24%|:green_circle:|
|optimizer-api|21.95%|:red_circle:|
|server|88.04%|:green_circle:|
|server-common|80.35% **`+2.19%`**|:green_circle:|
|spark|28.57%|:red_circle:|
|spark-common|48.92%|:green_circle:|
|tencent|69.84%|:green_circle:|
|trino-connector|47.44%|:green_circle:|
<details>
<summary>Files</summary>
|Module|File|Coverage||
|:-|:-|:-|:-:|
|api|[SchemaChange.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/api/src/main/java/org/apache/gravitino/SchemaChange.java)|91.67%|:green_circle:|
||[CatalogChange.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/api/src/main/java/org/apache/gravitino/CatalogChange.java)|69.57%|:green_circle:|
|catalog-fileset|[FilesetCatalogOperations.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/catalogs/catalog-fileset/src/main/java/org/apache/gravitino/catalog/fileset/FilesetCatalogOperations.java)|81.89%|:green_circle:|
|client-java|[DTOConverters.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/clients/client-java/src/main/java/org/apache/gravitino/client/DTOConverters.java)|54.64%|:red_circle:|
|common|[CatalogUpdateRequest.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/common/src/main/java/org/apache/gravitino/dto/requests/CatalogUpdateRequest.java)|60.0%|:green_circle:|
||[SchemaUpdateRequest.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/common/src/main/java/org/apache/gravitino/dto/requests/SchemaUpdateRequest.java)|0.0%|:red_circle:|
|core|[OperationDispatcher.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/core/src/main/java/org/apache/gravitino/catalog/OperationDispatcher.java)|91.27%|:green_circle:|
||[FilesetOperationDispatcher.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/core/src/main/java/org/apache/gravitino/catalog/FilesetOperationDispatcher.java)|82.86%|:green_circle:|
||[SchemaOperationDispatcher.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/core/src/main/java/org/apache/gravitino/catalog/SchemaOperationDispatcher.java)|80.08%|:green_circle:|
||[CatalogManager.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java)|71.25%|:green_circle:|
||[ManagedSchemaOperations.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/core/src/main/java/org/apache/gravitino/catalog/ManagedSchemaOperations.java)|29.2%|:red_circle:|
|lance-common|[LanceMetadataFilter.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/lance/lance-common/src/main/java/org/apache/gravitino/lance/common/ops/LanceMetadataFilter.java)|25.0%|:red_circle:|
||[GravitinoLanceNameSpaceOperations.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/lance/lance-common/src/main/java/org/apache/gravitino/lance/common/ops/gravitino/GravitinoLanceNameSpaceOperations.java)|1.32%|:red_circle:|
|lance-rest-server|[LanceMetadataAuthorizationMethodInterceptor.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/lance/lance-rest-server/src/main/java/org/apache/gravitino/lance/service/authorization/LanceMetadataAuthorizationMethodInterceptor.java)|98.89%|:green_circle:|
||[LanceTableOperations.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/lance/lance-rest-server/src/main/java/org/apache/gravitino/lance/service/rest/LanceTableOperations.java)|97.37%|:green_circle:|
||[LanceNamespaceOperations.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/lance/lance-rest-server/src/main/java/org/apache/gravitino/lance/service/rest/LanceNamespaceOperations.java)|88.37%|:green_circle:|
||[LanceAuthorizationExpressions.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/lance/lance-rest-server/src/main/java/org/apache/gravitino/lance/service/authorization/LanceAuthorizationExpressions.java)|0.0%|:red_circle:|
||[LanceAuthorizationMetadataFilter.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/lance/lance-rest-server/src/main/java/org/apache/gravitino/lance/service/authorization/LanceAuthorizationMetadataFilter.java)|0.0%|:red_circle:|
||[LanceRESTAuthInterceptionService.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/lance/lance-rest-server/src/main/java/org/apache/gravitino/lance/service/authorization/LanceRESTAuthInterceptionService.java)|0.0%|:red_circle:|
|server-common|[JcasbinAuthorizer.java](https://github.com/yuqi1129/gravitino/blob/7a69a61c9bb60d46d610fd14a0a465f76cbe9fad/server-common/src/main/java/org/apache/gravitino/server/authorization/jcasbin/JcasbinAuthorizer.java)|87.72%|:green_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
Re: [PR] [#12562] feat(lance): Add table mutation and deletion authorization [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #12696:
URL: https://github.com/apache/gravitino/pull/12696#discussion_r3922548042
##########
lance/lance-rest-server/src/test/java/org/apache/gravitino/lance/integration/test/LanceTableAuthorizationIT.java:
##########
@@ -202,6 +265,94 @@ public void testCreateTablePrivilegeCannotOverwriteAnotherOwnersTable() throws E
Assertions.assertEquals(location(HIDDEN_TABLE), describedLocation(ADMIN, HIDDEN_TABLE));
}
+ @Test
+ public void testColumnMutationRequiresModifyTable() throws Exception {
+ // Selecting a table does not authorize changing its columns.
+ assertStatus(403, dropColumns(READER, MUTABLE_TABLE, "value"));
+ assertStatus(403, alterColumns(READER, MUTABLE_TABLE, "value", "renamed"));
+ Assertions.assertEquals(List.of("id", "value"), describedColumns(MUTABLE_TABLE));
Review Comment:
Good catch, this was a real problem with the test. `READER` had no `USE_SCHEMA` on `WRITE_SCHEMA` and no `SELECT_TABLE` on `MUTABLE_TABLE`, so the 403 only showed that it could not reach the table, not that `SELECT_TABLE` fails to authorize a column change.
Fixed in 6fd5489: `READER` now holds `USE_SCHEMA` on `WRITE_SCHEMA` and `SELECT_TABLE` on `MUTABLE_TABLE`, and the test asserts `describe` returns 200 for it before the two denials. The only privilege it is missing now is `MODIFY_TABLE`, so the denials say what the test claims.
--
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] [#12562] feat(lance): Add table mutation and deletion authorization [gravitino]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #12696:
URL: https://github.com/apache/gravitino/pull/12696#discussion_r3922418381
##########
lance/lance-rest-server/src/test/java/org/apache/gravitino/lance/integration/test/LanceTableAuthorizationIT.java:
##########
@@ -202,6 +265,94 @@ public void testCreateTablePrivilegeCannotOverwriteAnotherOwnersTable() throws E
Assertions.assertEquals(location(HIDDEN_TABLE), describedLocation(ADMIN, HIDDEN_TABLE));
}
+ @Test
+ public void testColumnMutationRequiresModifyTable() throws Exception {
+ // Selecting a table does not authorize changing its columns.
+ assertStatus(403, dropColumns(READER, MUTABLE_TABLE, "value"));
+ assertStatus(403, alterColumns(READER, MUTABLE_TABLE, "value", "renamed"));
+ Assertions.assertEquals(List.of("id", "value"), describedColumns(MUTABLE_TABLE));
Review Comment:
In `testColumnMutationRequiresModifyTable`, the negative case uses `READER` against `MUTABLE_TABLE`, but `READER` is not granted `USE_SCHEMA` on `WRITE_SCHEMA` nor `SELECT_TABLE` on `MUTABLE_TABLE` (it only has `SELECT_TABLE` on `VISIBLE_TABLE` in `SCHEMA`). This means the 403 responses here can be caused by lack of schema/table access rather than demonstrating the intended property that `SELECT_TABLE` does not authorize column mutation.
--
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] [#12562] feat(lance): Add table mutation and deletion authorization [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 merged PR #12696:
URL: https://github.com/apache/gravitino/pull/12696
--
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