Repository navigation
Commit 470746a
fix(security): resolve current_user.accessible_org_ids into the RLS variable bag (#17200)
* test(security): pin `current_user.accessible_org_ids` plumbing end to end (#16518)
The measurement first, red, before any source change. Same rig, same caller
context, same rows, same driver — differing only in which key the predicate
names:
employer_org IN (current_user.my_org_ids) 4 of 6 rows PASS
employer_org IN (current_user.accessible_org_ids) 0 of 6 rows FAIL
So an app CAN rename around the defect, and the documented spelling is the one
that does not work. The second line is also this file's positive control:
without it the first would read the same on a tree where nothing was broken.
13 failed | 18 passed. The 18 are the cells that must not move — the
fail-closed paths, #16119's non-existent-variable face, and the pre-existing
`current_user.*` variables.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zTkyNHJ7TkuN2oXtP5x37
* fix(security): resolve `current_user.accessible_org_ids` into the RLS variable bag (#16518)
`RLSUserContext` named `id`, `organization_id`, `positions`, `org_user_ids` and
`email`, and nothing copied `accessible_org_ids` out of `ExecutionContext` —
while `packages/spec` declared the key's SHAPE, named CORE as its resolver, and
refused an app from supplying it. A slot with a declared shape and no filler.
Route 1, following `org_user_ids`' precedent exactly: both are core-resolved
membership sets the runtime pre-resolves so this compiler never issues a
subquery. The producer already existed and is unconditional —
`resolve-authz-context.ts` types the set as required and
`assemble-execution-context.ts:343` copies it in every posture ("in `single`
posture the set is resolved but no wall consumes it"). Only the consuming line
was missing.
31 of 31 green, from 13 failed | 18 passed on the same file one commit ago. The
18 did not move: the fail-closed paths, #16119's non-existent-variable face, and
every pre-existing `current_user.*` variable.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zTkyNHJ7TkuN2oXtP5x37
* chore(changeset): patch @objectstack/plugin-security for #16518
A bug fix in a released package takes a `patch` (AGENTS.md). No API signature
change, no exported symbol added, no spec or ADR edit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zTkyNHJ7TkuN2oXtP5x37
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 5a95b0e commit 470746a
3 files changed
Lines changed: 531 additions & 0 deletions
File tree
- .changeset
- packages/plugins/plugin-security/src
Lines changed: 78 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
0 commit comments