tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

spec.src.json (13422B)


      1 {
      2  "selection_pattern": "%(source_context_list)s.%(delivery_type)s/%(delivery_value)s/%(subresource)s/%(origin)s.%(redirection)s.%(source_scheme)s",
      3  "test_file_path_pattern": "gen/%(source_context_list)s.%(delivery_type)s/%(delivery_value)s/%(subresource)s.%(source_scheme)s.html",
      4  "excluded_tests": [
      5    {
      6      // Workers are same-origin only
      7      "expansion": "*",
      8      "source_scheme": "*",
      9      "source_context_list": "*",
     10      "delivery_type": "*",
     11      "delivery_value": "*",
     12      "redirection": "*",
     13      "subresource": [
     14        "worker-classic",
     15        "worker-module",
     16        "sharedworker-classic",
     17        "sharedworker-module"
     18      ],
     19      "origin": [
     20        "cross-https",
     21        "cross-http",
     22        "cross-http-downgrade",
     23        "cross-wss",
     24        "cross-ws",
     25        "cross-ws-downgrade"
     26      ],
     27      "expectation": "*"
     28    },
     29    {
     30      // Workers are same-origin only (redirects)
     31      "expansion": "*",
     32      "source_scheme": "*",
     33      "source_context_list": "*",
     34      "delivery_type": "*",
     35      "delivery_value": "*",
     36      "redirection": [
     37        "swap-origin",
     38        "swap-scheme"
     39      ],
     40      "subresource": [
     41        "worker-classic",
     42        "worker-module",
     43        "sharedworker-classic",
     44        "sharedworker-module"
     45      ],
     46      "origin": "*",
     47      "expectation": "*"
     48    },
     49    {
     50      // Websockets are ws/wss-only
     51      "expansion": "*",
     52      "source_scheme": "*",
     53      "source_context_list": "*",
     54      "delivery_type": "*",
     55      "delivery_value": "*",
     56      "redirection": "*",
     57      "subresource": "websocket",
     58      "origin": [
     59        "same-https",
     60        "same-http",
     61        "same-http-downgrade",
     62        "cross-https",
     63        "cross-http",
     64        "cross-http-downgrade"
     65      ],
     66      "expectation": "*"
     67    },
     68    {
     69      // Redirects are intentionally forbidden in browsers:
     70      // https://fetch.spec.whatwg.org/#concept-websocket-establish
     71      // Websockets are no-redirect only
     72      "expansion": "*",
     73      "source_scheme": "*",
     74      "source_context_list": "*",
     75      "delivery_type": "*",
     76      "delivery_value": "*",
     77      "redirection": [
     78        "keep-origin",
     79        "swap-origin",
     80        "keep-scheme",
     81        "swap-scheme",
     82        "downgrade"
     83      ],
     84      "subresource": "websocket",
     85      "origin": "*",
     86      "expectation": "*"
     87    },
     88    {
     89      // ws/wss are websocket-only
     90      "expansion": "*",
     91      "source_scheme": "*",
     92      "source_context_list": "*",
     93      "delivery_type": "*",
     94      "delivery_value": "*",
     95      "redirection": "*",
     96      "subresource": [
     97        "a-tag",
     98        "area-tag",
     99        "audio-tag",
    100        "beacon",
    101        "fetch",
    102        "iframe-tag",
    103        "img-tag",
    104        "link-css-tag",
    105        "link-prefetch-tag",
    106        "object-tag",
    107        "picture-tag",
    108        "script-tag",
    109        "script-tag-dynamic-import",
    110        "sharedworker-classic",
    111        "sharedworker-import",
    112        "sharedworker-import-data",
    113        "sharedworker-module",
    114        "svg-a-tag",
    115        "video-tag",
    116        "worker-classic",
    117        "worker-import",
    118        "worker-import-data",
    119        "worker-module",
    120        "worklet-animation",
    121        "worklet-animation-import-data",
    122        "worklet-audio",
    123        "worklet-audio-import-data",
    124        "worklet-layout",
    125        "worklet-layout-import-data",
    126        "worklet-paint",
    127        "worklet-paint-import-data",
    128        "xhr"
    129      ],
    130      "origin": [
    131        "same-wss",
    132        "same-ws",
    133        "same-ws-downgrade",
    134        "cross-wss",
    135        "cross-ws",
    136        "cross-ws-downgrade"
    137      ],
    138      "expectation": "*"
    139    },
    140    {
    141      // Worklets are HTTPS contexts only
    142      "expansion": "*",
    143      "source_scheme": "http",
    144      "source_context_list": "*",
    145      "delivery_type": "*",
    146      "delivery_value": "*",
    147      "redirection": "*",
    148      "subresource": [
    149        "worklet-animation",
    150        "worklet-animation-import-data",
    151        "worklet-audio",
    152        "worklet-audio-import-data",
    153        "worklet-layout",
    154        "worklet-layout-import-data",
    155        "worklet-paint",
    156        "worklet-paint-import-data"
    157      ],
    158      "origin": "*",
    159      "expectation": "*"
    160    }
    161  ],
    162  "source_context_schema": {
    163    "supported_subresource": {
    164      "top": "*",
    165      "iframe": "*",
    166      "iframe-blank": "*",
    167      "srcdoc": "*",
    168      "worker-classic": [
    169        "xhr",
    170        "fetch",
    171        "websocket",
    172        "worker-classic",
    173        "worker-module"
    174      ],
    175      "worker-module": [
    176        "xhr",
    177        "fetch",
    178        "websocket",
    179        "worker-classic",
    180        "worker-module"
    181      ],
    182      "worker-classic-data": [
    183        "xhr",
    184        "fetch",
    185        "websocket"
    186      ],
    187      "worker-module-data": [
    188        "xhr",
    189        "fetch",
    190        "websocket"
    191      ],
    192      "sharedworker-classic": [
    193        "xhr",
    194        "fetch",
    195        "websocket"
    196      ],
    197      "sharedworker-module": [
    198        "xhr",
    199        "fetch",
    200        "websocket"
    201      ],
    202      "sharedworker-classic-data": [
    203        "xhr",
    204        "fetch",
    205        "websocket"
    206      ],
    207      "sharedworker-module-data": [
    208        "xhr",
    209        "fetch",
    210        "websocket"
    211      ]
    212    }
    213  },
    214  "source_context_list_schema": {
    215    // Warning: Currently, some nested patterns of contexts have different
    216    // inheritance rules for different kinds of policies.
    217    // The generated tests will be used to test/investigate the policy
    218    // inheritance rules, and eventually the policy inheritance rules will
    219    // be unified (https://github.com/w3ctag/design-principles/issues/111).
    220    "top": {
    221      "description": "Policy set by the top-level Document",
    222      "sourceContextList": [
    223        {
    224          "sourceContextType": "top",
    225          "policyDeliveries": [
    226            "policy"
    227          ]
    228        }
    229      ],
    230      "subresourcePolicyDeliveries": []
    231    },
    232    "req": {
    233      "description": "Subresource request's policy should override Document's policy",
    234      "sourceContextList": [
    235        {
    236          "sourceContextType": "top",
    237          "policyDeliveries": [
    238            "anotherPolicy"
    239          ]
    240        }
    241      ],
    242      "subresourcePolicyDeliveries": [
    243        "nonNullPolicy"
    244      ]
    245    },
    246    "srcdoc-inherit": {
    247      "description": "srcdoc iframe without its own policy should inherit parent Document's policy",
    248      "sourceContextList": [
    249        {
    250          "sourceContextType": "top",
    251          "policyDeliveries": [
    252            "policy"
    253          ]
    254        },
    255        {
    256          "sourceContextType": "srcdoc"
    257        }
    258      ],
    259      "subresourcePolicyDeliveries": []
    260    },
    261    "srcdoc": {
    262      "description": "srcdoc iframe's policy should override parent Document's policy",
    263      "sourceContextList": [
    264        {
    265          "sourceContextType": "top",
    266          "policyDeliveries": [
    267            "anotherPolicy"
    268          ]
    269        },
    270        {
    271          "sourceContextType": "srcdoc",
    272          "policyDeliveries": [
    273            "nonNullPolicy"
    274          ]
    275        }
    276      ],
    277      "subresourcePolicyDeliveries": []
    278    },
    279    "iframe": {
    280      "description": "external iframe's policy should override parent Document's policy",
    281      "sourceContextList": [
    282        {
    283          "sourceContextType": "top",
    284          "policyDeliveries": [
    285            "anotherPolicy"
    286          ]
    287        },
    288        {
    289          "sourceContextType": "iframe",
    290          "policyDeliveries": [
    291            "policy"
    292          ]
    293        }
    294      ],
    295      "subresourcePolicyDeliveries": []
    296    },
    297    "iframe-blank-inherit": {
    298      "description": "blank iframe should inherit parent Document's policy",
    299      "sourceContextList": [
    300        {
    301          "sourceContextType": "top",
    302          "policyDeliveries": [
    303            "policy"
    304          ]
    305        },
    306        {
    307          "sourceContextType": "iframe-blank"
    308        }
    309      ],
    310      "subresourcePolicyDeliveries": []
    311    },
    312    "worker-classic": {
    313      // This is applicable to referrer-policy tests.
    314      // Use "worker-classic-inherit" for CSP (mixed-content, etc.).
    315      "description": "dedicated workers shouldn't inherit its parent's policy.",
    316      "sourceContextList": [
    317        {
    318          "sourceContextType": "top",
    319          "policyDeliveries": [
    320            "anotherPolicy"
    321          ]
    322        },
    323        {
    324          "sourceContextType": "worker-classic",
    325          "policyDeliveries": [
    326            "policy"
    327          ]
    328        }
    329      ],
    330      "subresourcePolicyDeliveries": []
    331    },
    332    "worker-classic-data": {
    333      "description": "data: dedicated workers should inherit its parent's policy.",
    334      "sourceContextList": [
    335        {
    336          "sourceContextType": "top",
    337          "policyDeliveries": [
    338            "policy"
    339          ]
    340        },
    341        {
    342          "sourceContextType": "worker-classic-data",
    343          "policyDeliveries": []
    344        }
    345      ],
    346      "subresourcePolicyDeliveries": []
    347    },
    348    "worker-module": {
    349      // This is applicable to referrer-policy tests.
    350      "description": "dedicated workers shouldn't inherit its parent's policy.",
    351      "sourceContextList": [
    352        {
    353          "sourceContextType": "top",
    354          "policyDeliveries": [
    355            "anotherPolicy"
    356          ]
    357        },
    358        {
    359          "sourceContextType": "worker-module",
    360          "policyDeliveries": [
    361            "policy"
    362          ]
    363        }
    364      ],
    365      "subresourcePolicyDeliveries": []
    366    },
    367    "worker-module-data": {
    368      "description": "data: dedicated workers should inherit its parent's policy.",
    369      "sourceContextList": [
    370        {
    371          "sourceContextType": "top",
    372          "policyDeliveries": [
    373            "policy"
    374          ]
    375        },
    376        {
    377          "sourceContextType": "worker-module-data",
    378          "policyDeliveries": []
    379        }
    380      ],
    381      "subresourcePolicyDeliveries": []
    382    },
    383    "sharedworker-classic": {
    384      "description": "shared workers shouldn't inherit its parent's policy.",
    385      "sourceContextList": [
    386        {
    387          "sourceContextType": "top",
    388          "policyDeliveries": [
    389            "anotherPolicy"
    390          ]
    391        },
    392        {
    393          "sourceContextType": "sharedworker-classic",
    394          "policyDeliveries": [
    395            "policy"
    396          ]
    397        }
    398      ],
    399      "subresourcePolicyDeliveries": []
    400    },
    401    "sharedworker-classic-data": {
    402      "description": "data: shared workers should inherit its parent's policy.",
    403      "sourceContextList": [
    404        {
    405          "sourceContextType": "top",
    406          "policyDeliveries": [
    407            "policy"
    408          ]
    409        },
    410        {
    411          "sourceContextType": "sharedworker-classic-data",
    412          "policyDeliveries": []
    413        }
    414      ],
    415      "subresourcePolicyDeliveries": []
    416    },
    417    "sharedworker-module": {
    418      "description": "shared workers shouldn't inherit its parent's policy.",
    419      "sourceContextList": [
    420        {
    421          "sourceContextType": "top",
    422          "policyDeliveries": [
    423            "anotherPolicy"
    424          ]
    425        },
    426        {
    427          "sourceContextType": "sharedworker-module",
    428          "policyDeliveries": [
    429            "policy"
    430          ]
    431        }
    432      ],
    433      "subresourcePolicyDeliveries": []
    434    },
    435    "sharedworker-module-data": {
    436      "description": "data: shared workers should inherit its parent's policy.",
    437      "sourceContextList": [
    438        {
    439          "sourceContextType": "top",
    440          "policyDeliveries": [
    441            "policy"
    442          ]
    443        },
    444        {
    445          "sourceContextType": "sharedworker-module-data",
    446          "policyDeliveries": []
    447        }
    448      ],
    449      "subresourcePolicyDeliveries": []
    450    }
    451  },
    452  "test_expansion_schema": {
    453    "expansion": [
    454      "default",
    455      "override"
    456    ],
    457    "source_scheme": [
    458      "http",
    459      "https"
    460    ],
    461    "source_context_list": [
    462      "top",
    463      "req",
    464      "srcdoc-inherit",
    465      "srcdoc",
    466      "iframe",
    467      "iframe-blank-inherit",
    468      "worker-classic",
    469      "worker-classic-data",
    470      "worker-module",
    471      "worker-module-data",
    472      "sharedworker-classic",
    473      "sharedworker-classic-data",
    474      "sharedworker-module",
    475      "sharedworker-module-data"
    476    ],
    477    "redirection": [
    478      "no-redirect",
    479      "keep-origin",
    480      "swap-origin",
    481      "keep-scheme",
    482      "swap-scheme",
    483      "downgrade"
    484    ],
    485    "origin": [
    486      "same-https",
    487      "same-http",
    488      "same-http-downgrade",
    489      "cross-https",
    490      "cross-http",
    491      "cross-http-downgrade",
    492      "same-wss",
    493      "same-ws",
    494      "same-ws-downgrade",
    495      "cross-wss",
    496      "cross-ws",
    497      "cross-ws-downgrade"
    498    ],
    499    "subresource": [
    500      "a-tag",
    501      "area-tag",
    502      "audio-tag",
    503      "beacon",
    504      "fetch",
    505      "iframe-tag",
    506      "img-tag",
    507      "link-css-tag",
    508      "link-prefetch-tag",
    509      "object-tag",
    510      "picture-tag",
    511      "script-tag",
    512      "script-tag-dynamic-import",
    513      "sharedworker-classic",
    514      "sharedworker-import",
    515      "sharedworker-import-data",
    516      "sharedworker-module",
    517      "svg-a-tag",
    518      "video-tag",
    519      "websocket",
    520      "worker-classic",
    521      "worker-import",
    522      "worker-import-data",
    523      "worker-module",
    524      "worklet-animation",
    525      "worklet-animation-import-data",
    526      "worklet-audio",
    527      "worklet-audio-import-data",
    528      "worklet-layout",
    529      "worklet-layout-import-data",
    530      "worklet-paint",
    531      "worklet-paint-import-data",
    532      "xhr"
    533    ]
    534  }
    535 }