Commit dee412b
test(plugin-auth): register sys_position / sys_user_position in the sso-register harness (#16305)
`bootEngine()` in `sso-register-platform-admin-gate.test.ts` registered the auth
identity objects plus hand-declared `sys_permission_set` and
`sys_user_permission_set`, but never the position pair the platform-admin
standing resolver also reads.
`resolveAuthzContext` reads `sys_user_position` on every resolution, and
`sys_position` whenever the principal holds any position — always, since every
authenticated member implicitly holds the ADR-0090 D5 `everyone` anchor. With no
such tables, both reads were refused by the driver and `tryFind`'s loud-failure
arm logged them, while the resolver went on treating each refusal as "this
principal holds no positions". The suite reported `Tests 4 passed (4)` over
eight `[sql-driver] DATABASE_ERROR ... no such table` lines, four per table, and
no assertion could notice.
That is a latent false green on a security-adjacent resolver: a change making
platform-admin standing genuinely depend on a position row would have been
measured against an engine that can never return one, and this file would have
stayed green. Same shape #14756 exists to remove — a harness whose registered
object set is narrower than the code path it drives.
Registers both objects the way the file already hand-declares the permission-set
pair, with only the columns the judge reads: `active` (the ADR-0049 predicate
`isRowActive` applies in §6a) and `organization_id` (what the driver's
`applyTenantScope` filters the organization-scoped `sys_position` read on, and
what §4 tests to place a `sys_user_position` row).
Claude-Session: https://claude.ai/code/session_01XpTx2tbq3pZRYAdoGt6E6Y
Co-authored-by: Claude <noreply@anthropic.com>1 parent ac6213e commit dee412b
1 file changed
Lines changed: 62 additions & 6 deletions
Lines changed: 62 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 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 | + | |
55 | 76 | | |
56 | 77 | | |
57 | 78 | | |
| |||
98 | 119 | | |
99 | 120 | | |
100 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
101 | 155 | | |
102 | 156 | | |
103 | 157 | | |
| |||
127 | 181 | | |
128 | 182 | | |
129 | 183 | | |
| 184 | + | |
| 185 | + | |
130 | 186 | | |
131 | 187 | | |
132 | 188 | | |
| |||
0 commit comments