@spacefast/common 0.0.21 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/dist/agents/connect-targets.d.ts +9 -6
  2. package/dist/agents/connect-targets.js +9 -6
  3. package/dist/config/domains.d.ts +1 -1
  4. package/dist/config/domains.js +1 -0
  5. package/dist/config/index.d.ts +0 -1
  6. package/dist/config/index.js +0 -1
  7. package/dist/contracts/abuse.d.ts +2 -0
  8. package/dist/contracts/abuse.js +12 -0
  9. package/dist/contracts/access.d.ts +121 -9
  10. package/dist/contracts/access.js +73 -9
  11. package/dist/contracts/activity.d.ts +1 -1
  12. package/dist/contracts/activity.js +0 -9
  13. package/dist/contracts/api-keys.d.ts +21 -21
  14. package/dist/contracts/beta.js +1 -1
  15. package/dist/contracts/billing.d.ts +1 -34
  16. package/dist/contracts/billing.js +4 -53
  17. package/dist/contracts/builds.d.ts +8 -8
  18. package/dist/contracts/builds.js +10 -3
  19. package/dist/contracts/cli.d.ts +10 -0
  20. package/dist/contracts/cli.js +10 -0
  21. package/dist/contracts/collab-public.d.ts +63 -0
  22. package/dist/contracts/collab-public.js +46 -0
  23. package/dist/contracts/comments.d.ts +283 -54
  24. package/dist/contracts/comments.js +173 -52
  25. package/dist/contracts/common.d.ts +3 -3
  26. package/dist/contracts/device-auth.d.ts +6 -6
  27. package/dist/contracts/device-auth.js +1 -1
  28. package/dist/contracts/docs.d.ts +5 -5
  29. package/dist/contracts/domains.d.ts +36 -36
  30. package/dist/contracts/enums.d.ts +33 -30
  31. package/dist/contracts/enums.js +52 -38
  32. package/dist/contracts/error-code-meta.d.ts +37 -126
  33. package/dist/contracts/error-code-meta.js +12 -41
  34. package/dist/contracts/error-codes.d.ts +1 -1
  35. package/dist/contracts/error-codes.js +10 -32
  36. package/dist/contracts/execution.d.ts +35 -57
  37. package/dist/contracts/execution.js +41 -40
  38. package/dist/contracts/feature-lifecycle-core.d.ts +0 -6
  39. package/dist/contracts/feature-lifecycle-core.js +2 -31
  40. package/dist/contracts/feature-lifecycle.d.ts +8 -38
  41. package/dist/contracts/feature-lifecycle.js +16 -48
  42. package/dist/contracts/features.d.ts +15 -13
  43. package/dist/contracts/features.js +39 -38
  44. package/dist/contracts/functions.d.ts +97 -70
  45. package/dist/contracts/functions.js +101 -34
  46. package/dist/contracts/git.d.ts +1 -1
  47. package/dist/contracts/grants.d.ts +7 -3
  48. package/dist/contracts/grants.js +18 -9
  49. package/dist/contracts/internal.d.ts +14 -1
  50. package/dist/contracts/internal.js +17 -7
  51. package/dist/contracts/oauth-resources.d.ts +4 -3
  52. package/dist/contracts/oauth-resources.js +12 -3
  53. package/dist/contracts/operations.d.ts +90 -5
  54. package/dist/contracts/operations.js +75 -1
  55. package/dist/contracts/pages.d.ts +6 -1
  56. package/dist/contracts/pages.js +24 -1
  57. package/dist/contracts/plan-policy.d.ts +1 -3
  58. package/dist/contracts/plan-policy.js +1 -2
  59. package/dist/contracts/platform.d.ts +61 -148
  60. package/dist/contracts/platform.js +70 -126
  61. package/dist/contracts/publish-archive.d.ts +498 -0
  62. package/dist/contracts/publish-archive.js +25 -0
  63. package/dist/contracts/resources.d.ts +12 -24
  64. package/dist/contracts/resources.js +32 -12
  65. package/dist/contracts/runtime-api.d.ts +369 -175
  66. package/dist/contracts/runtime-api.js +372 -348
  67. package/dist/contracts/runtime-app.d.ts +127 -120
  68. package/dist/contracts/runtime-app.js +19 -10
  69. package/dist/contracts/runtime-db.d.ts +1 -1
  70. package/dist/contracts/runtime-services.d.ts +219 -0
  71. package/dist/contracts/runtime-services.js +437 -0
  72. package/dist/contracts/runtime-storage.d.ts +45 -32
  73. package/dist/contracts/runtime-storage.js +30 -8
  74. package/dist/contracts/space-config.d.ts +10 -16
  75. package/dist/contracts/space-config.js +14 -10
  76. package/dist/contracts/spaces.d.ts +241 -436
  77. package/dist/contracts/spaces.js +128 -145
  78. package/dist/contracts/superadmin-activity.d.ts +57 -4
  79. package/dist/contracts/superadmin-activity.js +48 -2
  80. package/dist/contracts/superadmin-search.d.ts +126 -0
  81. package/dist/contracts/superadmin-search.js +61 -0
  82. package/dist/contracts/superadmin-spaces.d.ts +358 -89
  83. package/dist/contracts/superadmin-spaces.js +97 -24
  84. package/dist/contracts/superadmin-teams.d.ts +28 -10
  85. package/dist/contracts/superadmin-teams.js +5 -8
  86. package/dist/contracts/superadmin.d.ts +0 -32
  87. package/dist/contracts/superadmin.js +3 -11
  88. package/dist/contracts/tags.d.ts +9 -9
  89. package/dist/contracts/teams.d.ts +44 -2
  90. package/dist/contracts/teams.js +43 -23
  91. package/dist/contracts/transfers.d.ts +0 -49
  92. package/dist/contracts/transfers.js +2 -6
  93. package/dist/contracts/usage.d.ts +61 -0
  94. package/dist/contracts/usage.js +64 -0
  95. package/dist/contracts/variables.d.ts +2 -7
  96. package/dist/contracts/variables.js +6 -5
  97. package/dist/contracts/webhooks.d.ts +2 -2
  98. package/dist/contracts/zero.d.ts +87 -56
  99. package/dist/contracts/zero.js +82 -20
  100. package/dist/dashboard-paths/index.d.ts +1 -1
  101. package/dist/dashboard-paths/index.js +1 -0
  102. package/dist/docs/agent-prose.d.ts +1 -1
  103. package/dist/docs/agent-prose.js +62 -66
  104. package/dist/docs/agent-setup.js +49 -23
  105. package/dist/docs/agent-solutions.d.ts +4 -4
  106. package/dist/docs/agent-solutions.js +8 -8
  107. package/dist/docs/catalog.d.ts +19 -19
  108. package/dist/docs/catalog.js +30 -19
  109. package/dist/docs/error-docs.js +63 -151
  110. package/dist/docs/skills.d.ts +3 -3
  111. package/dist/docs/skills.js +1 -1
  112. package/dist/test-helpers/fetch-stub.d.ts +16 -0
  113. package/dist/test-helpers/fetch-stub.js +24 -0
  114. package/dist/utils/build-settings.js +9 -3
  115. package/dist/utils/canonical-json.d.ts +10 -0
  116. package/dist/utils/canonical-json.js +21 -0
  117. package/dist/utils/cast-transport.d.ts +28 -0
  118. package/dist/utils/cast-transport.js +52 -0
  119. package/dist/utils/claim-token.d.ts +0 -8
  120. package/dist/utils/claim-token.js +3 -15
  121. package/dist/utils/credential-policy.d.ts +1 -1
  122. package/dist/utils/env-file.d.ts +17 -0
  123. package/dist/utils/env-file.js +96 -0
  124. package/dist/utils/error-code.d.ts +2 -0
  125. package/dist/utils/error-code.js +7 -0
  126. package/dist/utils/generate-space-name.d.ts +8 -10
  127. package/dist/utils/generate-space-name.js +206 -21
  128. package/dist/utils/grant-decision.fixtures.json +2938 -0
  129. package/dist/utils/grants.d.ts +2 -0
  130. package/dist/utils/grants.js +25 -2
  131. package/dist/utils/gravatar.d.ts +9 -0
  132. package/dist/utils/gravatar.js +31 -0
  133. package/dist/utils/idempotency.d.ts +6 -0
  134. package/dist/utils/idempotency.js +28 -0
  135. package/dist/utils/local-space-state.d.ts +1 -5
  136. package/dist/utils/local-space-state.js +7 -26
  137. package/dist/utils/page-fonts.d.ts +2 -2
  138. package/dist/utils/page-fonts.js +22 -4
  139. package/dist/utils/pages.d.ts +1 -2
  140. package/dist/utils/pages.js +21 -5
  141. package/dist/utils/publish-form-data.d.ts +12 -0
  142. package/dist/utils/publish-form-data.js +10 -0
  143. package/dist/utils/publish-policy.d.ts +20 -0
  144. package/dist/utils/publish-policy.fixtures.json +397 -0
  145. package/dist/utils/publish-policy.js +36 -19
  146. package/dist/utils/push-new.d.ts +7 -0
  147. package/dist/utils/push-new.js +7 -0
  148. package/dist/utils/query-keys.d.ts +0 -1
  149. package/dist/utils/query-keys.js +0 -1
  150. package/dist/utils/runtime-paths.d.ts +5 -0
  151. package/dist/utils/runtime-paths.js +5 -0
  152. package/dist/utils/runtime-upload-batch.d.ts +0 -5
  153. package/dist/utils/runtime-upload-batch.js +1 -27
  154. package/dist/utils/runtime-upload.d.ts +3 -13
  155. package/dist/utils/runtime-upload.js +4 -14
  156. package/dist/utils/space-config.d.ts +0 -33
  157. package/dist/utils/space-config.js +5 -326
  158. package/dist/utils/storage-policy.d.ts +1 -1
  159. package/dist/utils/storage-policy.js +3 -1
  160. package/dist/utils/structured-error.d.ts +14 -0
  161. package/dist/utils/structured-error.js +22 -0
  162. package/dist/utils/version-path.js +12 -3
  163. package/dist/vocabulary.d.ts +5 -3
  164. package/dist/vocabulary.js +13 -10
  165. package/package.json +10 -5
  166. package/dist/config/postgres-budget.d.ts +0 -129
  167. package/dist/config/postgres-budget.js +0 -140
  168. package/dist/config/postgres-budget.json +0 -51
  169. package/dist/contracts/archives.d.ts +0 -331
  170. package/dist/contracts/archives.js +0 -120
  171. package/dist/contracts/deployments.d.ts +0 -574
  172. package/dist/contracts/deployments.js +0 -97
  173. package/dist/contracts/sites.d.ts +0 -416
  174. package/dist/contracts/sites.js +0 -168
  175. package/dist/contracts/superadmin-queues.d.ts +0 -414
  176. package/dist/contracts/superadmin-queues.js +0 -202
  177. package/dist/contracts/superadmin-runtime.d.ts +0 -27
  178. package/dist/contracts/superadmin-runtime.js +0 -38
  179. package/dist/index.d.ts +0 -1
  180. package/dist/index.js +0 -1
  181. package/dist/utils/api.d.ts +0 -4
  182. package/dist/utils/api.js +0 -13
