Repository navigation
Conversation
c964522 to
878e6c1
Compare
878e6c1 to
2ad57d8
Compare
|
Rebased to fix conflicts. |
|
For some reason, CI is not running for this PR 🤷♂️ |
9b17f73 to
078ae3c
Compare
|
Now it's running 😅 🤷♂️ |
078ae3c to
f2298d8
Compare
|
FYI I had to rebase and change the implementation due to #3719. @sririshindra and @flyrain since you authored/reviewed #3719, could you review this one please? |
| } | ||
|
|
||
| @TestFactory | ||
| Stream<DynamicNode> testLoadTablePrivileges() { |
There was a problem hiding this comment.
I moved this test down below because it was misplaced.
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
flyrain
left a comment
There was a problem hiding this comment.
LGTM. Lefts minor questions and comments.
| REGISTER_TABLE_WITH_READ_DELEGATION(EnumSet.of(TABLE_CREATE, TABLE_READ_DATA)), | ||
| REGISTER_TABLE_WITH_WRITE_DELEGATION(EnumSet.of(TABLE_CREATE, TABLE_WRITE_DATA)), | ||
| REGISTER_TABLE_OVERWRITE_WITH_READ_DELEGATION(EnumSet.of(TABLE_FULL_METADATA, TABLE_READ_DATA)), | ||
| REGISTER_TABLE_OVERWRITE_WITH_WRITE_DELEGATION(EnumSet.of(TABLE_FULL_METADATA, TABLE_WRITE_DATA)), |
There was a problem hiding this comment.
These looks correct to me, they are also consistent with the table creation operations. cc @collado-mike @dennishuo @singhpk234
| identifier, metadata, delegationModes, actionsRequested, refreshCredentialsEndpoint) | ||
| .build(); | ||
| } | ||
| throw new IllegalStateException("Cannot wrap catalog that does not produce BaseTable"); |
There was a problem hiding this comment.
This message is confusing, how about the following:
throw new IllegalStateException(
"Expected a BaseTable object from registerTable() for %s, got: %s"
.formatted(identifier, table.getClass().getName()));
Not a blocker since this PR doesn't touch it.
There was a problem hiding this comment.
I agree that the current message is cryptic, but your suggestion leaks internal implementation details to clients, so I'm a bit reluctant to follow it.
OTOH, this throw statement is imho never reached in practice.
How about:
throw new IllegalStateException(
"Cannot register table %s: unknown table format".formatted(identifier));?
| .build(); | ||
| } | ||
|
|
||
| throw new IllegalStateException("Cannot wrap catalog that does not produce BaseTable"); |
There was a problem hiding this comment.
This message is confusing, how about the following:
throw new IllegalStateException(
"Expected a BaseTable object from registerTable() for %s, got: %s"
.formatted(identifier, table.getClass().getName()));
It'd be nice to fix in this PR, but not a blocker since this PR follows the previous pattern.
| authorizeCreateTableLikeUnderNamespaceOperationOrThrow(readOp, tableIdentifier); | ||
| } | ||
|
|
||
| checkAllowExternalCatalogCredentialVending(delegationModes); |
There was a problem hiding this comment.
A question: do we support register table in the remote catalogs?
There was a problem hiding this comment.
Yes, for non-overwrite scenarios only.
|
FYI: with the release of Iceberg 1.11, I am going to attempt to change the base branch of this PR from |
The base branch was changed.
76ca5cf to
c970093
Compare
|
FYI I successfully changed the base branch to main and updated the PR. However, since this PR depends on #4506, I switched it back to draft for now. |
There was a problem hiding this comment.
Pull request overview
This PR extends the Iceberg REST registerTable flow to support access delegation (credential vending) and adds overwrite semantics (overwrite=true) for internal Polaris catalogs, including new RBAC authorizable operations and accompanying tests/docs.
Changes:
- Add new RBAC operations for
registerTablewith read/write delegation and for overwrite variants, and wire them into authorization semantics. - Implement
registerTableaccess delegation + internal-catalog overwrite handling in the service layer and REST adapter. - Add unit/integration tests for overwrite behavior and access-delegation responses; document federation limitation and update the changelog.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| site/content/in-dev/unreleased/federation/iceberg-rest-federation.md | Document that overwrite=true registration is rejected for federated external catalogs. |
| runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogTest.java | Add unit tests for internal-catalog overwrite registration behavior. |
| runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogHandlerAuthzTest.java | Add authz coverage for new register/overwrite + delegation operations. |
| runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java | Implement registerTable delegation/overwrite flow and new authorization routing. |
| runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogAdapter.java | Parse delegation header and pass delegation modes + refresh endpoint to handler. |
| runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java | Add overwrite-capable registerTable(..., boolean overwrite) implementation. |
| polaris-core/src/main/java/org/apache/polaris/core/auth/RbacOperationSemantics.java | Map new authorizable operations to required privileges. |
| polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisAuthorizableOperation.java | Introduce new authorizable operation enum values for register/overwrite + delegation. |
| integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogIntegrationBase.java | Add integration tests for registerTable credential vending and overwrite via REST. |
| integration-tests/src/main/java/org/apache/polaris/service/it/env/CatalogApi.java | Add helper methods to register tables with/without access-delegation header. |
| CHANGELOG.md | Record new overwrite semantics and new REGISTER_TABLE_OVERWRITE authorization operation. |
fd865b4 to
1bb1e0c
Compare
| under the License. | ||
|
|
||
| --> | ||
| <configuration debug="false"> |
There was a problem hiding this comment.
This was missing and logs were being printed at DEBUG level.
|
Heads up: this is finally ready for review. |
This PR introduces support for access delegation in the `registerTable` endpoint. Four new authorizable operations are introduced: - `REGISTER_TABLE_WITH_READ_DELEGATION`: requires `TABLE_CREATE` + `TABLE_READ_DATA` - `REGISTER_TABLE_WITH_WRITE_DELEGATION`: requires `TABLE_CREATE` + `TABLE_WRITE_DATA` - `REGISTER_TABLE_OVERWRITE_WITH_READ_DELEGATION`: requires `TABLE_FULL_METADATA`+ `TABLE_READ_DATA` - `REGISTER_TABLE_OVERWRITE_WITH_WRITE_DELEGATION`: requires `TABLE_FULL_METADATA` + `TABLE_WRITE_DATA` The implementation is inspired by the `loadTable` endpoint; the authorization checks are very similar.
1bb1e0c to
9dbdebd
Compare
This PR introduces support for access delegation in the
registerTableendpoint.Four new authorizable operations are introduced:
REGISTER_TABLE_WITH_READ_DELEGATION: requiresTABLE_CREATE+TABLE_READ_DATAREGISTER_TABLE_WITH_WRITE_DELEGATION: requiresTABLE_CREATE+TABLE_WRITE_DATAREGISTER_TABLE_OVERWRITE_WITH_READ_DELEGATION: requiresTABLE_FULL_METADATA+TABLE_READ_DATAREGISTER_TABLE_OVERWRITE_WITH_WRITE_DELEGATION: requiresTABLE_FULL_METADATA+TABLE_WRITE_DATAThe implementation is inspired by the
loadTableendpoint; the authorization checks are very similar.Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)