diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /testing/web-platform/tests/.well-known/web-identity | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/.well-known/web-identity')
-rw-r--r-- | testing/web-platform/tests/.well-known/web-identity | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/testing/web-platform/tests/.well-known/web-identity b/testing/web-platform/tests/.well-known/web-identity new file mode 100644 index 0000000000..2095182bd0 --- /dev/null +++ b/testing/web-platform/tests/.well-known/web-identity @@ -0,0 +1,37 @@ +import importlib +keys = importlib.import_module("credential-management.support.fedcm.keys") + +def main(request, response): + manifest_url = request.server.stash.take(keys.MANIFEST_URL_IN_MANIFEST_LIST_KEY) + + if manifest_url is None or not len(manifest_url): + port = request.server.config.ports["https"][0] + hostname = request.url_parts.hostname + manifest_url = "https://{0}:{1}/credential-management/support/fedcm/manifest.py".format( + hostname, str(port)) + else: + try: + manifest_url = manifest_url.decode() + except (UnicodeDecodeError, AttributeError): + pass + + if len(request.cookies) > 0: + return (530, [], "Cookie should not be sent to manifest list endpoint") + if request.headers.get(b"Accept") != b"application/json": + return (531, [], "Wrong Accept") + if request.headers.get(b"Sec-Fetch-Dest") != b"webidentity": + return (532, [], "Wrong Sec-Fetch-Dest header") + if request.headers.get(b"Referer"): + return (533, [], "Should not have Referer") + if request.headers.get(b"Origin"): + return (534, [], "Should not have Origin") + + response.headers.set(b"Content-Type", b"application/json") + + return """ +{{ + "provider_urls": [ + "{0}" + ] +}} +""".format(manifest_url) |