@@ -0,0 +1,2938 @@
1
+ {
2
+ "comment": "Generated grant-decision conformance corpus. Two evaluators answer every case: packages/common/src/utils/grants.ts (evaluateGrants, the reference) and runtime/engine/runtime/access-rules.php (_stattic_grant_decision, the serving engine). Regenerate with `bun run generate:grant-fixtures` in packages/common; packages/common/src/utils/grants.test.ts fails on a stale file and runtime/tests/unit.php replays every case through the PHP engine. matchedGrantIds pins which Grant fired, so a right verdict from the wrong rule still fails. Beyond this corpus, `bun run fuzz:grants` (packages/common, opt-in) diffs the two evaluators over seeded random Grant/request pairs.",
3
+ "generator": "packages/common/scripts/generate-grant-decision-fixtures.ts",
4
+ "now": "2026-08-09T12:00:00.000Z",
5
+ "cases": [
6
+ {
7
+ "name": "zero grants admit nobody",
8
+ "category": "structural",
9
+ "spaceClaimed": true,
10
+ "grants": [],
11
+ "request": {
12
+ "resource": "/",
13
+ "resourceKind": "route",
14
+ "target": {
15
+ "kind": "live"
16
+ },
17
+ "principal": {}
18
+ },
19
+ "expected": {
20
+ "capabilities": [],
21
+ "matchedGrantIds": []
22
+ },
23
+ "phpProjectionCompiles": true
24
+ },
25
+ {
26
+ "name": "an unclaimed Space keeps its config Grants closed",
27
+ "category": "source",
28
+ "spaceClaimed": false,
29
+ "grants": [
30
+ {
31
+ "audience": {
32
+ "kind": "public"
33
+ },
34
+ "resources": {
35
+ "include": ["/**"],
36
+ "exclude": []
37
+ },
38
+ "capabilities": ["page.view"],
39
+ "constraints": {},
40
+ "target": {
41
+ "kind": "live"
42
+ },
43
+ "id": "grt_config_public",
44
+ "source": {
45
+ "kind": "config",
46
+ "reference": "sf.jsonc#$.access.public"
47
+ }
48
+ }
49
+ ],
50
+ "request": {
51
+ "resource": "/",
52
+ "resourceKind": "route",
53
+ "target": {
54
+ "kind": "live"
55
+ },
56
+ "principal": {}
57
+ },
58
+ "expected": {
59
+ "capabilities": [],
60
+ "matchedGrantIds": []
61
+ },
62
+ "phpProjectionCompiles": true
63
+ },
64
+ {
65
+ "name": "a claimed Space honours the same config Grant",
66
+ "category": "source",
67
+ "spaceClaimed": true,
68
+ "grants": [
69
+ {
70
+ "audience": {
71
+ "kind": "public"
72
+ },
73
+ "resources": {
74
+ "include": ["/**"],
75
+ "exclude": []
76
+ },
77
+ "capabilities": ["page.view"],
78
+ "constraints": {},
79
+ "target": {
80
+ "kind": "live"
81
+ },
82
+ "id": "grt_config_public",
83
+ "source": {
84
+ "kind": "config",
85
+ "reference": "sf.jsonc#$.access.public"
86
+ }
87
+ }
88
+ ],
89
+ "request": {
90
+ "resource": "/",
91
+ "resourceKind": "route",
92
+ "target": {
93
+ "kind": "live"
94
+ },
95
+ "principal": {}
96
+ },
97
+ "expected": {
98
+ "capabilities": ["page.view"],
99
+ "matchedGrantIds": ["grt_config_public"]
100
+ },
101
+ "phpProjectionCompiles": true
102
+ },
103
+ {
104
+ "name": "an unclaimed Space still honours a system Grant",
105
+ "category": "source",
106
+ "spaceClaimed": false,
107
+ "grants": [
108
+ {
109
+ "audience": {
110
+ "kind": "link",
111
+ "linkId": "lnk_preclaim"
112
+ },
113
+ "resources": {
114
+ "include": ["/**"],
115
+ "exclude": []
116
+ },
117
+ "capabilities": ["page.view"],
118
+ "constraints": {},
119
+ "target": {
120
+ "kind": "live"
121
+ },
122
+ "id": "grt_system_link",
123
+ "source": {
124
+ "kind": "system",
125
+ "reference": "open:preclaim-author"
126
+ }
127
+ }
128
+ ],
129
+ "request": {
130
+ "resource": "/",
131
+ "resourceKind": "route",
132
+ "target": {
133
+ "kind": "live"
134
+ },
135
+ "principal": {
136
+ "linkIds": ["lnk_preclaim"]
137
+ }
138
+ },
139
+ "expected": {
140
+ "capabilities": ["page.view"],
141
+ "matchedGrantIds": ["grt_system_link"]
142
+ },
143
+ "phpProjectionCompiles": true
144
+ },
145
+ {
146
+ "name": "a public view Grant yields page.view",
147
+ "category": "capability",
148
+ "spaceClaimed": true,
149
+ "grants": [
150
+ {
151
+ "audience": {
152
+ "kind": "public"
153
+ },
154
+ "resources": {
155
+ "include": ["/**"],
156
+ "exclude": []
157
+ },
158
+ "capabilities": ["page.view"],
159
+ "constraints": {},
160
+ "target": {
161
+ "kind": "live"
162
+ },
163
+ "id": "grt_public_view",
164
+ "source": {
165
+ "kind": "managed",
166
+ "reference": "conformance"
167
+ }
168
+ }
169
+ ],
170
+ "request": {
171
+ "resource": "/",
172
+ "resourceKind": "route",
173
+ "target": {
174
+ "kind": "live"
175
+ },
176
+ "principal": {}
177
+ },
178
+ "expected": {
179
+ "capabilities": ["page.view"],
180
+ "matchedGrantIds": ["grt_public_view"]
181
+ },
182
+ "phpProjectionCompiles": true
183
+ },
184
+ {
185
+ "name": "a person Grant carries the whole manage capability set",
186
+ "category": "capability",
187
+ "spaceClaimed": true,
188
+ "grants": [
189
+ {
190
+ "audience": {
191
+ "kind": "person",
192
+ "personId": "psn_owner"
193
+ },
194
+ "resources": {
195
+ "include": ["/**"],
196
+ "exclude": []
197
+ },
198
+ "capabilities": [
199
+ "page.view",
200
+ "comments.read",
201
+ "comments.write",
202
+ "content.publish",
203
+ "access.manage"
204
+ ],
205
+ "constraints": {},
206
+ "target": {
207
+ "kind": "live"
208
+ },
209
+ "id": "grt_person_manage",
210
+ "source": {
211
+ "kind": "managed",
212
+ "reference": "conformance"
213
+ }
214
+ }
215
+ ],
216
+ "request": {
217
+ "resource": "/",
218
+ "resourceKind": "route",
219
+ "target": {
220
+ "kind": "live"
221
+ },
222
+ "principal": {
223
+ "personIds": ["psn_owner"]
224
+ }
225
+ },
226
+ "expected": {
227
+ "capabilities": [
228
+ "access.manage",
229
+ "comments.read",
230
+ "comments.write",
231
+ "content.publish",
232
+ "page.view"
233
+ ],
234
+ "matchedGrantIds": ["grt_person_manage"]
235
+ },
236
+ "phpProjectionCompiles": true
237
+ },
238
+ {
239
+ "name": "capabilities union across two matching Grants",
240
+ "category": "capability",
241
+ "spaceClaimed": true,
242
+ "grants": [
243
+ {
244
+ "audience": {
245
+ "kind": "public"
246
+ },
247
+ "resources": {
248
+ "include": ["/**"],
249
+ "exclude": []
250
+ },
251
+ "capabilities": ["page.view"],
252
+ "constraints": {},
253
+ "target": {
254
+ "kind": "live"
255
+ },
256
+ "id": "grt_public_view",
257
+ "source": {
258
+ "kind": "managed",
259
+ "reference": "conformance"
260
+ }
261
+ },
262
+ {
263
+ "audience": {
264
+ "kind": "team",
265
+ "teamId": "tm_conformance"
266
+ },
267
+ "resources": {
268
+ "include": ["/**"],
269
+ "exclude": []
270
+ },
271
+ "capabilities": ["page.view", "comments.read", "comments.write"],
272
+ "constraints": {},
273
+ "target": {
274
+ "kind": "live"
275
+ },
276
+ "id": "grt_team_comment",
277
+ "source": {
278
+ "kind": "managed",
279
+ "reference": "conformance"
280
+ }
281
+ }
282
+ ],
283
+ "request": {
284
+ "resource": "/",
285
+ "resourceKind": "route",
286
+ "target": {
287
+ "kind": "live"
288
+ },
289
+ "principal": {
290
+ "teamIds": ["tm_conformance"]
291
+ }
292
+ },
293
+ "expected": {
294
+ "capabilities": ["comments.read", "comments.write", "page.view"],
295
+ "matchedGrantIds": ["grt_public_view", "grt_team_comment"]
296
+ },
297
+ "phpProjectionCompiles": true
298
+ },
299
+ {
300
+ "name": "root pattern matches the root path",
301
+ "category": "path-glob",
302
+ "spaceClaimed": true,
303
+ "grants": [
304
+ {
305
+ "audience": {
306
+ "kind": "public"
307
+ },
308
+ "resources": {
309
+ "include": ["/"],
310
+ "exclude": []
311
+ },
312
+ "capabilities": ["page.view"],
313
+ "constraints": {},
314
+ "target": {
315
+ "kind": "live"
316
+ },
317
+ "id": "grt_root",
318
+ "source": {
319
+ "kind": "managed",
320
+ "reference": "conformance"
321
+ }
322
+ }
323
+ ],
324
+ "request": {
325
+ "resource": "/",
326
+ "resourceKind": "route",
327
+ "target": {
328
+ "kind": "live"
329
+ },
330
+ "principal": {}
331
+ },
332
+ "expected": {
333
+ "capabilities": ["page.view"],
334
+ "matchedGrantIds": ["grt_root"]
335
+ },
336
+ "phpProjectionCompiles": true
337
+ },
338
+ {
339
+ "name": "root pattern does not reach a child path",
340
+ "category": "path-glob",
341
+ "spaceClaimed": true,
342
+ "grants": [
343
+ {
344
+ "audience": {
345
+ "kind": "public"
346
+ },
347
+ "resources": {
348
+ "include": ["/"],
349
+ "exclude": []
350
+ },
351
+ "capabilities": ["page.view"],
352
+ "constraints": {},
353
+ "target": {
354
+ "kind": "live"
355
+ },
356
+ "id": "grt_root",
357
+ "source": {
358
+ "kind": "managed",
359
+ "reference": "conformance"
360
+ }
361
+ }
362
+ ],
363
+ "request": {
364
+ "resource": "/a",
365
+ "resourceKind": "route",
366
+ "target": {
367
+ "kind": "live"
368
+ },
369
+ "principal": {}
370
+ },
371
+ "expected": {
372
+ "capabilities": [],
373
+ "matchedGrantIds": []
374
+ },
375
+ "phpProjectionCompiles": true
376
+ },
377
+ {
378
+ "name": "a trailing ** reaches an arbitrarily deep path",
379
+ "category": "path-glob",
380
+ "spaceClaimed": true,
381
+ "grants": [
382
+ {
383
+ "audience": {
384
+ "kind": "public"
385
+ },
386
+ "resources": {
387
+ "include": ["/**"],
388
+ "exclude": []
389
+ },
390
+ "capabilities": ["page.view"],
391
+ "constraints": {},
392
+ "target": {
393
+ "kind": "live"
394
+ },
395
+ "id": "grt_public_view",
396
+ "source": {
397
+ "kind": "managed",
398
+ "reference": "conformance"
399
+ }
400
+ }
401
+ ],
402
+ "request": {
403
+ "resource": "/a/b/c/d",
404
+ "resourceKind": "route",
405
+ "target": {
406
+ "kind": "live"
407
+ },
408
+ "principal": {}
409
+ },
410
+ "expected": {
411
+ "capabilities": ["page.view"],
412
+ "matchedGrantIds": ["grt_public_view"]
413
+ },
414
+ "phpProjectionCompiles": true
415
+ },
416
+ {
417
+ "name": "a trailing ** also matches zero segments",
418
+ "category": "path-glob",
419
+ "spaceClaimed": true,
420
+ "grants": [
421
+ {
422
+ "audience": {
423
+ "kind": "public"
424
+ },
425
+ "resources": {
426
+ "include": ["/docs/**"],
427
+ "exclude": []
428
+ },
429
+ "capabilities": ["page.view"],
430
+ "constraints": {},
431
+ "target": {
432
+ "kind": "live"
433
+ },
434
+ "id": "grt_docs_deep",
435
+ "source": {
436
+ "kind": "managed",
437
+ "reference": "conformance"
438
+ }
439
+ }
440
+ ],
441
+ "request": {
442
+ "resource": "/docs",
443
+ "resourceKind": "route",
444
+ "target": {
445
+ "kind": "live"
446
+ },
447
+ "principal": {}
448
+ },
449
+ "expected": {
450
+ "capabilities": ["page.view"],
451
+ "matchedGrantIds": ["grt_docs_deep"]
452
+ },
453
+ "phpProjectionCompiles": true
454
+ },
455
+ {
456
+ "name": "a single * matches exactly one segment",
457
+ "category": "path-glob",
458
+ "spaceClaimed": true,
459
+ "grants": [
460
+ {
461
+ "audience": {
462
+ "kind": "public"
463
+ },
464
+ "resources": {
465
+ "include": ["/docs/*"],
466
+ "exclude": []
467
+ },
468
+ "capabilities": ["page.view"],
469
+ "constraints": {},
470
+ "target": {
471
+ "kind": "live"
472
+ },
473
+ "id": "grt_docs_one",
474
+ "source": {
475
+ "kind": "managed",
476
+ "reference": "conformance"
477
+ }
478
+ }
479
+ ],
480
+ "request": {
481
+ "resource": "/docs/intro",
482
+ "resourceKind": "route",
483
+ "target": {
484
+ "kind": "live"
485
+ },
486
+ "principal": {}
487
+ },
488
+ "expected": {
489
+ "capabilities": ["page.view"],
490
+ "matchedGrantIds": ["grt_docs_one"]
491
+ },
492
+ "phpProjectionCompiles": true
493
+ },
494
+ {
495
+ "name": "a single * does not span two segments",
496
+ "category": "path-glob",
497
+ "spaceClaimed": true,
498
+ "grants": [
499
+ {
500
+ "audience": {
501
+ "kind": "public"
502
+ },
503
+ "resources": {
504
+ "include": ["/docs/*"],
505
+ "exclude": []
506
+ },
507
+ "capabilities": ["page.view"],
508
+ "constraints": {},
509
+ "target": {
510
+ "kind": "live"
511
+ },
512
+ "id": "grt_docs_one",
513
+ "source": {
514
+ "kind": "managed",
515
+ "reference": "conformance"
516
+ }
517
+ }
518
+ ],
519
+ "request": {
520
+ "resource": "/docs/intro/deep",
521
+ "resourceKind": "route",
522
+ "target": {
523
+ "kind": "live"
524
+ },
525
+ "principal": {}
526
+ },
527
+ "expected": {
528
+ "capabilities": [],
529
+ "matchedGrantIds": []
530
+ },
531
+ "phpProjectionCompiles": true
532
+ },
533
+ {
534
+ "name": "a single * requires a segment to be there",
535
+ "category": "path-glob",
536
+ "spaceClaimed": true,
537
+ "grants": [
538
+ {
539
+ "audience": {
540
+ "kind": "public"
541
+ },
542
+ "resources": {
543
+ "include": ["/docs/*"],
544
+ "exclude": []
545
+ },
546
+ "capabilities": ["page.view"],
547
+ "constraints": {},
548
+ "target": {
549
+ "kind": "live"
550
+ },
551
+ "id": "grt_docs_one",
552
+ "source": {
553
+ "kind": "managed",
554
+ "reference": "conformance"
555
+ }
556
+ }
557
+ ],
558
+ "request": {
559
+ "resource": "/docs",
560
+ "resourceKind": "route",
561
+ "target": {
562
+ "kind": "live"
563
+ },
564
+ "principal": {}
565
+ },
566
+ "expected": {
567
+ "capabilities": [],
568
+ "matchedGrantIds": []
569
+ },
570
+ "phpProjectionCompiles": true
571
+ },
572
+ {
573
+ "name": "an interior ** matches zero segments",
574
+ "category": "path-glob",
575
+ "spaceClaimed": true,
576
+ "grants": [
577
+ {
578
+ "audience": {
579
+ "kind": "public"
580
+ },
581
+ "resources": {
582
+ "include": ["/a/**/z"],
583
+ "exclude": []
584
+ },
585
+ "capabilities": ["page.view"],
586
+ "constraints": {},
587
+ "target": {
588
+ "kind": "live"
589
+ },
590
+ "id": "grt_interior",
591
+ "source": {
592
+ "kind": "managed",
593
+ "reference": "conformance"
594
+ }
595
+ }
596
+ ],
597
+ "request": {
598
+ "resource": "/a/z",
599
+ "resourceKind": "route",
600
+ "target": {
601
+ "kind": "live"
602
+ },
603
+ "principal": {}
604
+ },
605
+ "expected": {
606
+ "capabilities": ["page.view"],
607
+ "matchedGrantIds": ["grt_interior"]
608
+ },
609
+ "phpProjectionCompiles": true
610
+ },
611
+ {
612
+ "name": "an interior ** matches many segments",
613
+ "category": "path-glob",
614
+ "spaceClaimed": true,
615
+ "grants": [
616
+ {
617
+ "audience": {
618
+ "kind": "public"
619
+ },
620
+ "resources": {
621
+ "include": ["/a/**/z"],
622
+ "exclude": []
623
+ },
624
+ "capabilities": ["page.view"],
625
+ "constraints": {},
626
+ "target": {
627
+ "kind": "live"
628
+ },
629
+ "id": "grt_interior",
630
+ "source": {
631
+ "kind": "managed",
632
+ "reference": "conformance"
633
+ }
634
+ }
635
+ ],
636
+ "request": {
637
+ "resource": "/a/b/c/z",
638
+ "resourceKind": "route",
639
+ "target": {
640
+ "kind": "live"
641
+ },
642
+ "principal": {}
643
+ },
644
+ "expected": {
645
+ "capabilities": ["page.view"],
646
+ "matchedGrantIds": ["grt_interior"]
647
+ },
648
+ "phpProjectionCompiles": true
649
+ },
650
+ {
651
+ "name": "an interior ** still pins the suffix",
652
+ "category": "path-glob",
653
+ "spaceClaimed": true,
654
+ "grants": [
655
+ {
656
+ "audience": {
657
+ "kind": "public"
658
+ },
659
+ "resources": {
660
+ "include": ["/a/**/z"],
661
+ "exclude": []
662
+ },
663
+ "capabilities": ["page.view"],
664
+ "constraints": {},
665
+ "target": {
666
+ "kind": "live"
667
+ },
668
+ "id": "grt_interior",
669
+ "source": {
670
+ "kind": "managed",
671
+ "reference": "conformance"
672
+ }
673
+ }
674
+ ],
675
+ "request": {
676
+ "resource": "/a/b/c",
677
+ "resourceKind": "route",
678
+ "target": {
679
+ "kind": "live"
680
+ },
681
+ "principal": {}
682
+ },
683
+ "expected": {
684
+ "capabilities": [],
685
+ "matchedGrantIds": []
686
+ },
687
+ "phpProjectionCompiles": true
688
+ },
689
+ {
690
+ "name": "consecutive ** collapse to one",
691
+ "category": "path-glob",
692
+ "spaceClaimed": true,
693
+ "grants": [
694
+ {
695
+ "audience": {
696
+ "kind": "public"
697
+ },
698
+ "resources": {
699
+ "include": ["/a/**/**/z"],
700
+ "exclude": []
701
+ },
702
+ "capabilities": ["page.view"],
703
+ "constraints": {},
704
+ "target": {
705
+ "kind": "live"
706
+ },
707
+ "id": "grt_collapsed",
708
+ "source": {
709
+ "kind": "managed",
710
+ "reference": "conformance"
711
+ }
712
+ }
713
+ ],
714
+ "request": {
715
+ "resource": "/a/b/z",
716
+ "resourceKind": "route",
717
+ "target": {
718
+ "kind": "live"
719
+ },
720
+ "principal": {}
721
+ },
722
+ "expected": {
723
+ "capabilities": ["page.view"],
724
+ "matchedGrantIds": ["grt_collapsed"]
725
+ },
726
+ "phpProjectionCompiles": true
727
+ },
728
+ {
729
+ "name": "a trailing slash canonicalizes away before matching",
730
+ "category": "path-glob",
731
+ "spaceClaimed": true,
732
+ "grants": [
733
+ {
734
+ "audience": {
735
+ "kind": "public"
736
+ },
737
+ "resources": {
738
+ "include": ["/docs"],
739
+ "exclude": []
740
+ },
741
+ "capabilities": ["page.view"],
742
+ "constraints": {},
743
+ "target": {
744
+ "kind": "live"
745
+ },
746
+ "id": "grt_exact_docs",
747
+ "source": {
748
+ "kind": "managed",
749
+ "reference": "conformance"
750
+ }
751
+ }
752
+ ],
753
+ "request": {
754
+ "resource": "/docs/",
755
+ "resourceKind": "route",
756
+ "target": {
757
+ "kind": "live"
758
+ },
759
+ "principal": {}
760
+ },
761
+ "expected": {
762
+ "capabilities": ["page.view"],
763
+ "matchedGrantIds": ["grt_exact_docs"]
764
+ },
765
+ "phpProjectionCompiles": true
766
+ },
767
+ {
768
+ "name": "dot segments canonicalize away before matching",
769
+ "category": "path-glob",
770
+ "spaceClaimed": true,
771
+ "grants": [
772
+ {
773
+ "audience": {
774
+ "kind": "public"
775
+ },
776
+ "resources": {
777
+ "include": ["/docs"],
778
+ "exclude": []
779
+ },
780
+ "capabilities": ["page.view"],
781
+ "constraints": {},
782
+ "target": {
783
+ "kind": "live"
784
+ },
785
+ "id": "grt_exact_docs",
786
+ "source": {
787
+ "kind": "managed",
788
+ "reference": "conformance"
789
+ }
790
+ }
791
+ ],
792
+ "request": {
793
+ "resource": "/docs/./sub/..",
794
+ "resourceKind": "route",
795
+ "target": {
796
+ "kind": "live"
797
+ },
798
+ "principal": {}
799
+ },
800
+ "expected": {
801
+ "capabilities": ["page.view"],
802
+ "matchedGrantIds": ["grt_exact_docs"]
803
+ },
804
+ "phpProjectionCompiles": true
805
+ },
806
+ {
807
+ "name": "the route lane collapses a terminal index.html",
808
+ "category": "path-glob",
809
+ "spaceClaimed": true,
810
+ "grants": [
811
+ {
812
+ "audience": {
813
+ "kind": "public"
814
+ },
815
+ "resources": {
816
+ "include": ["/docs"],
817
+ "exclude": []
818
+ },
819
+ "capabilities": ["page.view"],
820
+ "constraints": {},
821
+ "target": {
822
+ "kind": "live"
823
+ },
824
+ "id": "grt_exact_docs",
825
+ "source": {
826
+ "kind": "managed",
827
+ "reference": "conformance"
828
+ }
829
+ }
830
+ ],
831
+ "request": {
832
+ "resource": "/docs/index.html",
833
+ "resourceKind": "route",
834
+ "target": {
835
+ "kind": "live"
836
+ },
837
+ "principal": {}
838
+ },
839
+ "expected": {
840
+ "capabilities": ["page.view"],
841
+ "matchedGrantIds": ["grt_exact_docs"]
842
+ },
843
+ "phpProjectionCompiles": true
844
+ },
845
+ {
846
+ "name": "the artifact lane keeps a terminal index.html",
847
+ "category": "path-glob",
848
+ "spaceClaimed": true,
849
+ "grants": [
850
+ {
851
+ "audience": {
852
+ "kind": "public"
853
+ },
854
+ "resources": {
855
+ "include": ["/docs"],
856
+ "exclude": []
857
+ },
858
+ "capabilities": ["page.view"],
859
+ "constraints": {},
860
+ "target": {
861
+ "kind": "live"
862
+ },
863
+ "id": "grt_exact_docs",
864
+ "source": {
865
+ "kind": "managed",
866
+ "reference": "conformance"
867
+ }
868
+ }
869
+ ],
870
+ "request": {
871
+ "resource": "/docs/index.html",
872
+ "resourceKind": "artifact",
873
+ "target": {
874
+ "kind": "live"
875
+ },
876
+ "principal": {}
877
+ },
878
+ "expected": {
879
+ "capabilities": [],
880
+ "matchedGrantIds": []
881
+ },
882
+ "phpProjectionCompiles": true
883
+ },
884
+ {
885
+ "name": "an artifact index.html is reachable through a wildcard segment",
886
+ "category": "path-glob",
887
+ "spaceClaimed": true,
888
+ "grants": [
889
+ {
890
+ "audience": {
891
+ "kind": "public"
892
+ },
893
+ "resources": {
894
+ "include": ["/docs/*"],
895
+ "exclude": []
896
+ },
897
+ "capabilities": ["page.view"],
898
+ "constraints": {},
899
+ "target": {
900
+ "kind": "live"
901
+ },
902
+ "id": "grt_docs_one",
903
+ "source": {
904
+ "kind": "managed",
905
+ "reference": "conformance"
906
+ }
907
+ }
908
+ ],
909
+ "request": {
910
+ "resource": "/docs/index.html",
911
+ "resourceKind": "artifact",
912
+ "target": {
913
+ "kind": "live"
914
+ },
915
+ "principal": {}
916
+ },
917
+ "expected": {
918
+ "capabilities": ["page.view"],
919
+ "matchedGrantIds": ["grt_docs_one"]
920
+ },
921
+ "phpProjectionCompiles": true
922
+ },
923
+ {
924
+ "name": "an include naming an index artifact does not grant the route it serves",
925
+ "category": "path-glob",
926
+ "spaceClaimed": true,
927
+ "grants": [
928
+ {
929
+ "audience": {
930
+ "kind": "public"
931
+ },
932
+ "resources": {
933
+ "include": ["/docs/index.html"],
934
+ "exclude": []
935
+ },
936
+ "capabilities": ["page.view"],
937
+ "constraints": {},
938
+ "target": {
939
+ "kind": "live"
940
+ },
941
+ "id": "grt_docs_index",
942
+ "source": {
943
+ "kind": "managed",
944
+ "reference": "conformance"
945
+ }
946
+ }
947
+ ],
948
+ "request": {
949
+ "resource": "/docs",
950
+ "resourceKind": "route",
951
+ "target": {
952
+ "kind": "live"
953
+ },
954
+ "principal": {}
955
+ },
956
+ "expected": {
957
+ "capabilities": [],
958
+ "matchedGrantIds": []
959
+ },
960
+ "phpProjectionCompiles": true
961
+ },
962
+ {
963
+ "name": "an exclude naming an index artifact closes the route it serves",
964
+ "category": "path-glob",
965
+ "spaceClaimed": true,
966
+ "grants": [
967
+ {
968
+ "audience": {
969
+ "kind": "public"
970
+ },
971
+ "resources": {
972
+ "include": ["/**"],
973
+ "exclude": ["/docs/index.html"]
974
+ },
975
+ "capabilities": ["page.view"],
976
+ "constraints": {},
977
+ "target": {
978
+ "kind": "live"
979
+ },
980
+ "id": "grt_broad_minus_index",
981
+ "source": {
982
+ "kind": "managed",
983
+ "reference": "conformance"
984
+ }
985
+ }
986
+ ],
987
+ "request": {
988
+ "resource": "/docs",
989
+ "resourceKind": "route",
990
+ "target": {
991
+ "kind": "live"
992
+ },
993
+ "principal": {}
994
+ },
995
+ "expected": {
996
+ "capabilities": [],
997
+ "matchedGrantIds": []
998
+ },
999
+ "phpProjectionCompiles": true
1000
+ },
1001
+ {
1002
+ "name": "an exclude subtree carves out of a broad include",
1003
+ "category": "path-glob",
1004
+ "spaceClaimed": true,
1005
+ "grants": [
1006
+ {
1007
+ "audience": {
1008
+ "kind": "public"
1009
+ },
1010
+ "resources": {
1011
+ "include": ["/**"],
1012
+ "exclude": ["/private/**"]
1013
+ },
1014
+ "capabilities": ["page.view"],
1015
+ "constraints": {},
1016
+ "target": {
1017
+ "kind": "live"
1018
+ },
1019
+ "id": "grt_broad",
1020
+ "source": {
1021
+ "kind": "managed",
1022
+ "reference": "conformance"
1023
+ }
1024
+ }
1025
+ ],
1026
+ "request": {
1027
+ "resource": "/private/notes",
1028
+ "resourceKind": "route",
1029
+ "target": {
1030
+ "kind": "live"
1031
+ },
1032
+ "principal": {}
1033
+ },
1034
+ "expected": {
1035
+ "capabilities": [],
1036
+ "matchedGrantIds": []
1037
+ },
1038
+ "phpProjectionCompiles": true
1039
+ },
1040
+ {
1041
+ "name": "an exclude subtree leaves the rest of the include intact",
1042
+ "category": "path-glob",
1043
+ "spaceClaimed": true,
1044
+ "grants": [
1045
+ {
1046
+ "audience": {
1047
+ "kind": "public"
1048
+ },
1049
+ "resources": {
1050
+ "include": ["/**"],
1051
+ "exclude": ["/private/**"]
1052
+ },
1053
+ "capabilities": ["page.view"],
1054
+ "constraints": {},
1055
+ "target": {
1056
+ "kind": "live"
1057
+ },
1058
+ "id": "grt_broad",
1059
+ "source": {
1060
+ "kind": "managed",
1061
+ "reference": "conformance"
1062
+ }
1063
+ }
1064
+ ],
1065
+ "request": {
1066
+ "resource": "/public/notes",
1067
+ "resourceKind": "route",
1068
+ "target": {
1069
+ "kind": "live"
1070
+ },
1071
+ "principal": {}
1072
+ },
1073
+ "expected": {
1074
+ "capabilities": ["page.view"],
1075
+ "matchedGrantIds": ["grt_broad"]
1076
+ },
1077
+ "phpProjectionCompiles": true
1078
+ },
1079
+ {
1080
+ "name": "an exact exclude does not extend to children",
1081
+ "category": "path-glob",
1082
+ "spaceClaimed": true,
1083
+ "grants": [
1084
+ {
1085
+ "audience": {
1086
+ "kind": "public"
1087
+ },
1088
+ "resources": {
1089
+ "include": ["/**"],
1090
+ "exclude": ["/secret"]
1091
+ },
1092
+ "capabilities": ["page.view"],
1093
+ "constraints": {},
1094
+ "target": {
1095
+ "kind": "live"
1096
+ },
1097
+ "id": "grt_broad_exact",
1098
+ "source": {
1099
+ "kind": "managed",
1100
+ "reference": "conformance"
1101
+ }
1102
+ }
1103
+ ],
1104
+ "request": {
1105
+ "resource": "/secret/child",
1106
+ "resourceKind": "route",
1107
+ "target": {
1108
+ "kind": "live"
1109
+ },
1110
+ "principal": {}
1111
+ },
1112
+ "expected": {
1113
+ "capabilities": ["page.view"],
1114
+ "matchedGrantIds": ["grt_broad_exact"]
1115
+ },
1116
+ "phpProjectionCompiles": true
1117
+ },
1118
+ {
1119
+ "name": "an exact exclude closes its own path",
1120
+ "category": "path-glob",
1121
+ "spaceClaimed": true,
1122
+ "grants": [
1123
+ {
1124
+ "audience": {
1125
+ "kind": "public"
1126
+ },
1127
+ "resources": {
1128
+ "include": ["/**"],
1129
+ "exclude": ["/secret"]
1130
+ },
1131
+ "capabilities": ["page.view"],
1132
+ "constraints": {},
1133
+ "target": {
1134
+ "kind": "live"
1135
+ },
1136
+ "id": "grt_broad_exact",
1137
+ "source": {
1138
+ "kind": "managed",
1139
+ "reference": "conformance"
1140
+ }
1141
+ }
1142
+ ],
1143
+ "request": {
1144
+ "resource": "/secret",
1145
+ "resourceKind": "route",
1146
+ "target": {
1147
+ "kind": "live"
1148
+ },
1149
+ "principal": {}
1150
+ },
1151
+ "expected": {
1152
+ "capabilities": [],
1153
+ "matchedGrantIds": []
1154
+ },
1155
+ "phpProjectionCompiles": true
1156
+ },
1157
+ {
1158
+ "name": "a live Grant does not reach an immutable version",
1159
+ "category": "target",
1160
+ "spaceClaimed": true,
1161
+ "grants": [
1162
+ {
1163
+ "audience": {
1164
+ "kind": "public"
1165
+ },
1166
+ "resources": {
1167
+ "include": ["/**"],
1168
+ "exclude": []
1169
+ },
1170
+ "capabilities": ["page.view"],
1171
+ "constraints": {},
1172
+ "target": {
1173
+ "kind": "live"
1174
+ },
1175
+ "id": "grt_public_view",
1176
+ "source": {
1177
+ "kind": "managed",
1178
+ "reference": "conformance"
1179
+ }
1180
+ }
1181
+ ],
1182
+ "request": {
1183
+ "resource": "/",
1184
+ "resourceKind": "route",
1185
+ "target": {
1186
+ "kind": "version",
1187
+ "versionId": "ver_one"
1188
+ },
1189
+ "principal": {}
1190
+ },
1191
+ "expected": {
1192
+ "capabilities": [],
1193
+ "matchedGrantIds": []
1194
+ },
1195
+ "phpProjectionCompiles": true
1196
+ },
1197
+ {
1198
+ "name": "a version Grant matches its own version",
1199
+ "category": "target",
1200
+ "spaceClaimed": true,
1201
+ "grants": [
1202
+ {
1203
+ "audience": {
1204
+ "kind": "public"
1205
+ },
1206
+ "resources": {
1207
+ "include": ["/**"],
1208
+ "exclude": []
1209
+ },
1210
+ "capabilities": ["page.view"],
1211
+ "constraints": {},
1212
+ "target": {
1213
+ "kind": "version",
1214
+ "versionId": "ver_one"
1215
+ },
1216
+ "id": "grt_version",
1217
+ "source": {
1218
+ "kind": "managed",
1219
+ "reference": "conformance"
1220
+ }
1221
+ }
1222
+ ],
1223
+ "request": {
1224
+ "resource": "/",
1225
+ "resourceKind": "route",
1226
+ "target": {
1227
+ "kind": "version",
1228
+ "versionId": "ver_one"
1229
+ },
1230
+ "principal": {}
1231
+ },
1232
+ "expected": {
1233
+ "capabilities": ["page.view"],
1234
+ "matchedGrantIds": ["grt_version"]
1235
+ },
1236
+ "phpProjectionCompiles": true
1237
+ },
1238
+ {
1239
+ "name": "a version Grant ignores another version",
1240
+ "category": "target",
1241
+ "spaceClaimed": true,
1242
+ "grants": [
1243
+ {
1244
+ "audience": {
1245
+ "kind": "public"
1246
+ },
1247
+ "resources": {
1248
+ "include": ["/**"],
1249
+ "exclude": []
1250
+ },
1251
+ "capabilities": ["page.view"],
1252
+ "constraints": {},
1253
+ "target": {
1254
+ "kind": "version",
1255
+ "versionId": "ver_one"
1256
+ },
1257
+ "id": "grt_version",
1258
+ "source": {
1259
+ "kind": "managed",
1260
+ "reference": "conformance"
1261
+ }
1262
+ }
1263
+ ],
1264
+ "request": {
1265
+ "resource": "/",
1266
+ "resourceKind": "route",
1267
+ "target": {
1268
+ "kind": "version",
1269
+ "versionId": "ver_two"
1270
+ },
1271
+ "principal": {}
1272
+ },
1273
+ "expected": {
1274
+ "capabilities": [],
1275
+ "matchedGrantIds": []
1276
+ },
1277
+ "phpProjectionCompiles": true
1278
+ },
1279
+ {
1280
+ "name": "a branch Grant matches its own branch",
1281
+ "category": "target",
1282
+ "spaceClaimed": true,
1283
+ "grants": [
1284
+ {
1285
+ "audience": {
1286
+ "kind": "link",
1287
+ "linkId": "lnk_branch"
1288
+ },
1289
+ "resources": {
1290
+ "include": ["/**"],
1291
+ "exclude": []
1292
+ },
1293
+ "capabilities": ["page.view"],
1294
+ "constraints": {},
1295
+ "target": {
1296
+ "kind": "branch",
1297
+ "branch": "staging"
1298
+ },
1299
+ "id": "grt_branch",
1300
+ "source": {
1301
+ "kind": "managed",
1302
+ "reference": "conformance"
1303
+ }
1304
+ }
1305
+ ],
1306
+ "request": {
1307
+ "resource": "/",
1308
+ "resourceKind": "route",
1309
+ "target": {
1310
+ "kind": "branch",
1311
+ "branch": "staging"
1312
+ },
1313
+ "principal": {
1314
+ "linkIds": ["lnk_branch"]
1315
+ }
1316
+ },
1317
+ "expected": {
1318
+ "capabilities": ["page.view"],
1319
+ "matchedGrantIds": ["grt_branch"]
1320
+ },
1321
+ "phpProjectionCompiles": true
1322
+ },
1323
+ {
1324
+ "name": "a branch Grant ignores another branch",
1325
+ "category": "target",
1326
+ "spaceClaimed": true,
1327
+ "grants": [
1328
+ {
1329
+ "audience": {
1330
+ "kind": "link",
1331
+ "linkId": "lnk_branch"
1332
+ },
1333
+ "resources": {
1334
+ "include": ["/**"],
1335
+ "exclude": []
1336
+ },
1337
+ "capabilities": ["page.view"],
1338
+ "constraints": {},
1339
+ "target": {
1340
+ "kind": "branch",
1341
+ "branch": "staging"
1342
+ },
1343
+ "id": "grt_branch",
1344
+ "source": {
1345
+ "kind": "managed",
1346
+ "reference": "conformance"
1347
+ }
1348
+ }
1349
+ ],
1350
+ "request": {
1351
+ "resource": "/",
1352
+ "resourceKind": "route",
1353
+ "target": {
1354
+ "kind": "branch",
1355
+ "branch": "preview"
1356
+ },
1357
+ "principal": {
1358
+ "linkIds": ["lnk_branch"]
1359
+ }
1360
+ },
1361
+ "expected": {
1362
+ "capabilities": [],
1363
+ "matchedGrantIds": []
1364
+ },
1365
+ "phpProjectionCompiles": true
1366
+ },
1367
+ {
1368
+ "name": "all_versions matches any immutable version",
1369
+ "category": "target",
1370
+ "spaceClaimed": true,
1371
+ "grants": [
1372
+ {
1373
+ "audience": {
1374
+ "kind": "public"
1375
+ },
1376
+ "resources": {
1377
+ "include": ["/**"],
1378
+ "exclude": []
1379
+ },
1380
+ "capabilities": ["page.view"],
1381
+ "constraints": {},
1382
+ "target": {
1383
+ "kind": "all_versions"
1384
+ },
1385
+ "id": "grt_all_versions",
1386
+ "source": {
1387
+ "kind": "managed",
1388
+ "reference": "conformance"
1389
+ }
1390
+ }
1391
+ ],
1392
+ "request": {
1393
+ "resource": "/",
1394
+ "resourceKind": "route",
1395
+ "target": {
1396
+ "kind": "version",
1397
+ "versionId": "ver_anything"
1398
+ },
1399
+ "principal": {}
1400
+ },
1401
+ "expected": {
1402
+ "capabilities": ["page.view"],
1403
+ "matchedGrantIds": ["grt_all_versions"]
1404
+ },
1405
+ "phpProjectionCompiles": true
1406
+ },
1407
+ {
1408
+ "name": "all_versions does not reach the live route",
1409
+ "category": "target",
1410
+ "spaceClaimed": true,
1411
+ "grants": [
1412
+ {
1413
+ "audience": {
1414
+ "kind": "public"
1415
+ },
1416
+ "resources": {
1417
+ "include": ["/**"],
1418
+ "exclude": []
1419
+ },
1420
+ "capabilities": ["page.view"],
1421
+ "constraints": {},
1422
+ "target": {
1423
+ "kind": "all_versions"
1424
+ },
1425
+ "id": "grt_all_versions",
1426
+ "source": {
1427
+ "kind": "managed",
1428
+ "reference": "conformance"
1429
+ }
1430
+ }
1431
+ ],
1432
+ "request": {
1433
+ "resource": "/",
1434
+ "resourceKind": "route",
1435
+ "target": {
1436
+ "kind": "live"
1437
+ },
1438
+ "principal": {}
1439
+ },
1440
+ "expected": {
1441
+ "capabilities": ["page.view"],
1442
+ "matchedGrantIds": ["grt_all_versions"]
1443
+ },
1444
+ "phpProjectionCompiles": true
1445
+ },
1446
+ {
1447
+ "name": "a team Grant admits a member of that team",
1448
+ "category": "audience",
1449
+ "spaceClaimed": true,
1450
+ "grants": [
1451
+ {
1452
+ "audience": {
1453
+ "kind": "team",
1454
+ "teamId": "tm_conformance"
1455
+ },
1456
+ "resources": {
1457
+ "include": ["/**"],
1458
+ "exclude": []
1459
+ },
1460
+ "capabilities": ["page.view"],
1461
+ "constraints": {},
1462
+ "target": {
1463
+ "kind": "live"
1464
+ },
1465
+ "id": "grt_team",
1466
+ "source": {
1467
+ "kind": "managed",
1468
+ "reference": "conformance"
1469
+ }
1470
+ }
1471
+ ],
1472
+ "request": {
1473
+ "resource": "/",
1474
+ "resourceKind": "route",
1475
+ "target": {
1476
+ "kind": "live"
1477
+ },
1478
+ "principal": {
1479
+ "teamIds": ["tm_conformance"]
1480
+ }
1481
+ },
1482
+ "expected": {
1483
+ "capabilities": ["page.view"],
1484
+ "matchedGrantIds": ["grt_team"]
1485
+ },
1486
+ "phpProjectionCompiles": true
1487
+ },
1488
+ {
1489
+ "name": "a team Grant ignores another team",
1490
+ "category": "audience",
1491
+ "spaceClaimed": true,
1492
+ "grants": [
1493
+ {
1494
+ "audience": {
1495
+ "kind": "team",
1496
+ "teamId": "tm_conformance"
1497
+ },
1498
+ "resources": {
1499
+ "include": ["/**"],
1500
+ "exclude": []
1501
+ },
1502
+ "capabilities": ["page.view"],
1503
+ "constraints": {},
1504
+ "target": {
1505
+ "kind": "live"
1506
+ },
1507
+ "id": "grt_team",
1508
+ "source": {
1509
+ "kind": "managed",
1510
+ "reference": "conformance"
1511
+ }
1512
+ }
1513
+ ],
1514
+ "request": {
1515
+ "resource": "/",
1516
+ "resourceKind": "route",
1517
+ "target": {
1518
+ "kind": "live"
1519
+ },
1520
+ "principal": {
1521
+ "teamIds": ["tm_other"]
1522
+ }
1523
+ },
1524
+ "expected": {
1525
+ "capabilities": [],
1526
+ "matchedGrantIds": []
1527
+ },
1528
+ "phpProjectionCompiles": true
1529
+ },
1530
+ {
1531
+ "name": "a person Grant admits that person",
1532
+ "category": "audience",
1533
+ "spaceClaimed": true,
1534
+ "grants": [
1535
+ {
1536
+ "audience": {
1537
+ "kind": "person",
1538
+ "personId": "psn_one"
1539
+ },
1540
+ "resources": {
1541
+ "include": ["/**"],
1542
+ "exclude": []
1543
+ },
1544
+ "capabilities": ["page.view"],
1545
+ "constraints": {},
1546
+ "target": {
1547
+ "kind": "live"
1548
+ },
1549
+ "id": "grt_person",
1550
+ "source": {
1551
+ "kind": "managed",
1552
+ "reference": "conformance"
1553
+ }
1554
+ }
1555
+ ],
1556
+ "request": {
1557
+ "resource": "/",
1558
+ "resourceKind": "route",
1559
+ "target": {
1560
+ "kind": "live"
1561
+ },
1562
+ "principal": {
1563
+ "personIds": ["psn_one"]
1564
+ }
1565
+ },
1566
+ "expected": {
1567
+ "capabilities": ["page.view"],
1568
+ "matchedGrantIds": ["grt_person"]
1569
+ },
1570
+ "phpProjectionCompiles": true
1571
+ },
1572
+ {
1573
+ "name": "a link Grant admits the redeemed link",
1574
+ "category": "audience",
1575
+ "spaceClaimed": true,
1576
+ "grants": [
1577
+ {
1578
+ "audience": {
1579
+ "kind": "link",
1580
+ "linkId": "lnk_one"
1581
+ },
1582
+ "resources": {
1583
+ "include": ["/**"],
1584
+ "exclude": []
1585
+ },
1586
+ "capabilities": ["page.view"],
1587
+ "constraints": {},
1588
+ "target": {
1589
+ "kind": "live"
1590
+ },
1591
+ "id": "grt_link",
1592
+ "source": {
1593
+ "kind": "managed",
1594
+ "reference": "conformance"
1595
+ }
1596
+ }
1597
+ ],
1598
+ "request": {
1599
+ "resource": "/",
1600
+ "resourceKind": "route",
1601
+ "target": {
1602
+ "kind": "live"
1603
+ },
1604
+ "principal": {
1605
+ "linkIds": ["lnk_one"]
1606
+ }
1607
+ },
1608
+ "expected": {
1609
+ "capabilities": ["page.view"],
1610
+ "matchedGrantIds": ["grt_link"]
1611
+ },
1612
+ "phpProjectionCompiles": true
1613
+ },
1614
+ {
1615
+ "name": "a password Grant admits the redeemed credential",
1616
+ "category": "audience",
1617
+ "spaceClaimed": true,
1618
+ "grants": [
1619
+ {
1620
+ "audience": {
1621
+ "kind": "password",
1622
+ "credentialId": "pwd_one"
1623
+ },
1624
+ "resources": {
1625
+ "include": ["/**"],
1626
+ "exclude": []
1627
+ },
1628
+ "capabilities": ["page.view"],
1629
+ "constraints": {},
1630
+ "target": {
1631
+ "kind": "live"
1632
+ },
1633
+ "id": "grt_password",
1634
+ "source": {
1635
+ "kind": "managed",
1636
+ "reference": "conformance"
1637
+ }
1638
+ }
1639
+ ],
1640
+ "request": {
1641
+ "resource": "/",
1642
+ "resourceKind": "route",
1643
+ "target": {
1644
+ "kind": "live"
1645
+ },
1646
+ "principal": {
1647
+ "passwordCredentialIds": ["pwd_one"]
1648
+ }
1649
+ },
1650
+ "expected": {
1651
+ "capabilities": ["page.view"],
1652
+ "matchedGrantIds": ["grt_password"]
1653
+ },
1654
+ "phpProjectionCompiles": true
1655
+ },
1656
+ {
1657
+ "name": "a machine Grant admits the service token",
1658
+ "category": "audience",
1659
+ "spaceClaimed": true,
1660
+ "grants": [
1661
+ {
1662
+ "audience": {
1663
+ "kind": "machine",
1664
+ "machineId": "mch_one"
1665
+ },
1666
+ "resources": {
1667
+ "include": ["/**"],
1668
+ "exclude": []
1669
+ },
1670
+ "capabilities": ["page.view", "content.publish"],
1671
+ "constraints": {},
1672
+ "target": {
1673
+ "kind": "live"
1674
+ },
1675
+ "id": "grt_machine",
1676
+ "source": {
1677
+ "kind": "managed",
1678
+ "reference": "conformance"
1679
+ }
1680
+ }
1681
+ ],
1682
+ "request": {
1683
+ "resource": "/",
1684
+ "resourceKind": "route",
1685
+ "target": {
1686
+ "kind": "live"
1687
+ },
1688
+ "principal": {
1689
+ "machineIds": ["mch_one"]
1690
+ }
1691
+ },
1692
+ "expected": {
1693
+ "capabilities": ["content.publish", "page.view"],
1694
+ "matchedGrantIds": ["grt_machine"]
1695
+ },
1696
+ "phpProjectionCompiles": true
1697
+ },
1698
+ {
1699
+ "name": "an external Grant admits its own issuer and subject",
1700
+ "category": "audience",
1701
+ "spaceClaimed": true,
1702
+ "grants": [
1703
+ {
1704
+ "audience": {
1705
+ "kind": "external",
1706
+ "issuer": "spacefast-membership",
1707
+ "subject": "mem_one"
1708
+ },
1709
+ "resources": {
1710
+ "include": ["/**"],
1711
+ "exclude": []
1712
+ },
1713
+ "capabilities": ["page.view"],
1714
+ "constraints": {},
1715
+ "target": {
1716
+ "kind": "live"
1717
+ },
1718
+ "id": "grt_external",
1719
+ "source": {
1720
+ "kind": "managed",
1721
+ "reference": "conformance"
1722
+ }
1723
+ }
1724
+ ],
1725
+ "request": {
1726
+ "resource": "/",
1727
+ "resourceKind": "route",
1728
+ "target": {
1729
+ "kind": "live"
1730
+ },
1731
+ "principal": {
1732
+ "externalIdentities": [
1733
+ {
1734
+ "issuer": "spacefast-membership",
1735
+ "subject": "mem_one"
1736
+ }
1737
+ ]
1738
+ }
1739
+ },
1740
+ "expected": {
1741
+ "capabilities": ["page.view"],
1742
+ "matchedGrantIds": ["grt_external"]
1743
+ },
1744
+ "phpProjectionCompiles": true
1745
+ },
1746
+ {
1747
+ "name": "an external Grant ignores another subject of the same issuer",
1748
+ "category": "audience",
1749
+ "spaceClaimed": true,
1750
+ "grants": [
1751
+ {
1752
+ "audience": {
1753
+ "kind": "external",
1754
+ "issuer": "spacefast-membership",
1755
+ "subject": "mem_one"
1756
+ },
1757
+ "resources": {
1758
+ "include": ["/**"],
1759
+ "exclude": []
1760
+ },
1761
+ "capabilities": ["page.view"],
1762
+ "constraints": {},
1763
+ "target": {
1764
+ "kind": "live"
1765
+ },
1766
+ "id": "grt_external",
1767
+ "source": {
1768
+ "kind": "managed",
1769
+ "reference": "conformance"
1770
+ }
1771
+ }
1772
+ ],
1773
+ "request": {
1774
+ "resource": "/",
1775
+ "resourceKind": "route",
1776
+ "target": {
1777
+ "kind": "live"
1778
+ },
1779
+ "principal": {
1780
+ "externalIdentities": [
1781
+ {
1782
+ "issuer": "spacefast-membership",
1783
+ "subject": "mem_two"
1784
+ }
1785
+ ]
1786
+ }
1787
+ },
1788
+ "expected": {
1789
+ "capabilities": [],
1790
+ "matchedGrantIds": []
1791
+ },
1792
+ "phpProjectionCompiles": true
1793
+ },
1794
+ {
1795
+ "name": "an external Grant ignores the same subject from another issuer",
1796
+ "category": "audience",
1797
+ "spaceClaimed": true,
1798
+ "grants": [
1799
+ {
1800
+ "audience": {
1801
+ "kind": "external",
1802
+ "issuer": "https://idp-a.example",
1803
+ "subject": "alice"
1804
+ },
1805
+ "resources": {
1806
+ "include": ["/**"],
1807
+ "exclude": []
1808
+ },
1809
+ "capabilities": ["page.view"],
1810
+ "constraints": {},
1811
+ "target": {
1812
+ "kind": "live"
1813
+ },
1814
+ "id": "grt_external",
1815
+ "source": {
1816
+ "kind": "managed",
1817
+ "reference": "conformance"
1818
+ }
1819
+ }
1820
+ ],
1821
+ "request": {
1822
+ "resource": "/",
1823
+ "resourceKind": "route",
1824
+ "target": {
1825
+ "kind": "live"
1826
+ },
1827
+ "principal": {
1828
+ "externalIdentities": [
1829
+ {
1830
+ "issuer": "https://idp-b.example",
1831
+ "subject": "alice"
1832
+ }
1833
+ ]
1834
+ }
1835
+ },
1836
+ "expected": {
1837
+ "capabilities": [],
1838
+ "matchedGrantIds": []
1839
+ },
1840
+ "phpProjectionCompiles": true
1841
+ },
1842
+ {
1843
+ "name": "an anonymous visitor gets nothing from a credential Grant",
1844
+ "category": "audience",
1845
+ "spaceClaimed": true,
1846
+ "grants": [
1847
+ {
1848
+ "audience": {
1849
+ "kind": "link",
1850
+ "linkId": "lnk_one"
1851
+ },
1852
+ "resources": {
1853
+ "include": ["/**"],
1854
+ "exclude": []
1855
+ },
1856
+ "capabilities": ["page.view"],
1857
+ "constraints": {},
1858
+ "target": {
1859
+ "kind": "live"
1860
+ },
1861
+ "id": "grt_link",
1862
+ "source": {
1863
+ "kind": "managed",
1864
+ "reference": "conformance"
1865
+ }
1866
+ }
1867
+ ],
1868
+ "request": {
1869
+ "resource": "/",
1870
+ "resourceKind": "route",
1871
+ "target": {
1872
+ "kind": "live"
1873
+ },
1874
+ "principal": {}
1875
+ },
1876
+ "expected": {
1877
+ "capabilities": [],
1878
+ "matchedGrantIds": []
1879
+ },
1880
+ "phpProjectionCompiles": true
1881
+ },
1882
+ {
1883
+ "name": "an active window admits",
1884
+ "category": "constraint",
1885
+ "spaceClaimed": true,
1886
+ "grants": [
1887
+ {
1888
+ "audience": {
1889
+ "kind": "public"
1890
+ },
1891
+ "resources": {
1892
+ "include": ["/**"],
1893
+ "exclude": []
1894
+ },
1895
+ "capabilities": ["page.view"],
1896
+ "constraints": {
1897
+ "notBefore": "2026-08-09T11:59:59.000Z",
1898
+ "expiresAt": "2026-08-09T12:00:01.000Z"
1899
+ },
1900
+ "target": {
1901
+ "kind": "live"
1902
+ },
1903
+ "id": "grt_window",
1904
+ "source": {
1905
+ "kind": "managed",
1906
+ "reference": "conformance"
1907
+ }
1908
+ }
1909
+ ],
1910
+ "request": {
1911
+ "resource": "/",
1912
+ "resourceKind": "route",
1913
+ "target": {
1914
+ "kind": "live"
1915
+ },
1916
+ "principal": {}
1917
+ },
1918
+ "expected": {
1919
+ "capabilities": ["page.view"],
1920
+ "matchedGrantIds": ["grt_window"]
1921
+ },
1922
+ "phpProjectionCompiles": true
1923
+ },
1924
+ {
1925
+ "name": "notBefore is closed one second early",
1926
+ "category": "constraint",
1927
+ "spaceClaimed": true,
1928
+ "grants": [
1929
+ {
1930
+ "audience": {
1931
+ "kind": "public"
1932
+ },
1933
+ "resources": {
1934
+ "include": ["/**"],
1935
+ "exclude": []
1936
+ },
1937
+ "capabilities": ["page.view"],
1938
+ "constraints": {
1939
+ "notBefore": "2026-08-09T12:00:01.000Z"
1940
+ },
1941
+ "target": {
1942
+ "kind": "live"
1943
+ },
1944
+ "id": "grt_scheduled",
1945
+ "source": {
1946
+ "kind": "managed",
1947
+ "reference": "conformance"
1948
+ }
1949
+ }
1950
+ ],
1951
+ "request": {
1952
+ "resource": "/",
1953
+ "resourceKind": "route",
1954
+ "target": {
1955
+ "kind": "live"
1956
+ },
1957
+ "principal": {}
1958
+ },
1959
+ "expected": {
1960
+ "capabilities": [],
1961
+ "matchedGrantIds": []
1962
+ },
1963
+ "phpProjectionCompiles": true
1964
+ },
1965
+ {
1966
+ "name": "expiresAt closes on its own second",
1967
+ "category": "constraint",
1968
+ "spaceClaimed": true,
1969
+ "grants": [
1970
+ {
1971
+ "audience": {
1972
+ "kind": "public"
1973
+ },
1974
+ "resources": {
1975
+ "include": ["/**"],
1976
+ "exclude": []
1977
+ },
1978
+ "capabilities": ["page.view"],
1979
+ "constraints": {
1980
+ "expiresAt": "2026-08-09T12:00:00.000Z"
1981
+ },
1982
+ "target": {
1983
+ "kind": "live"
1984
+ },
1985
+ "id": "grt_expiring",
1986
+ "source": {
1987
+ "kind": "managed",
1988
+ "reference": "conformance"
1989
+ }
1990
+ }
1991
+ ],
1992
+ "request": {
1993
+ "resource": "/",
1994
+ "resourceKind": "route",
1995
+ "target": {
1996
+ "kind": "live"
1997
+ },
1998
+ "principal": {}
1999
+ },
2000
+ "expected": {
2001
+ "capabilities": [],
2002
+ "matchedGrantIds": []
2003
+ },
2004
+ "phpProjectionCompiles": true
2005
+ },
2006
+ {
2007
+ "name": "expiresAt still admits the second before",
2008
+ "category": "constraint",
2009
+ "spaceClaimed": true,
2010
+ "grants": [
2011
+ {
2012
+ "audience": {
2013
+ "kind": "public"
2014
+ },
2015
+ "resources": {
2016
+ "include": ["/**"],
2017
+ "exclude": []
2018
+ },
2019
+ "capabilities": ["page.view"],
2020
+ "constraints": {
2021
+ "expiresAt": "2026-08-09T12:00:01.000Z"
2022
+ },
2023
+ "target": {
2024
+ "kind": "live"
2025
+ },
2026
+ "id": "grt_expiring",
2027
+ "source": {
2028
+ "kind": "managed",
2029
+ "reference": "conformance"
2030
+ }
2031
+ }
2032
+ ],
2033
+ "request": {
2034
+ "resource": "/",
2035
+ "resourceKind": "route",
2036
+ "target": {
2037
+ "kind": "live"
2038
+ },
2039
+ "principal": {}
2040
+ },
2041
+ "expected": {
2042
+ "capabilities": ["page.view"],
2043
+ "matchedGrantIds": ["grt_expiring"]
2044
+ },
2045
+ "phpProjectionCompiles": true
2046
+ },
2047
+ {
2048
+ "name": "maxUses on a redeemed link admits",
2049
+ "category": "constraint",
2050
+ "spaceClaimed": true,
2051
+ "grants": [
2052
+ {
2053
+ "audience": {
2054
+ "kind": "link",
2055
+ "linkId": "lnk_uses"
2056
+ },
2057
+ "resources": {
2058
+ "include": ["/**"],
2059
+ "exclude": []
2060
+ },
2061
+ "capabilities": ["page.view"],
2062
+ "constraints": {
2063
+ "maxUses": 1
2064
+ },
2065
+ "target": {
2066
+ "kind": "live"
2067
+ },
2068
+ "id": "grt_link_uses",
2069
+ "source": {
2070
+ "kind": "managed",
2071
+ "reference": "conformance"
2072
+ }
2073
+ }
2074
+ ],
2075
+ "request": {
2076
+ "resource": "/",
2077
+ "resourceKind": "route",
2078
+ "target": {
2079
+ "kind": "live"
2080
+ },
2081
+ "principal": {
2082
+ "linkIds": ["lnk_uses"]
2083
+ }
2084
+ },
2085
+ "expected": {
2086
+ "capabilities": ["page.view"],
2087
+ "matchedGrantIds": ["grt_link_uses"]
2088
+ },
2089
+ "phpProjectionCompiles": true
2090
+ },
2091
+ {
2092
+ "name": "maxUses on a public audience fails closed",
2093
+ "category": "constraint",
2094
+ "spaceClaimed": true,
2095
+ "grants": [
2096
+ {
2097
+ "id": "grt_public_uses",
2098
+ "audience": {
2099
+ "kind": "public"
2100
+ },
2101
+ "resources": {
2102
+ "include": ["/**"],
2103
+ "exclude": []
2104
+ },
2105
+ "capabilities": ["page.view"],
2106
+ "constraints": {
2107
+ "maxUses": 5
2108
+ },
2109
+ "target": {
2110
+ "kind": "live"
2111
+ },
2112
+ "source": {
2113
+ "kind": "managed",
2114
+ "reference": "conformance"
2115
+ }
2116
+ }
2117
+ ],
2118
+ "request": {
2119
+ "resource": "/",
2120
+ "resourceKind": "route",
2121
+ "target": {
2122
+ "kind": "live"
2123
+ },
2124
+ "principal": {}
2125
+ },
2126
+ "expected": {
2127
+ "capabilities": [],
2128
+ "matchedGrantIds": []
2129
+ },
2130
+ "phpProjectionCompiles": false
2131
+ },
2132
+ {
2133
+ "name": "requireVerifiedEmail admits a verified identity",
2134
+ "category": "constraint",
2135
+ "spaceClaimed": true,
2136
+ "grants": [
2137
+ {
2138
+ "audience": {
2139
+ "kind": "person",
2140
+ "personId": "psn_verified"
2141
+ },
2142
+ "resources": {
2143
+ "include": ["/**"],
2144
+ "exclude": []
2145
+ },
2146
+ "capabilities": ["page.view"],
2147
+ "constraints": {
2148
+ "requireVerifiedEmail": true
2149
+ },
2150
+ "target": {
2151
+ "kind": "live"
2152
+ },
2153
+ "id": "grt_verified",
2154
+ "source": {
2155
+ "kind": "managed",
2156
+ "reference": "conformance"
2157
+ }
2158
+ }
2159
+ ],
2160
+ "request": {
2161
+ "resource": "/",
2162
+ "resourceKind": "route",
2163
+ "target": {
2164
+ "kind": "live"
2165
+ },
2166
+ "principal": {
2167
+ "personIds": ["psn_verified"],
2168
+ "verifiedEmail": true
2169
+ }
2170
+ },
2171
+ "expected": {
2172
+ "capabilities": ["page.view"],
2173
+ "matchedGrantIds": ["grt_verified"]
2174
+ },
2175
+ "phpProjectionCompiles": true
2176
+ },
2177
+ {
2178
+ "name": "requireVerifiedEmail closes an unverified identity",
2179
+ "category": "constraint",
2180
+ "spaceClaimed": true,
2181
+ "grants": [
2182
+ {
2183
+ "audience": {
2184
+ "kind": "person",
2185
+ "personId": "psn_verified"
2186
+ },
2187
+ "resources": {
2188
+ "include": ["/**"],
2189
+ "exclude": []
2190
+ },
2191
+ "capabilities": ["page.view"],
2192
+ "constraints": {
2193
+ "requireVerifiedEmail": true
2194
+ },
2195
+ "target": {
2196
+ "kind": "live"
2197
+ },
2198
+ "id": "grt_verified",
2199
+ "source": {
2200
+ "kind": "managed",
2201
+ "reference": "conformance"
2202
+ }
2203
+ }
2204
+ ],
2205
+ "request": {
2206
+ "resource": "/",
2207
+ "resourceKind": "route",
2208
+ "target": {
2209
+ "kind": "live"
2210
+ },
2211
+ "principal": {
2212
+ "personIds": ["psn_verified"]
2213
+ }
2214
+ },
2215
+ "expected": {
2216
+ "capabilities": [],
2217
+ "matchedGrantIds": []
2218
+ },
2219
+ "phpProjectionCompiles": true
2220
+ },
2221
+ {
2222
+ "name": "a country allowlist admits the listed country",
2223
+ "category": "constraint",
2224
+ "spaceClaimed": true,
2225
+ "grants": [
2226
+ {
2227
+ "audience": {
2228
+ "kind": "public"
2229
+ },
2230
+ "resources": {
2231
+ "include": ["/**"],
2232
+ "exclude": []
2233
+ },
2234
+ "capabilities": ["page.view"],
2235
+ "constraints": {
2236
+ "network": {
2237
+ "countries": ["NL"]
2238
+ }
2239
+ },
2240
+ "target": {
2241
+ "kind": "live"
2242
+ },
2243
+ "id": "grt_country",
2244
+ "source": {
2245
+ "kind": "managed",
2246
+ "reference": "conformance"
2247
+ }
2248
+ }
2249
+ ],
2250
+ "request": {
2251
+ "resource": "/",
2252
+ "resourceKind": "route",
2253
+ "target": {
2254
+ "kind": "live"
2255
+ },
2256
+ "principal": {
2257
+ "country": "NL",
2258
+ "userAgent": "Mozilla/5.0"
2259
+ }
2260
+ },
2261
+ "expected": {
2262
+ "capabilities": ["page.view"],
2263
+ "matchedGrantIds": ["grt_country"]
2264
+ },
2265
+ "phpProjectionCompiles": true
2266
+ },
2267
+ {
2268
+ "name": "a country allowlist closes another country",
2269
+ "category": "constraint",
2270
+ "spaceClaimed": true,
2271
+ "grants": [
2272
+ {
2273
+ "audience": {
2274
+ "kind": "public"
2275
+ },
2276
+ "resources": {
2277
+ "include": ["/**"],
2278
+ "exclude": []
2279
+ },
2280
+ "capabilities": ["page.view"],
2281
+ "constraints": {
2282
+ "network": {
2283
+ "countries": ["NL"]
2284
+ }
2285
+ },
2286
+ "target": {
2287
+ "kind": "live"
2288
+ },
2289
+ "id": "grt_country",
2290
+ "source": {
2291
+ "kind": "managed",
2292
+ "reference": "conformance"
2293
+ }
2294
+ }
2295
+ ],
2296
+ "request": {
2297
+ "resource": "/",
2298
+ "resourceKind": "route",
2299
+ "target": {
2300
+ "kind": "live"
2301
+ },
2302
+ "principal": {
2303
+ "country": "US",
2304
+ "userAgent": "Mozilla/5.0"
2305
+ }
2306
+ },
2307
+ "expected": {
2308
+ "capabilities": [],
2309
+ "matchedGrantIds": []
2310
+ },
2311
+ "phpProjectionCompiles": true
2312
+ },
2313
+ {
2314
+ "name": "an empty GeoIP fails a country allowlist closed",
2315
+ "category": "constraint",
2316
+ "spaceClaimed": true,
2317
+ "grants": [
2318
+ {
2319
+ "audience": {
2320
+ "kind": "public"
2321
+ },
2322
+ "resources": {
2323
+ "include": ["/**"],
2324
+ "exclude": []
2325
+ },
2326
+ "capabilities": ["page.view"],
2327
+ "constraints": {
2328
+ "network": {
2329
+ "countries": ["NL"]
2330
+ }
2331
+ },
2332
+ "target": {
2333
+ "kind": "live"
2334
+ },
2335
+ "id": "grt_country",
2336
+ "source": {
2337
+ "kind": "managed",
2338
+ "reference": "conformance"
2339
+ }
2340
+ }
2341
+ ],
2342
+ "request": {
2343
+ "resource": "/",
2344
+ "resourceKind": "route",
2345
+ "target": {
2346
+ "kind": "live"
2347
+ },
2348
+ "principal": {
2349
+ "userAgent": "Mozilla/5.0"
2350
+ }
2351
+ },
2352
+ "expected": {
2353
+ "capabilities": [],
2354
+ "matchedGrantIds": []
2355
+ },
2356
+ "phpProjectionCompiles": true
2357
+ },
2358
+ {
2359
+ "name": "an excluded country closes",
2360
+ "category": "constraint",
2361
+ "spaceClaimed": true,
2362
+ "grants": [
2363
+ {
2364
+ "audience": {
2365
+ "kind": "public"
2366
+ },
2367
+ "resources": {
2368
+ "include": ["/**"],
2369
+ "exclude": []
2370
+ },
2371
+ "capabilities": ["page.view"],
2372
+ "constraints": {
2373
+ "network": {
2374
+ "excludedCountries": ["US"]
2375
+ }
2376
+ },
2377
+ "target": {
2378
+ "kind": "live"
2379
+ },
2380
+ "id": "grt_country_excluded",
2381
+ "source": {
2382
+ "kind": "managed",
2383
+ "reference": "conformance"
2384
+ }
2385
+ }
2386
+ ],
2387
+ "request": {
2388
+ "resource": "/",
2389
+ "resourceKind": "route",
2390
+ "target": {
2391
+ "kind": "live"
2392
+ },
2393
+ "principal": {
2394
+ "country": "US",
2395
+ "userAgent": "Mozilla/5.0"
2396
+ }
2397
+ },
2398
+ "expected": {
2399
+ "capabilities": [],
2400
+ "matchedGrantIds": []
2401
+ },
2402
+ "phpProjectionCompiles": true
2403
+ },
2404
+ {
2405
+ "name": "an empty GeoIP fails an exclusion list closed too",
2406
+ "category": "constraint",
2407
+ "spaceClaimed": true,
2408
+ "grants": [
2409
+ {
2410
+ "audience": {
2411
+ "kind": "public"
2412
+ },
2413
+ "resources": {
2414
+ "include": ["/**"],
2415
+ "exclude": []
2416
+ },
2417
+ "capabilities": ["page.view"],
2418
+ "constraints": {
2419
+ "network": {
2420
+ "excludedCountries": ["US"]
2421
+ }
2422
+ },
2423
+ "target": {
2424
+ "kind": "live"
2425
+ },
2426
+ "id": "grt_country_excluded",
2427
+ "source": {
2428
+ "kind": "managed",
2429
+ "reference": "conformance"
2430
+ }
2431
+ }
2432
+ ],
2433
+ "request": {
2434
+ "resource": "/",
2435
+ "resourceKind": "route",
2436
+ "target": {
2437
+ "kind": "live"
2438
+ },
2439
+ "principal": {
2440
+ "userAgent": "Mozilla/5.0"
2441
+ }
2442
+ },
2443
+ "expected": {
2444
+ "capabilities": [],
2445
+ "matchedGrantIds": []
2446
+ },
2447
+ "phpProjectionCompiles": true
2448
+ },
2449
+ {
2450
+ "name": "an excluded user-agent substring closes case-insensitively",
2451
+ "category": "constraint",
2452
+ "spaceClaimed": true,
2453
+ "grants": [
2454
+ {
2455
+ "audience": {
2456
+ "kind": "public"
2457
+ },
2458
+ "resources": {
2459
+ "include": ["/**"],
2460
+ "exclude": []
2461
+ },
2462
+ "capabilities": ["page.view"],
2463
+ "constraints": {
2464
+ "network": {
2465
+ "excludedUserAgentSubstrings": ["GPTBot"]
2466
+ }
2467
+ },
2468
+ "target": {
2469
+ "kind": "live"
2470
+ },
2471
+ "id": "grt_agent",
2472
+ "source": {
2473
+ "kind": "managed",
2474
+ "reference": "conformance"
2475
+ }
2476
+ }
2477
+ ],
2478
+ "request": {
2479
+ "resource": "/",
2480
+ "resourceKind": "route",
2481
+ "target": {
2482
+ "kind": "live"
2483
+ },
2484
+ "principal": {
2485
+ "country": "NL",
2486
+ "userAgent": "Mozilla/5.0 (compatible; gptbot/1.2)"
2487
+ }
2488
+ },
2489
+ "expected": {
2490
+ "capabilities": [],
2491
+ "matchedGrantIds": []
2492
+ },
2493
+ "phpProjectionCompiles": true
2494
+ },
2495
+ {
2496
+ "name": "an unrelated user agent still passes the exclusion",
2497
+ "category": "constraint",
2498
+ "spaceClaimed": true,
2499
+ "grants": [
2500
+ {
2501
+ "audience": {
2502
+ "kind": "public"
2503
+ },
2504
+ "resources": {
2505
+ "include": ["/**"],
2506
+ "exclude": []
2507
+ },
2508
+ "capabilities": ["page.view"],
2509
+ "constraints": {
2510
+ "network": {
2511
+ "excludedUserAgentSubstrings": ["GPTBot"]
2512
+ }
2513
+ },
2514
+ "target": {
2515
+ "kind": "live"
2516
+ },
2517
+ "id": "grt_agent",
2518
+ "source": {
2519
+ "kind": "managed",
2520
+ "reference": "conformance"
2521
+ }
2522
+ }
2523
+ ],
2524
+ "request": {
2525
+ "resource": "/",
2526
+ "resourceKind": "route",
2527
+ "target": {
2528
+ "kind": "live"
2529
+ },
2530
+ "principal": {
2531
+ "country": "NL",
2532
+ "userAgent": "Mozilla/5.0"
2533
+ }
2534
+ },
2535
+ "expected": {
2536
+ "capabilities": ["page.view"],
2537
+ "matchedGrantIds": ["grt_agent"]
2538
+ },
2539
+ "phpProjectionCompiles": true
2540
+ },
2541
+ {
2542
+ "name": "a missing user agent fails an exclusion list closed",
2543
+ "category": "constraint",
2544
+ "spaceClaimed": true,
2545
+ "grants": [
2546
+ {
2547
+ "audience": {
2548
+ "kind": "public"
2549
+ },
2550
+ "resources": {
2551
+ "include": ["/**"],
2552
+ "exclude": []
2553
+ },
2554
+ "capabilities": ["page.view"],
2555
+ "constraints": {
2556
+ "network": {
2557
+ "excludedUserAgentSubstrings": ["GPTBot"]
2558
+ }
2559
+ },
2560
+ "target": {
2561
+ "kind": "live"
2562
+ },
2563
+ "id": "grt_agent",
2564
+ "source": {
2565
+ "kind": "managed",
2566
+ "reference": "conformance"
2567
+ }
2568
+ }
2569
+ ],
2570
+ "request": {
2571
+ "resource": "/",
2572
+ "resourceKind": "route",
2573
+ "target": {
2574
+ "kind": "live"
2575
+ },
2576
+ "principal": {
2577
+ "country": "NL"
2578
+ }
2579
+ },
2580
+ "expected": {
2581
+ "capabilities": [],
2582
+ "matchedGrantIds": []
2583
+ },
2584
+ "phpProjectionCompiles": true
2585
+ },
2586
+ {
2587
+ "name": "an IP constraint admits nobody",
2588
+ "category": "constraint",
2589
+ "spaceClaimed": true,
2590
+ "grants": [
2591
+ {
2592
+ "audience": {
2593
+ "kind": "public"
2594
+ },
2595
+ "resources": {
2596
+ "include": ["/**"],
2597
+ "exclude": []
2598
+ },
2599
+ "capabilities": ["page.view"],
2600
+ "constraints": {
2601
+ "network": {
2602
+ "ipCidrs": ["203.0.113.0/24"]
2603
+ }
2604
+ },
2605
+ "target": {
2606
+ "kind": "live"
2607
+ },
2608
+ "id": "grt_ip",
2609
+ "source": {
2610
+ "kind": "managed",
2611
+ "reference": "conformance"
2612
+ }
2613
+ }
2614
+ ],
2615
+ "request": {
2616
+ "resource": "/",
2617
+ "resourceKind": "route",
2618
+ "target": {
2619
+ "kind": "live"
2620
+ },
2621
+ "principal": {
2622
+ "country": "NL",
2623
+ "userAgent": "Mozilla/5.0"
2624
+ }
2625
+ },
2626
+ "expected": {
2627
+ "capabilities": [],
2628
+ "matchedGrantIds": []
2629
+ },
2630
+ "phpProjectionCompiles": true
2631
+ },
2632
+ {
2633
+ "name": "one Grant's exclude does not suppress another Grant's include",
2634
+ "category": "composition",
2635
+ "spaceClaimed": true,
2636
+ "grants": [
2637
+ {
2638
+ "audience": {
2639
+ "kind": "public"
2640
+ },
2641
+ "resources": {
2642
+ "include": ["/**"],
2643
+ "exclude": ["/private/**"]
2644
+ },
2645
+ "capabilities": ["page.view"],
2646
+ "constraints": {},
2647
+ "target": {
2648
+ "kind": "live"
2649
+ },
2650
+ "id": "grt_public_broad",
2651
+ "source": {
2652
+ "kind": "managed",
2653
+ "reference": "conformance"
2654
+ }
2655
+ },
2656
+ {
2657
+ "audience": {
2658
+ "kind": "team",
2659
+ "teamId": "tm_conformance"
2660
+ },
2661
+ "resources": {
2662
+ "include": ["/private/**"],
2663
+ "exclude": []
2664
+ },
2665
+ "capabilities": ["page.view"],
2666
+ "constraints": {},
2667
+ "target": {
2668
+ "kind": "live"
2669
+ },
2670
+ "id": "grt_team_private",
2671
+ "source": {
2672
+ "kind": "managed",
2673
+ "reference": "conformance"
2674
+ }
2675
+ }
2676
+ ],
2677
+ "request": {
2678
+ "resource": "/private/plan",
2679
+ "resourceKind": "route",
2680
+ "target": {
2681
+ "kind": "live"
2682
+ },
2683
+ "principal": {
2684
+ "teamIds": ["tm_conformance"]
2685
+ }
2686
+ },
2687
+ "expected": {
2688
+ "capabilities": ["page.view"],
2689
+ "matchedGrantIds": ["grt_team_private"]
2690
+ },
2691
+ "phpProjectionCompiles": true
2692
+ },
2693
+ {
2694
+ "name": "an expired Grant loses to the live Grant with the same verdict",
2695
+ "category": "composition",
2696
+ "spaceClaimed": true,
2697
+ "grants": [
2698
+ {
2699
+ "audience": {
2700
+ "kind": "public"
2701
+ },
2702
+ "resources": {
2703
+ "include": ["/**"],
2704
+ "exclude": []
2705
+ },
2706
+ "capabilities": ["page.view"],
2707
+ "constraints": {
2708
+ "expiresAt": "2020-01-01T00:00:00.000Z"
2709
+ },
2710
+ "target": {
2711
+ "kind": "live"
2712
+ },
2713
+ "id": "grt_expired_twin",
2714
+ "source": {
2715
+ "kind": "managed",
2716
+ "reference": "conformance"
2717
+ }
2718
+ },
2719
+ {
2720
+ "audience": {
2721
+ "kind": "public"
2722
+ },
2723
+ "resources": {
2724
+ "include": ["/**"],
2725
+ "exclude": []
2726
+ },
2727
+ "capabilities": ["page.view"],
2728
+ "constraints": {},
2729
+ "target": {
2730
+ "kind": "live"
2731
+ },
2732
+ "id": "grt_live_twin",
2733
+ "source": {
2734
+ "kind": "managed",
2735
+ "reference": "conformance"
2736
+ }
2737
+ }
2738
+ ],
2739
+ "request": {
2740
+ "resource": "/",
2741
+ "resourceKind": "route",
2742
+ "target": {
2743
+ "kind": "live"
2744
+ },
2745
+ "principal": {}
2746
+ },
2747
+ "expected": {
2748
+ "capabilities": ["page.view"],
2749
+ "matchedGrantIds": ["grt_live_twin"]
2750
+ },
2751
+ "phpProjectionCompiles": true
2752
+ },
2753
+ {
2754
+ "name": "two Grants for one audience both report as matched",
2755
+ "category": "composition",
2756
+ "spaceClaimed": true,
2757
+ "grants": [
2758
+ {
2759
+ "audience": {
2760
+ "kind": "team",
2761
+ "teamId": "tm_conformance"
2762
+ },
2763
+ "resources": {
2764
+ "include": ["/**"],
2765
+ "exclude": []
2766
+ },
2767
+ "capabilities": ["page.view"],
2768
+ "constraints": {},
2769
+ "target": {
2770
+ "kind": "live"
2771
+ },
2772
+ "id": "grt_team_view",
2773
+ "source": {
2774
+ "kind": "managed",
2775
+ "reference": "conformance"
2776
+ }
2777
+ },
2778
+ {
2779
+ "audience": {
2780
+ "kind": "team",
2781
+ "teamId": "tm_conformance"
2782
+ },
2783
+ "resources": {
2784
+ "include": ["/**"],
2785
+ "exclude": []
2786
+ },
2787
+ "capabilities": ["page.view", "comments.read", "comments.write"],
2788
+ "constraints": {},
2789
+ "target": {
2790
+ "kind": "live"
2791
+ },
2792
+ "id": "grt_team_comments",
2793
+ "source": {
2794
+ "kind": "managed",
2795
+ "reference": "conformance"
2796
+ }
2797
+ }
2798
+ ],
2799
+ "request": {
2800
+ "resource": "/",
2801
+ "resourceKind": "route",
2802
+ "target": {
2803
+ "kind": "live"
2804
+ },
2805
+ "principal": {
2806
+ "teamIds": ["tm_conformance"]
2807
+ }
2808
+ },
2809
+ "expected": {
2810
+ "capabilities": ["comments.read", "comments.write", "page.view"],
2811
+ "matchedGrantIds": ["grt_team_comments", "grt_team_view"]
2812
+ },
2813
+ "phpProjectionCompiles": true
2814
+ },
2815
+ {
2816
+ "name": "a first-segment Grant and a fallback Grant both match under that segment",
2817
+ "category": "composition",
2818
+ "spaceClaimed": true,
2819
+ "grants": [
2820
+ {
2821
+ "audience": {
2822
+ "kind": "public"
2823
+ },
2824
+ "resources": {
2825
+ "include": ["/docs/**"],
2826
+ "exclude": []
2827
+ },
2828
+ "capabilities": ["page.view"],
2829
+ "constraints": {},
2830
+ "target": {
2831
+ "kind": "live"
2832
+ },
2833
+ "id": "grt_bucketed_docs",
2834
+ "source": {
2835
+ "kind": "managed",
2836
+ "reference": "conformance"
2837
+ }
2838
+ },
2839
+ {
2840
+ "audience": {
2841
+ "kind": "team",
2842
+ "teamId": "tm_conformance"
2843
+ },
2844
+ "resources": {
2845
+ "include": ["/**"],
2846
+ "exclude": []
2847
+ },
2848
+ "capabilities": ["page.view", "comments.read", "comments.write"],
2849
+ "constraints": {},
2850
+ "target": {
2851
+ "kind": "live"
2852
+ },
2853
+ "id": "grt_fallback_team",
2854
+ "source": {
2855
+ "kind": "managed",
2856
+ "reference": "conformance"
2857
+ }
2858
+ }
2859
+ ],
2860
+ "request": {
2861
+ "resource": "/docs/intro",
2862
+ "resourceKind": "route",
2863
+ "target": {
2864
+ "kind": "live"
2865
+ },
2866
+ "principal": {
2867
+ "teamIds": ["tm_conformance"]
2868
+ }
2869
+ },
2870
+ "expected": {
2871
+ "capabilities": ["comments.read", "comments.write", "page.view"],
2872
+ "matchedGrantIds": ["grt_bucketed_docs", "grt_fallback_team"]
2873
+ },
2874
+ "phpProjectionCompiles": true
2875
+ },
2876
+ {
2877
+ "name": "another segment reaches only the fallback Grant",
2878
+ "category": "composition",
2879
+ "spaceClaimed": true,
2880
+ "grants": [
2881
+ {
2882
+ "audience": {
2883
+ "kind": "public"
2884
+ },
2885
+ "resources": {
2886
+ "include": ["/docs/**"],
2887
+ "exclude": []
2888
+ },
2889
+ "capabilities": ["page.view"],
2890
+ "constraints": {},
2891
+ "target": {
2892
+ "kind": "live"
2893
+ },
2894
+ "id": "grt_bucketed_docs",
2895
+ "source": {
2896
+ "kind": "managed",
2897
+ "reference": "conformance"
2898
+ }
2899
+ },
2900
+ {
2901
+ "audience": {
2902
+ "kind": "team",
2903
+ "teamId": "tm_conformance"
2904
+ },
2905
+ "resources": {
2906
+ "include": ["/**"],
2907
+ "exclude": []
2908
+ },
2909
+ "capabilities": ["page.view", "comments.read", "comments.write"],
2910
+ "constraints": {},
2911
+ "target": {
2912
+ "kind": "live"
2913
+ },
2914
+ "id": "grt_fallback_team",
2915
+ "source": {
2916
+ "kind": "managed",
2917
+ "reference": "conformance"
2918
+ }
2919
+ }
2920
+ ],
2921
+ "request": {
2922
+ "resource": "/blog/post",
2923
+ "resourceKind": "route",
2924
+ "target": {
2925
+ "kind": "live"
2926
+ },
2927
+ "principal": {
2928
+ "teamIds": ["tm_conformance"]
2929
+ }
2930
+ },
2931
+ "expected": {
2932
+ "capabilities": ["comments.read", "comments.write", "page.view"],
2933
+ "matchedGrantIds": ["grt_fallback_team"]
2934
+ },
2935
+ "phpProjectionCompiles": true
2936
+ }
2937
+ ]
2938
+ }