You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 46c6293
Browse filesBrowse the repository at this point in the historyBrowse files
direct: Fully revoke grant privileges ALL_PRIVILEGES does not imply (#6743)
## Changes
- `direct`: route all grant-revocation paths in `buildGrantChanges`
through `grantRemovals`. When `ALL_PRIVILEGES` stays granted, keep it
out of `Remove` and revoke only the no-longer-wanted excluded privileges
(as #6733 already did); otherwise remove `ALL_PRIVILEGES` (clearing
everything it implies) plus the excluded privileges (`MANAGE`,
`READ_METADATA`, `EXTERNAL_USE_SCHEMA`, `EXTERNAL_USE_LOCATION`) by
name.
- `testserver`: model `Remove: [ALL_PRIVILEGES]` the way the real
backend does — it clears implied privileges but leaves the four excluded
ones — instead of wiping the principal.
- New acceptance test `grants/schemas/remove_principal_manage`.
## Why
Follow-up to #6733. Revoking a principal (or downgrading it off
`ALL_PRIVILEGES`) sent `Remove: [ALL_PRIVILEGES]`, which the backend
does not apply to the privileges `ALL_PRIVILEGES` excludes. Those
lingered, so the principal never went away and every plan/deploy
reported a change — a perpetual update. The fake server's full-wipe
model hid this; fixing it surfaced the bug. It is pre-existing (a
principal granted only `[MANAGE]` reproduces it), and #6733 made it more
reachable by letting `MANAGE` land alongside `ALL_PRIVILEGES`.
## Tests
`remove_principal_manage` (direct engine, local + cloud) plus
`buildGrantChanges` unit cases. Verified on aws-cli: reproduced the
perpetual update before the fix and confirmed convergence after.
Terraform is excluded because it sends a precise `Remove: [MANAGE]` and
already converges.
This pull request and its description were written by Isaac.
---------
Co-authored-by: Isaac <[email protected]>
* Fixed the direct engine dropping `MANAGE`, `READ_METADATA`, `EXTERNAL_USE_SCHEMA` and `EXTERNAL_USE_LOCATION` grants when they were combined with `ALL_PRIVILEGES`. ([#6733](https://github.com/databricks/cli/pull/6733))
1
+
* Fixed the direct engine mishandling UC grants that combine `ALL_PRIVILEGES` with a privilege it does not imply (`MANAGE`, `READ_METADATA`, `EXTERNAL_USE_SCHEMA`, `EXTERNAL_USE_LOCATION`): such privileges were dropped when granted and left behind when revoked, so the deployment never converged. ([#6733](https://github.com/databricks/cli/pull/6733), [#6743](https://github.com/databricks/cli/pull/6743))
Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
23
+
24
+
>>> errcode [CLI] bundle destroy --auto-approve
25
+
The following resources will be deleted:
26
+
delete resources.schemas.grants_schema
27
+
28
+
This action will result in the deletion of the following UC schemas. Any underlying data may be lost:
29
+
delete resources.schemas.grants_schema
30
+
31
+
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/schema-grants-remove-principal-manage-[UNIQUE_NAME]/default
0 commit comments