@quantcdn/edge-conformance 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,1967 @@
1
+ {
2
+ "cases": [
3
+ {
4
+ "id": "rules-wildcard-matches-segment",
5
+ "description": "A trailing * matches the rest of the path.",
6
+ "tags": [
7
+ "rules"
8
+ ],
9
+ "op": "matchRule",
10
+ "input": {
11
+ "rules": {
12
+ "version": 1,
13
+ "namespace": "conformance",
14
+ "rules": [
15
+ {
16
+ "id": "blog",
17
+ "type": "function",
18
+ "urls": [
19
+ "/blog/*"
20
+ ],
21
+ "weight": 0,
22
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
23
+ }
24
+ ]
25
+ },
26
+ "functions": [
27
+ {
28
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
29
+ "id": "api",
30
+ "type": "function"
31
+ },
32
+ {
33
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
34
+ "id": "other",
35
+ "type": "function"
36
+ },
37
+ {
38
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
39
+ "id": "gate",
40
+ "type": "auth"
41
+ },
42
+ {
43
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
44
+ "id": "rewrite",
45
+ "type": "filter"
46
+ }
47
+ ],
48
+ "request": {
49
+ "method": "GET",
50
+ "url": "https://www.example.com/blog/first-post"
51
+ }
52
+ },
53
+ "expect": {
54
+ "ruleId": "blog"
55
+ }
56
+ },
57
+ {
58
+ "id": "rules-wildcard-matches-nested-path",
59
+ "description": "A * also matches across / characters.",
60
+ "tags": [
61
+ "rules"
62
+ ],
63
+ "op": "matchRule",
64
+ "input": {
65
+ "rules": {
66
+ "version": 1,
67
+ "namespace": "conformance",
68
+ "rules": [
69
+ {
70
+ "id": "blog",
71
+ "type": "function",
72
+ "urls": [
73
+ "/blog/*"
74
+ ],
75
+ "weight": 0,
76
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
77
+ }
78
+ ]
79
+ },
80
+ "functions": [
81
+ {
82
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
83
+ "id": "api",
84
+ "type": "function"
85
+ },
86
+ {
87
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
88
+ "id": "other",
89
+ "type": "function"
90
+ },
91
+ {
92
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
93
+ "id": "gate",
94
+ "type": "auth"
95
+ },
96
+ {
97
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
98
+ "id": "rewrite",
99
+ "type": "filter"
100
+ }
101
+ ],
102
+ "request": {
103
+ "method": "GET",
104
+ "url": "https://www.example.com/blog/2026/10/first-post"
105
+ }
106
+ },
107
+ "expect": {
108
+ "ruleId": "blog"
109
+ }
110
+ },
111
+ {
112
+ "id": "rules-wildcard-needs-a-character",
113
+ "description": "A * matches one or more characters, so /blog/* does not match /blog/.",
114
+ "tags": [
115
+ "rules"
116
+ ],
117
+ "op": "matchRule",
118
+ "input": {
119
+ "rules": {
120
+ "version": 1,
121
+ "namespace": "conformance",
122
+ "rules": [
123
+ {
124
+ "id": "blog",
125
+ "type": "function",
126
+ "urls": [
127
+ "/blog/*"
128
+ ],
129
+ "weight": 0,
130
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
131
+ }
132
+ ]
133
+ },
134
+ "functions": [
135
+ {
136
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
137
+ "id": "api",
138
+ "type": "function"
139
+ },
140
+ {
141
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
142
+ "id": "other",
143
+ "type": "function"
144
+ },
145
+ {
146
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
147
+ "id": "gate",
148
+ "type": "auth"
149
+ },
150
+ {
151
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
152
+ "id": "rewrite",
153
+ "type": "filter"
154
+ }
155
+ ],
156
+ "request": {
157
+ "method": "GET",
158
+ "url": "https://www.example.com/blog/"
159
+ }
160
+ },
161
+ "expect": {
162
+ "ruleId": null
163
+ }
164
+ },
165
+ {
166
+ "id": "rules-wildcard-is-not-a-bare-prefix",
167
+ "description": "/blog/* does not match /blog.",
168
+ "tags": [
169
+ "rules"
170
+ ],
171
+ "op": "matchRule",
172
+ "input": {
173
+ "rules": {
174
+ "version": 1,
175
+ "namespace": "conformance",
176
+ "rules": [
177
+ {
178
+ "id": "blog",
179
+ "type": "function",
180
+ "urls": [
181
+ "/blog/*"
182
+ ],
183
+ "weight": 0,
184
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
185
+ }
186
+ ]
187
+ },
188
+ "functions": [
189
+ {
190
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
191
+ "id": "api",
192
+ "type": "function"
193
+ },
194
+ {
195
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
196
+ "id": "other",
197
+ "type": "function"
198
+ },
199
+ {
200
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
201
+ "id": "gate",
202
+ "type": "auth"
203
+ },
204
+ {
205
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
206
+ "id": "rewrite",
207
+ "type": "filter"
208
+ }
209
+ ],
210
+ "request": {
211
+ "method": "GET",
212
+ "url": "https://www.example.com/blog"
213
+ }
214
+ },
215
+ "expect": {
216
+ "ruleId": null
217
+ }
218
+ },
219
+ {
220
+ "id": "rules-slash-star-does-not-match-the-root",
221
+ "description": "The pattern /* needs a character after /, so it does not match /.",
222
+ "tags": [
223
+ "rules"
224
+ ],
225
+ "op": "matchRule",
226
+ "input": {
227
+ "rules": {
228
+ "version": 1,
229
+ "namespace": "conformance",
230
+ "rules": [
231
+ {
232
+ "id": "all",
233
+ "type": "function",
234
+ "urls": [
235
+ "/*"
236
+ ],
237
+ "weight": 0,
238
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
239
+ }
240
+ ]
241
+ },
242
+ "functions": [
243
+ {
244
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
245
+ "id": "api",
246
+ "type": "function"
247
+ },
248
+ {
249
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
250
+ "id": "other",
251
+ "type": "function"
252
+ },
253
+ {
254
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
255
+ "id": "gate",
256
+ "type": "auth"
257
+ },
258
+ {
259
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
260
+ "id": "rewrite",
261
+ "type": "filter"
262
+ }
263
+ ],
264
+ "request": {
265
+ "method": "GET",
266
+ "url": "https://www.example.com/"
267
+ }
268
+ },
269
+ "expect": {
270
+ "ruleId": null
271
+ }
272
+ },
273
+ {
274
+ "id": "rules-root-and-slash-star-match-every-path",
275
+ "description": "The patterns / and /* together match every path.",
276
+ "tags": [
277
+ "rules"
278
+ ],
279
+ "op": "matchRule",
280
+ "input": {
281
+ "rules": {
282
+ "version": 1,
283
+ "namespace": "conformance",
284
+ "rules": [
285
+ {
286
+ "id": "all",
287
+ "type": "function",
288
+ "urls": [
289
+ "/",
290
+ "/*"
291
+ ],
292
+ "weight": 0,
293
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
294
+ }
295
+ ]
296
+ },
297
+ "functions": [
298
+ {
299
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
300
+ "id": "api",
301
+ "type": "function"
302
+ },
303
+ {
304
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
305
+ "id": "other",
306
+ "type": "function"
307
+ },
308
+ {
309
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
310
+ "id": "gate",
311
+ "type": "auth"
312
+ },
313
+ {
314
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
315
+ "id": "rewrite",
316
+ "type": "filter"
317
+ }
318
+ ],
319
+ "request": {
320
+ "method": "GET",
321
+ "url": "https://www.example.com/"
322
+ }
323
+ },
324
+ "expect": {
325
+ "ruleId": "all"
326
+ }
327
+ },
328
+ {
329
+ "id": "rules-wildcard-in-the-middle",
330
+ "description": "A * can stand for one segment in the middle of a pattern.",
331
+ "tags": [
332
+ "rules"
333
+ ],
334
+ "op": "matchRule",
335
+ "input": {
336
+ "rules": {
337
+ "version": 1,
338
+ "namespace": "conformance",
339
+ "rules": [
340
+ {
341
+ "id": "cart",
342
+ "type": "function",
343
+ "urls": [
344
+ "/shop/*/cart"
345
+ ],
346
+ "weight": 0,
347
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
348
+ }
349
+ ]
350
+ },
351
+ "functions": [
352
+ {
353
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
354
+ "id": "api",
355
+ "type": "function"
356
+ },
357
+ {
358
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
359
+ "id": "other",
360
+ "type": "function"
361
+ },
362
+ {
363
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
364
+ "id": "gate",
365
+ "type": "auth"
366
+ },
367
+ {
368
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
369
+ "id": "rewrite",
370
+ "type": "filter"
371
+ }
372
+ ],
373
+ "request": {
374
+ "method": "GET",
375
+ "url": "https://www.example.com/shop/au/cart"
376
+ }
377
+ },
378
+ "expect": {
379
+ "ruleId": "cart"
380
+ }
381
+ },
382
+ {
383
+ "id": "rules-pattern-is-case-insensitive",
384
+ "description": "A pattern with capitals matches a lowercase path.",
385
+ "tags": [
386
+ "rules"
387
+ ],
388
+ "op": "matchRule",
389
+ "input": {
390
+ "rules": {
391
+ "version": 1,
392
+ "namespace": "conformance",
393
+ "rules": [
394
+ {
395
+ "id": "docs",
396
+ "type": "function",
397
+ "urls": [
398
+ "/Docs/*"
399
+ ],
400
+ "weight": 0,
401
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
402
+ }
403
+ ]
404
+ },
405
+ "functions": [
406
+ {
407
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
408
+ "id": "api",
409
+ "type": "function"
410
+ },
411
+ {
412
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
413
+ "id": "other",
414
+ "type": "function"
415
+ },
416
+ {
417
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
418
+ "id": "gate",
419
+ "type": "auth"
420
+ },
421
+ {
422
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
423
+ "id": "rewrite",
424
+ "type": "filter"
425
+ }
426
+ ],
427
+ "request": {
428
+ "method": "GET",
429
+ "url": "https://www.example.com/docs/getting-started"
430
+ }
431
+ },
432
+ "expect": {
433
+ "ruleId": "docs"
434
+ }
435
+ },
436
+ {
437
+ "id": "rules-path-is-case-insensitive",
438
+ "description": "A lowercase pattern matches a path with capitals.",
439
+ "tags": [
440
+ "rules"
441
+ ],
442
+ "op": "matchRule",
443
+ "input": {
444
+ "rules": {
445
+ "version": 1,
446
+ "namespace": "conformance",
447
+ "rules": [
448
+ {
449
+ "id": "docs",
450
+ "type": "function",
451
+ "urls": [
452
+ "/docs/*"
453
+ ],
454
+ "weight": 0,
455
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
456
+ }
457
+ ]
458
+ },
459
+ "functions": [
460
+ {
461
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
462
+ "id": "api",
463
+ "type": "function"
464
+ },
465
+ {
466
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
467
+ "id": "other",
468
+ "type": "function"
469
+ },
470
+ {
471
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
472
+ "id": "gate",
473
+ "type": "auth"
474
+ },
475
+ {
476
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
477
+ "id": "rewrite",
478
+ "type": "filter"
479
+ }
480
+ ],
481
+ "request": {
482
+ "method": "GET",
483
+ "url": "https://www.example.com/DOCS/Intro"
484
+ }
485
+ },
486
+ "expect": {
487
+ "ruleId": "docs"
488
+ }
489
+ },
490
+ {
491
+ "id": "rules-pattern-is-anchored-at-the-start",
492
+ "description": "A pattern matches from the start of the path.",
493
+ "tags": [
494
+ "rules"
495
+ ],
496
+ "op": "matchRule",
497
+ "input": {
498
+ "rules": {
499
+ "version": 1,
500
+ "namespace": "conformance",
501
+ "rules": [
502
+ {
503
+ "id": "api",
504
+ "type": "function",
505
+ "urls": [
506
+ "/api/*"
507
+ ],
508
+ "weight": 0,
509
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
510
+ }
511
+ ]
512
+ },
513
+ "functions": [
514
+ {
515
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
516
+ "id": "api",
517
+ "type": "function"
518
+ },
519
+ {
520
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
521
+ "id": "other",
522
+ "type": "function"
523
+ },
524
+ {
525
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
526
+ "id": "gate",
527
+ "type": "auth"
528
+ },
529
+ {
530
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
531
+ "id": "rewrite",
532
+ "type": "filter"
533
+ }
534
+ ],
535
+ "request": {
536
+ "method": "GET",
537
+ "url": "https://www.example.com/v1/api/users"
538
+ }
539
+ },
540
+ "expect": {
541
+ "ruleId": null
542
+ }
543
+ },
544
+ {
545
+ "id": "rules-pattern-is-anchored-at-the-end",
546
+ "description": "A pattern without * matches the whole path only.",
547
+ "tags": [
548
+ "rules"
549
+ ],
550
+ "op": "matchRule",
551
+ "input": {
552
+ "rules": {
553
+ "version": 1,
554
+ "namespace": "conformance",
555
+ "rules": [
556
+ {
557
+ "id": "api",
558
+ "type": "function",
559
+ "urls": [
560
+ "/api"
561
+ ],
562
+ "weight": 0,
563
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
564
+ }
565
+ ]
566
+ },
567
+ "functions": [
568
+ {
569
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
570
+ "id": "api",
571
+ "type": "function"
572
+ },
573
+ {
574
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
575
+ "id": "other",
576
+ "type": "function"
577
+ },
578
+ {
579
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
580
+ "id": "gate",
581
+ "type": "auth"
582
+ },
583
+ {
584
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
585
+ "id": "rewrite",
586
+ "type": "filter"
587
+ }
588
+ ],
589
+ "request": {
590
+ "method": "GET",
591
+ "url": "https://www.example.com/api/users"
592
+ }
593
+ },
594
+ "expect": {
595
+ "ruleId": null
596
+ }
597
+ },
598
+ {
599
+ "id": "rules-exact-path",
600
+ "description": "A pattern without * matches the same path.",
601
+ "tags": [
602
+ "rules"
603
+ ],
604
+ "op": "matchRule",
605
+ "input": {
606
+ "rules": {
607
+ "version": 1,
608
+ "namespace": "conformance",
609
+ "rules": [
610
+ {
611
+ "id": "data",
612
+ "type": "function",
613
+ "urls": [
614
+ "/data.json"
615
+ ],
616
+ "weight": 0,
617
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
618
+ }
619
+ ]
620
+ },
621
+ "functions": [
622
+ {
623
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
624
+ "id": "api",
625
+ "type": "function"
626
+ },
627
+ {
628
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
629
+ "id": "other",
630
+ "type": "function"
631
+ },
632
+ {
633
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
634
+ "id": "gate",
635
+ "type": "auth"
636
+ },
637
+ {
638
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
639
+ "id": "rewrite",
640
+ "type": "filter"
641
+ }
642
+ ],
643
+ "request": {
644
+ "method": "GET",
645
+ "url": "https://www.example.com/data.json"
646
+ }
647
+ },
648
+ "expect": {
649
+ "ruleId": "data"
650
+ }
651
+ },
652
+ {
653
+ "id": "rules-pattern-characters-are-literal",
654
+ "description": "Characters other than * have no special meaning: . matches only a dot.",
655
+ "tags": [
656
+ "rules"
657
+ ],
658
+ "op": "matchRule",
659
+ "input": {
660
+ "rules": {
661
+ "version": 1,
662
+ "namespace": "conformance",
663
+ "rules": [
664
+ {
665
+ "id": "data",
666
+ "type": "function",
667
+ "urls": [
668
+ "/data.json"
669
+ ],
670
+ "weight": 0,
671
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
672
+ }
673
+ ]
674
+ },
675
+ "functions": [
676
+ {
677
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
678
+ "id": "api",
679
+ "type": "function"
680
+ },
681
+ {
682
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
683
+ "id": "other",
684
+ "type": "function"
685
+ },
686
+ {
687
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
688
+ "id": "gate",
689
+ "type": "auth"
690
+ },
691
+ {
692
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
693
+ "id": "rewrite",
694
+ "type": "filter"
695
+ }
696
+ ],
697
+ "request": {
698
+ "method": "GET",
699
+ "url": "https://www.example.com/dataxjson"
700
+ }
701
+ },
702
+ "expect": {
703
+ "ruleId": null
704
+ }
705
+ },
706
+ {
707
+ "id": "rules-query-pattern-matches-the-query",
708
+ "description": "A pattern that contains ? is tested against the path and the query.",
709
+ "tags": [
710
+ "rules"
711
+ ],
712
+ "op": "matchRule",
713
+ "input": {
714
+ "rules": {
715
+ "version": 1,
716
+ "namespace": "conformance",
717
+ "rules": [
718
+ {
719
+ "id": "search",
720
+ "type": "function",
721
+ "urls": [
722
+ "/search?q=*"
723
+ ],
724
+ "weight": 0,
725
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
726
+ }
727
+ ]
728
+ },
729
+ "functions": [
730
+ {
731
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
732
+ "id": "api",
733
+ "type": "function"
734
+ },
735
+ {
736
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
737
+ "id": "other",
738
+ "type": "function"
739
+ },
740
+ {
741
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
742
+ "id": "gate",
743
+ "type": "auth"
744
+ },
745
+ {
746
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
747
+ "id": "rewrite",
748
+ "type": "filter"
749
+ }
750
+ ],
751
+ "request": {
752
+ "method": "GET",
753
+ "url": "https://www.example.com/search?q=edge"
754
+ }
755
+ },
756
+ "expect": {
757
+ "ruleId": "search"
758
+ }
759
+ },
760
+ {
761
+ "id": "rules-query-pattern-needs-the-query",
762
+ "description": "A query pattern does not match the path without a query.",
763
+ "tags": [
764
+ "rules"
765
+ ],
766
+ "op": "matchRule",
767
+ "input": {
768
+ "rules": {
769
+ "version": 1,
770
+ "namespace": "conformance",
771
+ "rules": [
772
+ {
773
+ "id": "search",
774
+ "type": "function",
775
+ "urls": [
776
+ "/search?q=*"
777
+ ],
778
+ "weight": 0,
779
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
780
+ }
781
+ ]
782
+ },
783
+ "functions": [
784
+ {
785
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
786
+ "id": "api",
787
+ "type": "function"
788
+ },
789
+ {
790
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
791
+ "id": "other",
792
+ "type": "function"
793
+ },
794
+ {
795
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
796
+ "id": "gate",
797
+ "type": "auth"
798
+ },
799
+ {
800
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
801
+ "id": "rewrite",
802
+ "type": "filter"
803
+ }
804
+ ],
805
+ "request": {
806
+ "method": "GET",
807
+ "url": "https://www.example.com/search"
808
+ }
809
+ },
810
+ "expect": {
811
+ "ruleId": null
812
+ }
813
+ },
814
+ {
815
+ "id": "rules-path-pattern-ignores-the-query",
816
+ "description": "A pattern without ? is tested against the path only.",
817
+ "tags": [
818
+ "rules"
819
+ ],
820
+ "op": "matchRule",
821
+ "input": {
822
+ "rules": {
823
+ "version": 1,
824
+ "namespace": "conformance",
825
+ "rules": [
826
+ {
827
+ "id": "search",
828
+ "type": "function",
829
+ "urls": [
830
+ "/search"
831
+ ],
832
+ "weight": 0,
833
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
834
+ }
835
+ ]
836
+ },
837
+ "functions": [
838
+ {
839
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
840
+ "id": "api",
841
+ "type": "function"
842
+ },
843
+ {
844
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
845
+ "id": "other",
846
+ "type": "function"
847
+ },
848
+ {
849
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
850
+ "id": "gate",
851
+ "type": "auth"
852
+ },
853
+ {
854
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
855
+ "id": "rewrite",
856
+ "type": "filter"
857
+ }
858
+ ],
859
+ "request": {
860
+ "method": "GET",
861
+ "url": "https://www.example.com/search?q=edge"
862
+ }
863
+ },
864
+ "expect": {
865
+ "ruleId": "search"
866
+ }
867
+ },
868
+ {
869
+ "id": "rules-index-html-form",
870
+ "description": "A request for /about/index.html matches the pattern /about.",
871
+ "tags": [
872
+ "rules",
873
+ "unverified"
874
+ ],
875
+ "op": "matchRule",
876
+ "input": {
877
+ "rules": {
878
+ "version": 1,
879
+ "namespace": "conformance",
880
+ "rules": [
881
+ {
882
+ "id": "about",
883
+ "type": "function",
884
+ "urls": [
885
+ "/about"
886
+ ],
887
+ "weight": 0,
888
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
889
+ }
890
+ ]
891
+ },
892
+ "functions": [
893
+ {
894
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
895
+ "id": "api",
896
+ "type": "function"
897
+ },
898
+ {
899
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
900
+ "id": "other",
901
+ "type": "function"
902
+ },
903
+ {
904
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
905
+ "id": "gate",
906
+ "type": "auth"
907
+ },
908
+ {
909
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
910
+ "id": "rewrite",
911
+ "type": "filter"
912
+ }
913
+ ],
914
+ "request": {
915
+ "method": "GET",
916
+ "url": "https://www.example.com/about/index.html"
917
+ }
918
+ },
919
+ "expect": {
920
+ "ruleId": "about"
921
+ }
922
+ },
923
+ {
924
+ "id": "rules-any-url-in-the-list",
925
+ "description": "A rule matches when any of its URL patterns matches.",
926
+ "tags": [
927
+ "rules"
928
+ ],
929
+ "op": "matchRule",
930
+ "input": {
931
+ "rules": {
932
+ "version": 1,
933
+ "namespace": "conformance",
934
+ "rules": [
935
+ {
936
+ "id": "content",
937
+ "type": "function",
938
+ "urls": [
939
+ "/news/*",
940
+ "/blog/*"
941
+ ],
942
+ "weight": 0,
943
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
944
+ }
945
+ ]
946
+ },
947
+ "functions": [
948
+ {
949
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
950
+ "id": "api",
951
+ "type": "function"
952
+ },
953
+ {
954
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
955
+ "id": "other",
956
+ "type": "function"
957
+ },
958
+ {
959
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
960
+ "id": "gate",
961
+ "type": "auth"
962
+ },
963
+ {
964
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
965
+ "id": "rewrite",
966
+ "type": "filter"
967
+ }
968
+ ],
969
+ "request": {
970
+ "method": "GET",
971
+ "url": "https://www.example.com/blog/post"
972
+ }
973
+ },
974
+ "expect": {
975
+ "ruleId": "content"
976
+ }
977
+ },
978
+ {
979
+ "id": "rules-domain-exact-host",
980
+ "description": "A rule domain matches the same host.",
981
+ "tags": [
982
+ "rules"
983
+ ],
984
+ "op": "matchRule",
985
+ "input": {
986
+ "rules": {
987
+ "version": 1,
988
+ "namespace": "conformance",
989
+ "rules": [
990
+ {
991
+ "id": "site",
992
+ "type": "function",
993
+ "urls": [
994
+ "/",
995
+ "/*"
996
+ ],
997
+ "weight": 0,
998
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001",
999
+ "domains": [
1000
+ "www.example.com"
1001
+ ]
1002
+ }
1003
+ ]
1004
+ },
1005
+ "functions": [
1006
+ {
1007
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1008
+ "id": "api",
1009
+ "type": "function"
1010
+ },
1011
+ {
1012
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1013
+ "id": "other",
1014
+ "type": "function"
1015
+ },
1016
+ {
1017
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1018
+ "id": "gate",
1019
+ "type": "auth"
1020
+ },
1021
+ {
1022
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1023
+ "id": "rewrite",
1024
+ "type": "filter"
1025
+ }
1026
+ ],
1027
+ "request": {
1028
+ "method": "GET",
1029
+ "url": "https://www.example.com/page"
1030
+ }
1031
+ },
1032
+ "expect": {
1033
+ "ruleId": "site"
1034
+ }
1035
+ },
1036
+ {
1037
+ "id": "rules-domain-ignores-the-port",
1038
+ "description": "The port of the request host is not part of the domain match.",
1039
+ "tags": [
1040
+ "rules"
1041
+ ],
1042
+ "op": "matchRule",
1043
+ "input": {
1044
+ "rules": {
1045
+ "version": 1,
1046
+ "namespace": "conformance",
1047
+ "rules": [
1048
+ {
1049
+ "id": "site",
1050
+ "type": "function",
1051
+ "urls": [
1052
+ "/",
1053
+ "/*"
1054
+ ],
1055
+ "weight": 0,
1056
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1057
+ "domains": [
1058
+ "www.example.com"
1059
+ ]
1060
+ }
1061
+ ]
1062
+ },
1063
+ "functions": [
1064
+ {
1065
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1066
+ "id": "api",
1067
+ "type": "function"
1068
+ },
1069
+ {
1070
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1071
+ "id": "other",
1072
+ "type": "function"
1073
+ },
1074
+ {
1075
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1076
+ "id": "gate",
1077
+ "type": "auth"
1078
+ },
1079
+ {
1080
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1081
+ "id": "rewrite",
1082
+ "type": "filter"
1083
+ }
1084
+ ],
1085
+ "request": {
1086
+ "method": "GET",
1087
+ "url": "http://www.example.com:8080/page"
1088
+ }
1089
+ },
1090
+ "expect": {
1091
+ "ruleId": "site"
1092
+ }
1093
+ },
1094
+ {
1095
+ "id": "rules-domain-other-host",
1096
+ "description": "A rule domain does not match a different host.",
1097
+ "tags": [
1098
+ "rules"
1099
+ ],
1100
+ "op": "matchRule",
1101
+ "input": {
1102
+ "rules": {
1103
+ "version": 1,
1104
+ "namespace": "conformance",
1105
+ "rules": [
1106
+ {
1107
+ "id": "site",
1108
+ "type": "function",
1109
+ "urls": [
1110
+ "/",
1111
+ "/*"
1112
+ ],
1113
+ "weight": 0,
1114
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1115
+ "domains": [
1116
+ "www.example.com"
1117
+ ]
1118
+ }
1119
+ ]
1120
+ },
1121
+ "functions": [
1122
+ {
1123
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1124
+ "id": "api",
1125
+ "type": "function"
1126
+ },
1127
+ {
1128
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1129
+ "id": "other",
1130
+ "type": "function"
1131
+ },
1132
+ {
1133
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1134
+ "id": "gate",
1135
+ "type": "auth"
1136
+ },
1137
+ {
1138
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1139
+ "id": "rewrite",
1140
+ "type": "filter"
1141
+ }
1142
+ ],
1143
+ "request": {
1144
+ "method": "GET",
1145
+ "url": "https://shop.example.com/page"
1146
+ }
1147
+ },
1148
+ "expect": {
1149
+ "ruleId": null
1150
+ }
1151
+ },
1152
+ {
1153
+ "id": "rules-domain-is-not-a-suffix",
1154
+ "description": "A rule domain is an exact host name, not a suffix.",
1155
+ "tags": [
1156
+ "rules"
1157
+ ],
1158
+ "op": "matchRule",
1159
+ "input": {
1160
+ "rules": {
1161
+ "version": 1,
1162
+ "namespace": "conformance",
1163
+ "rules": [
1164
+ {
1165
+ "id": "site",
1166
+ "type": "function",
1167
+ "urls": [
1168
+ "/",
1169
+ "/*"
1170
+ ],
1171
+ "weight": 0,
1172
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1173
+ "domains": [
1174
+ "example.com"
1175
+ ]
1176
+ }
1177
+ ]
1178
+ },
1179
+ "functions": [
1180
+ {
1181
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1182
+ "id": "api",
1183
+ "type": "function"
1184
+ },
1185
+ {
1186
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1187
+ "id": "other",
1188
+ "type": "function"
1189
+ },
1190
+ {
1191
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1192
+ "id": "gate",
1193
+ "type": "auth"
1194
+ },
1195
+ {
1196
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1197
+ "id": "rewrite",
1198
+ "type": "filter"
1199
+ }
1200
+ ],
1201
+ "request": {
1202
+ "method": "GET",
1203
+ "url": "https://www.example.com/page"
1204
+ }
1205
+ },
1206
+ "expect": {
1207
+ "ruleId": null
1208
+ }
1209
+ },
1210
+ {
1211
+ "id": "rules-domain-any",
1212
+ "description": "The domain any matches every host.",
1213
+ "tags": [
1214
+ "rules"
1215
+ ],
1216
+ "op": "matchRule",
1217
+ "input": {
1218
+ "rules": {
1219
+ "version": 1,
1220
+ "namespace": "conformance",
1221
+ "rules": [
1222
+ {
1223
+ "id": "site",
1224
+ "type": "function",
1225
+ "urls": [
1226
+ "/",
1227
+ "/*"
1228
+ ],
1229
+ "weight": 0,
1230
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1231
+ "domains": [
1232
+ "any"
1233
+ ]
1234
+ }
1235
+ ]
1236
+ },
1237
+ "functions": [
1238
+ {
1239
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1240
+ "id": "api",
1241
+ "type": "function"
1242
+ },
1243
+ {
1244
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1245
+ "id": "other",
1246
+ "type": "function"
1247
+ },
1248
+ {
1249
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1250
+ "id": "gate",
1251
+ "type": "auth"
1252
+ },
1253
+ {
1254
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1255
+ "id": "rewrite",
1256
+ "type": "filter"
1257
+ }
1258
+ ],
1259
+ "request": {
1260
+ "method": "GET",
1261
+ "url": "https://shop.example.com/page"
1262
+ }
1263
+ },
1264
+ "expect": {
1265
+ "ruleId": "site"
1266
+ }
1267
+ },
1268
+ {
1269
+ "id": "rules-domain-omitted-matches-every-host",
1270
+ "description": "A rule without domains matches every host.",
1271
+ "tags": [
1272
+ "rules"
1273
+ ],
1274
+ "op": "matchRule",
1275
+ "input": {
1276
+ "rules": {
1277
+ "version": 1,
1278
+ "namespace": "conformance",
1279
+ "rules": [
1280
+ {
1281
+ "id": "site",
1282
+ "type": "function",
1283
+ "urls": [
1284
+ "/",
1285
+ "/*"
1286
+ ],
1287
+ "weight": 0,
1288
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
1289
+ }
1290
+ ]
1291
+ },
1292
+ "functions": [
1293
+ {
1294
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1295
+ "id": "api",
1296
+ "type": "function"
1297
+ },
1298
+ {
1299
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1300
+ "id": "other",
1301
+ "type": "function"
1302
+ },
1303
+ {
1304
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1305
+ "id": "gate",
1306
+ "type": "auth"
1307
+ },
1308
+ {
1309
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1310
+ "id": "rewrite",
1311
+ "type": "filter"
1312
+ }
1313
+ ],
1314
+ "request": {
1315
+ "method": "GET",
1316
+ "url": "https://shop.example.com/page"
1317
+ }
1318
+ },
1319
+ "expect": {
1320
+ "ruleId": "site"
1321
+ }
1322
+ },
1323
+ {
1324
+ "id": "rules-domain-is-case-insensitive",
1325
+ "description": "A rule domain with capitals matches the lowercase host.",
1326
+ "tags": [
1327
+ "rules",
1328
+ "unverified"
1329
+ ],
1330
+ "op": "matchRule",
1331
+ "input": {
1332
+ "rules": {
1333
+ "version": 1,
1334
+ "namespace": "conformance",
1335
+ "rules": [
1336
+ {
1337
+ "id": "site",
1338
+ "type": "function",
1339
+ "urls": [
1340
+ "/",
1341
+ "/*"
1342
+ ],
1343
+ "weight": 0,
1344
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1345
+ "domains": [
1346
+ "WWW.Example.com"
1347
+ ]
1348
+ }
1349
+ ]
1350
+ },
1351
+ "functions": [
1352
+ {
1353
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1354
+ "id": "api",
1355
+ "type": "function"
1356
+ },
1357
+ {
1358
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1359
+ "id": "other",
1360
+ "type": "function"
1361
+ },
1362
+ {
1363
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1364
+ "id": "gate",
1365
+ "type": "auth"
1366
+ },
1367
+ {
1368
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1369
+ "id": "rewrite",
1370
+ "type": "filter"
1371
+ }
1372
+ ],
1373
+ "request": {
1374
+ "method": "GET",
1375
+ "url": "https://www.example.com/page"
1376
+ }
1377
+ },
1378
+ "expect": {
1379
+ "ruleId": "site"
1380
+ }
1381
+ },
1382
+ {
1383
+ "id": "rules-method-listed",
1384
+ "description": "A rule with methods matches a listed method.",
1385
+ "tags": [
1386
+ "rules"
1387
+ ],
1388
+ "op": "matchRule",
1389
+ "input": {
1390
+ "rules": {
1391
+ "version": 1,
1392
+ "namespace": "conformance",
1393
+ "rules": [
1394
+ {
1395
+ "id": "submit",
1396
+ "type": "function",
1397
+ "urls": [
1398
+ "/form"
1399
+ ],
1400
+ "weight": 0,
1401
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1402
+ "methods": [
1403
+ "POST"
1404
+ ]
1405
+ }
1406
+ ]
1407
+ },
1408
+ "functions": [
1409
+ {
1410
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1411
+ "id": "api",
1412
+ "type": "function"
1413
+ },
1414
+ {
1415
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1416
+ "id": "other",
1417
+ "type": "function"
1418
+ },
1419
+ {
1420
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1421
+ "id": "gate",
1422
+ "type": "auth"
1423
+ },
1424
+ {
1425
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1426
+ "id": "rewrite",
1427
+ "type": "filter"
1428
+ }
1429
+ ],
1430
+ "request": {
1431
+ "method": "POST",
1432
+ "url": "https://www.example.com/form"
1433
+ }
1434
+ },
1435
+ "expect": {
1436
+ "ruleId": "submit"
1437
+ }
1438
+ },
1439
+ {
1440
+ "id": "rules-method-not-listed",
1441
+ "description": "A rule with methods does not match a method that is not listed.",
1442
+ "tags": [
1443
+ "rules"
1444
+ ],
1445
+ "op": "matchRule",
1446
+ "input": {
1447
+ "rules": {
1448
+ "version": 1,
1449
+ "namespace": "conformance",
1450
+ "rules": [
1451
+ {
1452
+ "id": "submit",
1453
+ "type": "function",
1454
+ "urls": [
1455
+ "/form"
1456
+ ],
1457
+ "weight": 0,
1458
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1459
+ "methods": [
1460
+ "POST"
1461
+ ]
1462
+ }
1463
+ ]
1464
+ },
1465
+ "functions": [
1466
+ {
1467
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1468
+ "id": "api",
1469
+ "type": "function"
1470
+ },
1471
+ {
1472
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1473
+ "id": "other",
1474
+ "type": "function"
1475
+ },
1476
+ {
1477
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1478
+ "id": "gate",
1479
+ "type": "auth"
1480
+ },
1481
+ {
1482
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1483
+ "id": "rewrite",
1484
+ "type": "filter"
1485
+ }
1486
+ ],
1487
+ "request": {
1488
+ "method": "GET",
1489
+ "url": "https://www.example.com/form"
1490
+ }
1491
+ },
1492
+ "expect": {
1493
+ "ruleId": null
1494
+ }
1495
+ },
1496
+ {
1497
+ "id": "rules-methods-omitted-match-every-method",
1498
+ "description": "A rule without methods matches every method.",
1499
+ "tags": [
1500
+ "rules"
1501
+ ],
1502
+ "op": "matchRule",
1503
+ "input": {
1504
+ "rules": {
1505
+ "version": 1,
1506
+ "namespace": "conformance",
1507
+ "rules": [
1508
+ {
1509
+ "id": "item",
1510
+ "type": "function",
1511
+ "urls": [
1512
+ "/item"
1513
+ ],
1514
+ "weight": 0,
1515
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
1516
+ }
1517
+ ]
1518
+ },
1519
+ "functions": [
1520
+ {
1521
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1522
+ "id": "api",
1523
+ "type": "function"
1524
+ },
1525
+ {
1526
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1527
+ "id": "other",
1528
+ "type": "function"
1529
+ },
1530
+ {
1531
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1532
+ "id": "gate",
1533
+ "type": "auth"
1534
+ },
1535
+ {
1536
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1537
+ "id": "rewrite",
1538
+ "type": "filter"
1539
+ }
1540
+ ],
1541
+ "request": {
1542
+ "method": "DELETE",
1543
+ "url": "https://www.example.com/item"
1544
+ }
1545
+ },
1546
+ "expect": {
1547
+ "ruleId": "item"
1548
+ }
1549
+ },
1550
+ {
1551
+ "id": "rules-disabled-rule-is-skipped",
1552
+ "description": "A disabled rule never matches; the next matching rule wins.",
1553
+ "tags": [
1554
+ "rules"
1555
+ ],
1556
+ "op": "matchRule",
1557
+ "input": {
1558
+ "rules": {
1559
+ "version": 1,
1560
+ "namespace": "conformance",
1561
+ "rules": [
1562
+ {
1563
+ "id": "off",
1564
+ "type": "function",
1565
+ "urls": [
1566
+ "/page"
1567
+ ],
1568
+ "weight": 0,
1569
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1570
+ "disabled": true
1571
+ },
1572
+ {
1573
+ "id": "on",
1574
+ "type": "function",
1575
+ "urls": [
1576
+ "/page"
1577
+ ],
1578
+ "weight": 0,
1579
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
1580
+ }
1581
+ ]
1582
+ },
1583
+ "functions": [
1584
+ {
1585
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1586
+ "id": "api",
1587
+ "type": "function"
1588
+ },
1589
+ {
1590
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1591
+ "id": "other",
1592
+ "type": "function"
1593
+ },
1594
+ {
1595
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1596
+ "id": "gate",
1597
+ "type": "auth"
1598
+ },
1599
+ {
1600
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1601
+ "id": "rewrite",
1602
+ "type": "filter"
1603
+ }
1604
+ ],
1605
+ "request": {
1606
+ "method": "GET",
1607
+ "url": "https://www.example.com/page"
1608
+ }
1609
+ },
1610
+ "expect": {
1611
+ "ruleId": "on"
1612
+ }
1613
+ },
1614
+ {
1615
+ "id": "rules-lower-weight-runs-first",
1616
+ "description": "Rules run in ascending weight order.",
1617
+ "tags": [
1618
+ "rules"
1619
+ ],
1620
+ "op": "matchRule",
1621
+ "input": {
1622
+ "rules": {
1623
+ "version": 1,
1624
+ "namespace": "conformance",
1625
+ "rules": [
1626
+ {
1627
+ "id": "heavy",
1628
+ "type": "function",
1629
+ "urls": [
1630
+ "/page"
1631
+ ],
1632
+ "weight": 10,
1633
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
1634
+ },
1635
+ {
1636
+ "id": "light",
1637
+ "type": "function",
1638
+ "urls": [
1639
+ "/page"
1640
+ ],
1641
+ "weight": -5,
1642
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
1643
+ }
1644
+ ]
1645
+ },
1646
+ "functions": [
1647
+ {
1648
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1649
+ "id": "api",
1650
+ "type": "function"
1651
+ },
1652
+ {
1653
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1654
+ "id": "other",
1655
+ "type": "function"
1656
+ },
1657
+ {
1658
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1659
+ "id": "gate",
1660
+ "type": "auth"
1661
+ },
1662
+ {
1663
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1664
+ "id": "rewrite",
1665
+ "type": "filter"
1666
+ }
1667
+ ],
1668
+ "request": {
1669
+ "method": "GET",
1670
+ "url": "https://www.example.com/page"
1671
+ }
1672
+ },
1673
+ "expect": {
1674
+ "ruleId": "light"
1675
+ }
1676
+ },
1677
+ {
1678
+ "id": "rules-equal-weight-keeps-manifest-order",
1679
+ "description": "Rules with the same weight keep their manifest order.",
1680
+ "tags": [
1681
+ "rules"
1682
+ ],
1683
+ "op": "matchRule",
1684
+ "input": {
1685
+ "rules": {
1686
+ "version": 1,
1687
+ "namespace": "conformance",
1688
+ "rules": [
1689
+ {
1690
+ "id": "first",
1691
+ "type": "function",
1692
+ "urls": [
1693
+ "/page"
1694
+ ],
1695
+ "weight": 0,
1696
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
1697
+ },
1698
+ {
1699
+ "id": "second",
1700
+ "type": "function",
1701
+ "urls": [
1702
+ "/page"
1703
+ ],
1704
+ "weight": 0,
1705
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
1706
+ }
1707
+ ]
1708
+ },
1709
+ "functions": [
1710
+ {
1711
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1712
+ "id": "api",
1713
+ "type": "function"
1714
+ },
1715
+ {
1716
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1717
+ "id": "other",
1718
+ "type": "function"
1719
+ },
1720
+ {
1721
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1722
+ "id": "gate",
1723
+ "type": "auth"
1724
+ },
1725
+ {
1726
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1727
+ "id": "rewrite",
1728
+ "type": "filter"
1729
+ }
1730
+ ],
1731
+ "request": {
1732
+ "method": "GET",
1733
+ "url": "https://www.example.com/page"
1734
+ }
1735
+ },
1736
+ "expect": {
1737
+ "ruleId": "first"
1738
+ }
1739
+ },
1740
+ {
1741
+ "id": "rules-first-match-wins",
1742
+ "description": "The first matching rule wins, even when a later rule is more specific.",
1743
+ "tags": [
1744
+ "rules"
1745
+ ],
1746
+ "op": "matchRule",
1747
+ "input": {
1748
+ "rules": {
1749
+ "version": 1,
1750
+ "namespace": "conformance",
1751
+ "rules": [
1752
+ {
1753
+ "id": "general",
1754
+ "type": "function",
1755
+ "urls": [
1756
+ "/api/*"
1757
+ ],
1758
+ "weight": 0,
1759
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
1760
+ },
1761
+ {
1762
+ "id": "specific",
1763
+ "type": "function",
1764
+ "urls": [
1765
+ "/api/users"
1766
+ ],
1767
+ "weight": 0,
1768
+ "function_uuid": "a1b2c3d4-0001-4000-8000-000000000001"
1769
+ }
1770
+ ]
1771
+ },
1772
+ "functions": [
1773
+ {
1774
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1775
+ "id": "api",
1776
+ "type": "function"
1777
+ },
1778
+ {
1779
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1780
+ "id": "other",
1781
+ "type": "function"
1782
+ },
1783
+ {
1784
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1785
+ "id": "gate",
1786
+ "type": "auth"
1787
+ },
1788
+ {
1789
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1790
+ "id": "rewrite",
1791
+ "type": "filter"
1792
+ }
1793
+ ],
1794
+ "request": {
1795
+ "method": "GET",
1796
+ "url": "https://www.example.com/api/users"
1797
+ }
1798
+ },
1799
+ "expect": {
1800
+ "ruleId": "general"
1801
+ }
1802
+ },
1803
+ {
1804
+ "id": "rules-filter-rule-does-not-handle-the-request",
1805
+ "description": "A content filter rule does not answer the request, so it is not the matched rule.",
1806
+ "tags": [
1807
+ "rules"
1808
+ ],
1809
+ "op": "matchRule",
1810
+ "input": {
1811
+ "rules": {
1812
+ "version": 1,
1813
+ "namespace": "conformance",
1814
+ "rules": [
1815
+ {
1816
+ "id": "filter",
1817
+ "type": "filter",
1818
+ "urls": [
1819
+ "/",
1820
+ "/*"
1821
+ ],
1822
+ "weight": 0,
1823
+ "function_uuid": "a1b2c3d4-0004-4000-8000-000000000004"
1824
+ }
1825
+ ]
1826
+ },
1827
+ "functions": [
1828
+ {
1829
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1830
+ "id": "api",
1831
+ "type": "function"
1832
+ },
1833
+ {
1834
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1835
+ "id": "other",
1836
+ "type": "function"
1837
+ },
1838
+ {
1839
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1840
+ "id": "gate",
1841
+ "type": "auth"
1842
+ },
1843
+ {
1844
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1845
+ "id": "rewrite",
1846
+ "type": "filter"
1847
+ }
1848
+ ],
1849
+ "request": {
1850
+ "method": "GET",
1851
+ "url": "https://www.example.com/page"
1852
+ }
1853
+ },
1854
+ "expect": {
1855
+ "ruleId": null
1856
+ }
1857
+ },
1858
+ {
1859
+ "id": "rules-auth-rule-matches",
1860
+ "description": "An auth rule matches like a function rule.",
1861
+ "tags": [
1862
+ "rules"
1863
+ ],
1864
+ "op": "matchRule",
1865
+ "input": {
1866
+ "rules": {
1867
+ "version": 1,
1868
+ "namespace": "conformance",
1869
+ "rules": [
1870
+ {
1871
+ "id": "members",
1872
+ "type": "auth",
1873
+ "urls": [
1874
+ "/members/*"
1875
+ ],
1876
+ "weight": 0,
1877
+ "function_uuid": "a1b2c3d4-0003-4000-8000-000000000003"
1878
+ }
1879
+ ]
1880
+ },
1881
+ "functions": [
1882
+ {
1883
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1884
+ "id": "api",
1885
+ "type": "function"
1886
+ },
1887
+ {
1888
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1889
+ "id": "other",
1890
+ "type": "function"
1891
+ },
1892
+ {
1893
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1894
+ "id": "gate",
1895
+ "type": "auth"
1896
+ },
1897
+ {
1898
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1899
+ "id": "rewrite",
1900
+ "type": "filter"
1901
+ }
1902
+ ],
1903
+ "request": {
1904
+ "method": "GET",
1905
+ "url": "https://www.example.com/members/home"
1906
+ }
1907
+ },
1908
+ "expect": {
1909
+ "ruleId": "members"
1910
+ }
1911
+ },
1912
+ {
1913
+ "id": "rules-function-ref",
1914
+ "description": "A rule can name its function with function_ref (the function id in the functions manifest).",
1915
+ "tags": [
1916
+ "rules"
1917
+ ],
1918
+ "op": "matchRule",
1919
+ "input": {
1920
+ "rules": {
1921
+ "version": 1,
1922
+ "namespace": "conformance",
1923
+ "rules": [
1924
+ {
1925
+ "id": "by-ref",
1926
+ "type": "function",
1927
+ "urls": [
1928
+ "/ref/*"
1929
+ ],
1930
+ "weight": 0,
1931
+ "function_ref": "api"
1932
+ }
1933
+ ]
1934
+ },
1935
+ "functions": [
1936
+ {
1937
+ "uuid": "a1b2c3d4-0001-4000-8000-000000000001",
1938
+ "id": "api",
1939
+ "type": "function"
1940
+ },
1941
+ {
1942
+ "uuid": "a1b2c3d4-0002-4000-8000-000000000002",
1943
+ "id": "other",
1944
+ "type": "function"
1945
+ },
1946
+ {
1947
+ "uuid": "a1b2c3d4-0003-4000-8000-000000000003",
1948
+ "id": "gate",
1949
+ "type": "auth"
1950
+ },
1951
+ {
1952
+ "uuid": "a1b2c3d4-0004-4000-8000-000000000004",
1953
+ "id": "rewrite",
1954
+ "type": "filter"
1955
+ }
1956
+ ],
1957
+ "request": {
1958
+ "method": "GET",
1959
+ "url": "https://www.example.com/ref/x"
1960
+ }
1961
+ },
1962
+ "expect": {
1963
+ "ruleId": "by-ref"
1964
+ }
1965
+ }
1966
+ ]
1967
+ }