fix(catalog): Fix authorize generic table drop against the table over namespace#4758
Closed
ArnavBalyan wants to merge 1 commit into
Closed
fix(catalog): Fix authorize generic table drop against the table over namespace#4758ArnavBalyan wants to merge 1 commit into
ArnavBalyan wants to merge 1 commit into
Conversation
Member
Author
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates generic table drop authorization to allow table-scoped grants and adds a regression test ensuring a table-level TABLE_DROP privilege permits dropping a generic table.
Changes:
- Switch
dropGenericTableauthorization from a namespace-scoped check to a basic table-like (table-scoped) authorization check. - Add a unit test validating that a table-scoped
TABLE_DROPgrant allows dropping a generic table.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| runtime/service/src/main/java/org/apache/polaris/service/catalog/generic/GenericTableCatalogHandler.java | Adjusts authorization call for dropping generic tables to support table-scoped grants. |
| runtime/service/src/test/java/org/apache/polaris/service/catalog/generic/PolarisGenericTableCatalogHandlerAuthzTest.java | Adds a regression test for table-scoped TABLE_DROP behavior on generic table drops. |
Comment on lines
+131
to
+138
| @Test | ||
| void dropGenericTableHonorsTableScopedGrant() { | ||
| assertSuccess( | ||
| adminService.grantPrivilegeOnTableToRole( | ||
| CATALOG_NAME, CATALOG_ROLE1, TABLE_NS1_1_GENERIC, PolarisPrivilege.TABLE_DROP)); | ||
|
|
||
| newWrapper(Set.of(PRINCIPAL_ROLE1)).dropGenericTable(TABLE_NS1_1_GENERIC); | ||
| } |
Comment on lines
+133
to
+135
| assertSuccess( | ||
| adminService.grantPrivilegeOnTableToRole( | ||
| CATALOG_NAME, CATALOG_ROLE1, TABLE_NS1_1_GENERIC, PolarisPrivilege.TABLE_DROP)); |
Member
Author
Looks like they are fixing the same issue, I'm not sure which one was raised sooner |
Contributor
|
Since #4779 already has some approvals, I propose to go with that PR. @ArnavBalyan : Appreciate your contribution, in any case! |
Member
Author
|
Thanks of course :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)