Commit 19f98fa
fix(tests): make plugin-auth's rate-limit isolation radius visible to the gate and hashed by turbo (#10161)
`rate-limit-storage-isolation.test.ts` reads `packages/runtime/src` and
`packages/services/service-sms/src` to check that neither consumer reaches the
fixed-window counter through the package ROOT — the #6040 invariant whose
breach silently reinstates the whole better-auth load. It derived its roots
with a `findUp` walk from `process.cwd()`, which `check:cross-package-test-inputs`
does not resolve (`process.cwd` appears nowhere in that detector), so the read
produced no flag, no declaration, and no turbo input.
Measured on the parent commit: `--list-escapes` named only
`managed-extension-fields.test.ts` for plugin-auth, and
`@objectstack/plugin-auth#test` hashed to `1bf3935543ab055b` both before and
after a change under `packages/runtime/src`. Reinstating the root import in
`packages/runtime/src/security/inbound-rate-limit.ts` — the exact regression this
test guards — replayed `cache hit, replaying logs` / `>>> FULL TURBO` in 135ms,
exit 0, while a direct vitest run on the same tree was RED. That is #7802's
shape, on the gate that exists to prevent it.
Three changes:
- Reseed the test from `__dirname` (TS1470-free under this CJS-typed package's
`module: NodeNext`, and a spelling the detector resolves), following the
rationale `managed-extension-fields.test.ts` and
`platform-objects/src/managed-api-method-affordance-sweep.test.ts` already
state for their sibling walks.
- Bind each consumer root by NAME and hand it to `readdirSync` by that name.
The gate rosters a DIRECTORY only when a directory-read consumes an
expression it can resolve; `join(REPO, root)` over an array element yields no
name, so the globs would have been declared but UNHELD.
- Declare the radius in CROSS_PACKAGE_TEST_INPUTS and mirror it into
`turbo.json`'s `@objectstack/plugin-auth#test` inputs.
`managed-extension-fields.test.ts` is deliberately NOT touched: it is the only
other escaping read the gate sees in this package and it alone holds the
`packages/**/*.object.ts` radius.
Part of #10029
Claude-Session: https://claude.ai/code/session_01PnJHU45vPJj5UQrxe946Bx
Co-authored-by: Claude <noreply@anthropic.com>1 parent 89f3654 commit 19f98fa
3 files changed
Lines changed: 98 additions & 33 deletions
File tree
- packages/plugins/plugin-auth/src
- scripts
Lines changed: 65 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 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 | + | |
51 | 72 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
68 | 77 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 78 | + | |
73 | 79 | | |
74 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
75 | 90 | | |
76 | 91 | | |
77 | 92 | | |
| |||
280 | 295 | | |
281 | 296 | | |
282 | 297 | | |
283 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
284 | 316 | | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
289 | 323 | | |
290 | 324 | | |
291 | 325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
300 | 326 | | |
301 | 327 | | |
302 | 328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
| |||
0 commit comments