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 "sharedworker-classic", 110 "sharedworker-import", 111 "sharedworker-import-data", 112 "sharedworker-module", 113 "video-tag", 114 "worker-classic", 115 "worker-import", 116 "worker-import-data", 117 "worker-module", 118 "worklet-animation", 119 "worklet-animation-import-data", 120 "worklet-audio", 121 "worklet-audio-import-data", 122 "worklet-layout", 123 "worklet-layout-import-data", 124 "worklet-paint", 125 "worklet-paint-import-data", 126 "xhr" 127 ], 128 "origin": [ 129 "same-wss", 130 "same-ws", 131 "same-ws-downgrade", 132 "cross-wss", 133 "cross-ws", 134 "cross-ws-downgrade" 135 ], 136 "expectation": "*" 137 }, 138 { 139 // Worklets are HTTPS contexts only 140 "expansion": "*", 141 "source_scheme": "http", 142 "source_context_list": "*", 143 "delivery_type": "*", 144 "delivery_value": "*", 145 "redirection": "*", 146 "subresource": [ 147 "worklet-animation", 148 "worklet-animation-import-data", 149 "worklet-audio", 150 "worklet-audio-import-data", 151 "worklet-layout", 152 "worklet-layout-import-data", 153 "worklet-paint", 154 "worklet-paint-import-data" 155 ], 156 "origin": "*", 157 "expectation": "*" 158 } 159 ], 160 "source_context_schema": { 161 "supported_subresource": { 162 "top": "*", 163 "iframe": "*", 164 "iframe-blank": "*", 165 "srcdoc": "*", 166 "worker-classic": [ 167 "xhr", 168 "fetch", 169 "websocket", 170 "worker-classic", 171 "worker-module" 172 ], 173 "worker-module": [ 174 "xhr", 175 "fetch", 176 "websocket", 177 "worker-classic", 178 "worker-module" 179 ], 180 "worker-classic-data": [ 181 "xhr", 182 "fetch", 183 "websocket" 184 ], 185 "worker-module-data": [ 186 "xhr", 187 "fetch", 188 "websocket" 189 ], 190 "sharedworker-classic": [ 191 "xhr", 192 "fetch", 193 "websocket" 194 ], 195 "sharedworker-module": [ 196 "xhr", 197 "fetch", 198 "websocket" 199 ], 200 "sharedworker-classic-data": [ 201 "xhr", 202 "fetch", 203 "websocket" 204 ], 205 "sharedworker-module-data": [ 206 "xhr", 207 "fetch", 208 "websocket" 209 ] 210 } 211 }, 212 "source_context_list_schema": { 213 // Warning: Currently, some nested patterns of contexts have different 214 // inheritance rules for different kinds of policies. 215 // The generated tests will be used to test/investigate the policy 216 // inheritance rules, and eventually the policy inheritance rules will 217 // be unified (https://github.com/w3ctag/design-principles/issues/111). 218 "top": { 219 "description": "Policy set by the top-level Document", 220 "sourceContextList": [ 221 { 222 "sourceContextType": "top", 223 "policyDeliveries": [ 224 "policy" 225 ] 226 } 227 ], 228 "subresourcePolicyDeliveries": [] 229 }, 230 "req": { 231 "description": "Subresource request's policy should override Document's policy", 232 "sourceContextList": [ 233 { 234 "sourceContextType": "top", 235 "policyDeliveries": [ 236 "anotherPolicy" 237 ] 238 } 239 ], 240 "subresourcePolicyDeliveries": [ 241 "nonNullPolicy" 242 ] 243 }, 244 "srcdoc-inherit": { 245 "description": "srcdoc iframe without its own policy should inherit parent Document's policy", 246 "sourceContextList": [ 247 { 248 "sourceContextType": "top", 249 "policyDeliveries": [ 250 "policy" 251 ] 252 }, 253 { 254 "sourceContextType": "srcdoc" 255 } 256 ], 257 "subresourcePolicyDeliveries": [] 258 }, 259 "srcdoc": { 260 "description": "srcdoc iframe's policy should override parent Document's policy", 261 "sourceContextList": [ 262 { 263 "sourceContextType": "top", 264 "policyDeliveries": [ 265 "anotherPolicy" 266 ] 267 }, 268 { 269 "sourceContextType": "srcdoc", 270 "policyDeliveries": [ 271 "nonNullPolicy" 272 ] 273 } 274 ], 275 "subresourcePolicyDeliveries": [] 276 }, 277 "iframe": { 278 "description": "external iframe's policy should override parent Document's policy", 279 "sourceContextList": [ 280 { 281 "sourceContextType": "top", 282 "policyDeliveries": [ 283 "anotherPolicy" 284 ] 285 }, 286 { 287 "sourceContextType": "iframe", 288 "policyDeliveries": [ 289 "policy" 290 ] 291 } 292 ], 293 "subresourcePolicyDeliveries": [] 294 }, 295 "iframe-blank-inherit": { 296 "description": "blank iframe should inherit parent Document's policy", 297 "sourceContextList": [ 298 { 299 "sourceContextType": "top", 300 "policyDeliveries": [ 301 "policy" 302 ] 303 }, 304 { 305 "sourceContextType": "iframe-blank" 306 } 307 ], 308 "subresourcePolicyDeliveries": [] 309 }, 310 "worker-classic": { 311 // This is applicable to referrer-policy tests. 312 // Use "worker-classic-inherit" for CSP (mixed-content, etc.). 313 "description": "dedicated workers shouldn't inherit its parent's policy.", 314 "sourceContextList": [ 315 { 316 "sourceContextType": "top", 317 "policyDeliveries": [ 318 "anotherPolicy" 319 ] 320 }, 321 { 322 "sourceContextType": "worker-classic", 323 "policyDeliveries": [ 324 "policy" 325 ] 326 } 327 ], 328 "subresourcePolicyDeliveries": [] 329 }, 330 "worker-classic-inherit": { 331 // This is applicable to upgrade-insecure-requests and mixed-content tests. 332 // Use "worker-classic" for referrer-policy. 333 "description": "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", 343 "policyDeliveries": [ 344 "anotherPolicy" 345 ] 346 } 347 ], 348 "subresourcePolicyDeliveries": [] 349 }, 350 "worker-classic-data": { 351 "description": "data: dedicated workers should inherit its parent's policy.", 352 "sourceContextList": [ 353 { 354 "sourceContextType": "top", 355 "policyDeliveries": [ 356 "policy" 357 ] 358 }, 359 { 360 "sourceContextType": "worker-classic-data", 361 "policyDeliveries": [] 362 } 363 ], 364 "subresourcePolicyDeliveries": [] 365 }, 366 "worker-module": { 367 // This is applicable to referrer-policy tests. 368 // Use "worker-module-inherit" for CSP (mixed-content, etc.). 369 "description": "dedicated workers shouldn't inherit its parent's policy.", 370 "sourceContextList": [ 371 { 372 "sourceContextType": "top", 373 "policyDeliveries": [ 374 "anotherPolicy" 375 ] 376 }, 377 { 378 "sourceContextType": "worker-module", 379 "policyDeliveries": [ 380 "policy" 381 ] 382 } 383 ], 384 "subresourcePolicyDeliveries": [] 385 }, 386 "worker-module-inherit": { 387 // This is applicable to upgrade-insecure-requests and mixed-content tests. 388 // Use "worker-module" for referrer-policy. 389 "description": "dedicated workers should inherit its parent's policy.", 390 "sourceContextList": [ 391 { 392 "sourceContextType": "top", 393 "policyDeliveries": [ 394 "policy" 395 ] 396 }, 397 { 398 "sourceContextType": "worker-module", 399 "policyDeliveries": [ 400 "anotherPolicy" 401 ] 402 } 403 ], 404 "subresourcePolicyDeliveries": [] 405 }, 406 "worker-module-data": { 407 "description": "data: dedicated workers should inherit its parent's policy.", 408 "sourceContextList": [ 409 { 410 "sourceContextType": "top", 411 "policyDeliveries": [ 412 "policy" 413 ] 414 }, 415 { 416 "sourceContextType": "worker-module-data", 417 "policyDeliveries": [] 418 } 419 ], 420 "subresourcePolicyDeliveries": [] 421 }, 422 "sharedworker-classic": { 423 "description": "shared workers shouldn't inherit its parent's policy.", 424 "sourceContextList": [ 425 { 426 "sourceContextType": "top", 427 "policyDeliveries": [ 428 "anotherPolicy" 429 ] 430 }, 431 { 432 "sourceContextType": "sharedworker-classic", 433 "policyDeliveries": [ 434 "policy" 435 ] 436 } 437 ], 438 "subresourcePolicyDeliveries": [] 439 }, 440 "sharedworker-classic-data": { 441 "description": "data: shared workers should inherit its parent's policy.", 442 "sourceContextList": [ 443 { 444 "sourceContextType": "top", 445 "policyDeliveries": [ 446 "policy" 447 ] 448 }, 449 { 450 "sourceContextType": "sharedworker-classic-data", 451 "policyDeliveries": [] 452 } 453 ], 454 "subresourcePolicyDeliveries": [] 455 }, 456 "sharedworker-module": { 457 "description": "shared workers shouldn't inherit its parent's policy.", 458 "sourceContextList": [ 459 { 460 "sourceContextType": "top", 461 "policyDeliveries": [ 462 "anotherPolicy" 463 ] 464 }, 465 { 466 "sourceContextType": "sharedworker-module", 467 "policyDeliveries": [ 468 "policy" 469 ] 470 } 471 ], 472 "subresourcePolicyDeliveries": [] 473 }, 474 "sharedworker-module-data": { 475 "description": "data: shared workers should inherit its parent's policy.", 476 "sourceContextList": [ 477 { 478 "sourceContextType": "top", 479 "policyDeliveries": [ 480 "policy" 481 ] 482 }, 483 { 484 "sourceContextType": "sharedworker-module-data", 485 "policyDeliveries": [] 486 } 487 ], 488 "subresourcePolicyDeliveries": [] 489 } 490 }, 491 "test_expansion_schema": { 492 "expansion": [ 493 "default", 494 "override" 495 ], 496 "source_scheme": [ 497 "http", 498 "https" 499 ], 500 "source_context_list": [ 501 "top", 502 "req", 503 "srcdoc-inherit", 504 "srcdoc", 505 "iframe", 506 "iframe-blank-inherit", 507 "worker-classic", 508 "worker-classic-inherit", 509 "worker-classic-data", 510 "worker-module", 511 "worker-module-inherit", 512 "worker-module-data", 513 "sharedworker-classic", 514 "sharedworker-classic-data", 515 "sharedworker-module", 516 "sharedworker-module-data" 517 ], 518 "redirection": [ 519 "no-redirect", 520 "keep-origin", 521 "swap-origin", 522 "keep-scheme", 523 "swap-scheme", 524 "downgrade" 525 ], 526 "origin": [ 527 "same-https", 528 "same-http", 529 "same-http-downgrade", 530 "cross-https", 531 "cross-http", 532 "cross-http-downgrade", 533 "same-wss", 534 "same-ws", 535 "same-ws-downgrade", 536 "cross-wss", 537 "cross-ws", 538 "cross-ws-downgrade" 539 ], 540 "subresource": [ 541 "a-tag", 542 "area-tag", 543 "audio-tag", 544 "beacon", 545 "fetch", 546 "iframe-tag", 547 "img-tag", 548 "link-css-tag", 549 "link-prefetch-tag", 550 "object-tag", 551 "picture-tag", 552 "script-tag", 553 "sharedworker-classic", 554 "sharedworker-import", 555 "sharedworker-import-data", 556 "sharedworker-module", 557 "video-tag", 558 "websocket", 559 "worker-classic", 560 "worker-import", 561 "worker-import-data", 562 "worker-module", 563 "worklet-animation", 564 "worklet-animation-import-data", 565 "worklet-audio", 566 "worklet-audio-import-data", 567 "worklet-layout", 568 "worklet-layout-import-data", 569 "worklet-paint", 570 "worklet-paint-import-data", 571 "xhr" 572 ] 573 } 574} 575