Commit ca9e8dc
Task LAV-2305: Policy attachment: ALTER ACCOUNT/USER SET/UNSET policy, the connector table, the drop guard and POLICY_REFERENCES (#2750)
* Task LAV-2305: Policy attachment via one connector table
Attach PASSWORD/SESSION/AUTHENTICATION policies to USER and ACCOUNT
entities through the `policy_attachments` connector table (ADR 093),
visible via POLICY_REFERENCES from both argument forms and undroppable
while attached.
- `policy_attachments` connector table + partial unique index enforcing
one policy of a kind per entity; duplicate attach → verbatim 003549.
- `__snowflake$attach_policy` / `detach_policy` / `policy_attachment_guard`
and the account-scoped attach/detach UDFs; DROP and CREATE OR REPLACE of
an attached policy → verbatim 003531.
- ALTER USER / ALTER ACCOUNT SET/UNSET <kind> POLICY grammar + rewriter;
the `<kind>_POLICY = <p>` property spelling is rejected (001420).
- Entity- and policy-side cascades: user rename/drop update or remove
rows; policy rename cascades to live attachments.
- POLICY_REFERENCES gains a connector branch per argument form; the account
entity is named by CURRENT_ACCOUNT(); a by-entity USER lookup on a missing
user raises 002003 unpositioned.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Task LAV-2305: pin combined SET policy+property rejection (001003)
Real Snowflake rejects a policy leg combined with an object property in a
single ALTER USER SET list; SET <kind> POLICY is its own statement form.
Add a snapshot-pinned rejection test; no combined form is accepted.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Apply cargo fmt
---------
Co-authored-by: Wojciech Padło <wojciech.padlo@localstack.cloud>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>1 parent bde9c50 commit ca9e8dc
3 files changed
Lines changed: 79 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15094 | 15094 | | |
15095 | 15095 | | |
15096 | 15096 | | |
| 15097 | + | |
| 15098 | + | |
| 15099 | + | |
| 15100 | + | |
| 15101 | + | |
| 15102 | + | |
| 15103 | + | |
| 15104 | + | |
| 15105 | + | |
| 15106 | + | |
| 15107 | + | |
| 15108 | + | |
15097 | 15109 | | |
15098 | 15110 | | |
15099 | 15111 | | |
15100 | 15112 | | |
15101 | 15113 | | |
| 15114 | + | |
| 15115 | + | |
| 15116 | + | |
| 15117 | + | |
| 15118 | + | |
| 15119 | + | |
| 15120 | + | |
15102 | 15121 | | |
15103 | 15122 | | |
15104 | 15123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12399 | 12399 | | |
12400 | 12400 | | |
12401 | 12401 | | |
| 12402 | + | |
| 12403 | + | |
| 12404 | + | |
| 12405 | + | |
| 12406 | + | |
| 12407 | + | |
| 12408 | + | |
| 12409 | + | |
12402 | 12410 | | |
12403 | 12411 | | |
12404 | 12412 | | |
| |||
12421 | 12429 | | |
12422 | 12430 | | |
12423 | 12431 | | |
| 12432 | + | |
| 12433 | + | |
| 12434 | + | |
| 12435 | + | |
| 12436 | + | |
| 12437 | + | |
| 12438 | + | |
| 12439 | + | |
| 12440 | + | |
| 12441 | + | |
| 12442 | + | |
| 12443 | + | |
| 12444 | + | |
| 12445 | + | |
| 12446 | + | |
| 12447 | + | |
12424 | 12448 | | |
12425 | 12449 | | |
12426 | 12450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7915 | 7915 | | |
7916 | 7916 | | |
7917 | 7917 | | |
| 7918 | + | |
| 7919 | + | |
| 7920 | + | |
| 7921 | + | |
| 7922 | + | |
| 7923 | + | |
| 7924 | + | |
| 7925 | + | |
| 7926 | + | |
| 7927 | + | |
| 7928 | + | |
| 7929 | + | |
| 7930 | + | |
| 7931 | + | |
| 7932 | + | |
| 7933 | + | |
| 7934 | + | |
| 7935 | + | |
| 7936 | + | |
| 7937 | + | |
| 7938 | + | |
| 7939 | + | |
| 7940 | + | |
| 7941 | + | |
| 7942 | + | |
| 7943 | + | |
| 7944 | + | |
| 7945 | + | |
| 7946 | + | |
| 7947 | + | |
| 7948 | + | |
| 7949 | + | |
| 7950 | + | |
| 7951 | + | |
| 7952 | + | |
| 7953 | + | |
7918 | 7954 | | |
7919 | 7955 | | |
7920 | 7956 | | |
| |||
0 commit comments