Implement PolicyContainer and update the default ReferrerPolicy (#33977)

* Implement PolicyContainer

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

* implement small parts of fetch that interact with policy container

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

* fix: allow policy container's csp list to be unset

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

* fix: use the correct default policy when parsing from a token

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

---------

Signed-off-by: Shane Handley <shanehandley@fastmail.com>
This commit is contained in:
shanehandley 2024-11-08 18:19:23 +11:00 committed by GitHub
parent 4f6283d7fe
commit 6451767428
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
201 changed files with 210 additions and 5178 deletions

View file

@ -1,31 +0,0 @@
[fetch.http.html]
[Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context.]
expected: FAIL

View file

@ -1,36 +1,6 @@
[fetch.http.html]
[Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context.]
expected: FAIL

View file

@ -1,31 +0,0 @@
[fetch.http.html]
[Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context.]
expected: FAIL

View file

@ -1,36 +1,6 @@
[fetch.http.html]
[Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-http origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-http origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context.]
expected: FAIL

View file

@ -1,31 +0,0 @@
[fetch.http.html]
[Referrer Policy: Expects origin for fetch to same-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to same-https origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-http origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-http origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for fetch to cross-https origin and keep-origin redirection from http context.]
expected: FAIL

View file

@ -1,31 +0,0 @@
[iframe-tag.http.html]
[Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context.]
expected: FAIL

View file

@ -1,30 +0,0 @@
[img-tag.http.html]
[Referrer Policy: Expects origin for img-tag to cross-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for img-tag to cross-http origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for img-tag to same-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for img-tag to same-https origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for img-tag to cross-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for img-tag to cross-http origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for img-tag to same-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for img-tag to cross-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for img-tag to same-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for img-tag to cross-https origin and keep-origin redirection from http context.]
expected: FAIL

View file

@ -10,34 +10,3 @@
[Referrer Policy: Expects stripped-referrer for script-tag to same-https origin and no-redirect redirection from http context.]
expected: NOTRUN
[Referrer Policy: Expects origin for script-tag to cross-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for script-tag to same-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for script-tag to same-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for script-tag to cross-http origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for script-tag to cross-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for script-tag to cross-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for script-tag to cross-http origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for script-tag to same-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for script-tag to same-https origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for script-tag to cross-https origin and keep-origin redirection from http context.]
expected: FAIL

View file

@ -1,31 +0,0 @@
[xhr.http.html]
[Referrer Policy: Expects origin for xhr to same-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for xhr to same-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for xhr to cross-http origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for xhr to cross-https origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for xhr to cross-http origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for xhr to same-https origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for xhr to cross-http origin and keep-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for xhr to cross-https origin and no-redirect redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for xhr to cross-https origin and swap-origin redirection from http context.]
expected: FAIL
[Referrer Policy: Expects origin for xhr to same-http origin and swap-origin redirection from http context.]
expected: FAIL