Repository navigation
[Server] Require schema creation permission for model rename - #2018
Conversation
037dbfc to
6ebe9e2
Compare
6ab256d to
49d68ec
Compare
## 🥞 Stacked PR Use this [link](https://github.com/unitycatalog/unitycatalog/pull/2023/files) to review incremental changes. - [**feat/strict-privilege-checks**](#2023) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2023/files)] ← _this PR_ - [fix/iceberg-credential-authorization](#2015) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2015/files/d63e70154a6f21c4d23d596491c779b66a250367..1e627b250bb34d8df390f050d8307fd5442dddc6)] - [fix/model-rename-permissions](#2018) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2018/files/d63e70154a6f21c4d23d596491c779b66a250367..49d68ec662b2f29c588c8f5d67ec74cfc3fe017f)] - [fix/permission-grant-validation](#2014) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2014/files/d63e70154a6f21c4d23d596491c779b66a250367..c6a5d3bf21127e62fc81b2b291ea54bb56463b55)] - [fix/table-details-permissions](#2016) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2016/files/d63e70154a6f21c4d23d596491c779b66a250367..6c897e034918a99ea3a2c4bdbeac64905c8f9d93)] - [fix/volume-rename-permissions](#2017) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2017/files/d63e70154a6f21c4d23d596491c779b66a250367..0ad5aee5216d2ed8085e969c287cc7dee7cdfa98)] --------- **PR Checklist** - [x] A description of the changes is added to the description of this PR. - [x] If there is a related issue, make sure it is linked to this PR. - [x] If you've fixed a bug or added code that should be tested, add tests! - [x] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** Add `server.authorization.strict-privilege-checks`, which defaults to `true`. The following permission fixes use this setting so deployments can keep the previous rules temporarily while updating their applications and grants. Setting it to `false` retains the previous behavior, including access that the corrected checks would deny. This PR adds the validated setting and passes it to authorization expressions as the trusted `#strict_privilege_checks` variable. Request values cannot change it. The setting also reaches response filtering through the shared evaluator. This base PR does not change permission decisions. Use the same value on every server instance and restart each instance after changing it. The fallback conditions and the setting can be deleted after the migration. Tests passed with JDK 17: ```sh build/sbt javafmtAll "server/testOnly io.unitycatalog.server.utils.ServerPropertiesTest io.unitycatalog.server.UnityCatalogServerTest" build/sbt "server/testOnly io.unitycatalog.server.auth.decorator.UnityAccessEvaluatorTest" ``` 33 tests passed. Combined validation with all five dependent fixes: `build/sbt -J-Xmx2G javafmtAll "server/test"`: 923 tests passed. Signed-off-by: Timothy Wang <[email protected]>
4fb0fcd to
ccfd8fb
Compare
|
/review |
ccfd8fb to
801cd02
Compare
|
/review |
801cd02 to
d34d9d9
Compare
|
/review |
1 similar comment
|
/review |
| */ | ||
| public class SdkModelAccessControlCRUDTest extends SdkAccessControlBaseCRUDTest { | ||
|
|
||
| @ParameterizedTest |
There was a problem hiding this comment.
[AI Assisted] Can we switch this to a plain @Test with a helper and loops, the same way testVolumeRenamePermissions ended up in #2017? The expected outcomes follow the same rules as volumes, plus one more loop over CREATE_MODEL / CREATE_FUNCTION. It's easier to read than positional CSV rows, and it covers combinations these rows skip, e.g. a catalog owner with USE SCHEMA but no create grant (the case that shows catalog owners also need the create grant), or a catalog owner with a catalog-level create grant. The legacy test can stay as CSV, like SdkVolumeRenameLegacyAccessControlTest.
There was a problem hiding this comment.
done, switched to loops like #2017. this also covers the missing catalog owner cases.
| - Table metadata: `MODIFY` no longer substitutes for `SELECT` for table details, listings, | ||
| and existence checks across the UC REST, Delta, and Iceberg REST APIs. Existing usage and | ||
| ownership rules still apply. | ||
| - Model rename: Requests with `new_name` must pass the existing update checks. The caller |
There was a problem hiding this comment.
[AI Assisted] nit: "on it" reads as if the create grant has to be on the schema, but a catalog-level grant also works (the tests cover that), and "Catalog ownership does not replace these schema permissions" can be read as catalog grants not counting. Could this match the volume bullet, e.g. "Model rename: Also require permission to create models in the containing schema."?
There was a problem hiding this comment.
yep, shortened it to match the volume bullet.
Signed-off-by: Timothy Wang <[email protected]>
Signed-off-by: Timothy Wang <[email protected]>
Signed-off-by: Timothy Wang <[email protected]>
ca3b027 to
0db1527
Compare
|
/review |
PR Checklist
docsis updatedDescription of changes
Require permission to create models in the containing schema before renaming a model. Check any request with
new_name, including the current name. Comment-only updates keep the existing checks.server.authorization.strict-privilege-checks=falsekeeps the old behavior.Tests: 22 focused tests and formatting passed.