Bug 1878694 [wpt PR 44398] - Add well-known routes for Protected Audience API WPTs...
commit73c3203f8853f4a31d6412cf2031784fa3915f8a
authorOrr Bernstein (Google Chrome) <orrb@google.com>
Wed, 28 Feb 2024 08:36:55 +0000 (28 08:36 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Fri, 1 Mar 2024 20:10:07 +0000 (1 20:10 +0000)
tree28a3b774f397352999935a4b8ed0568bc793900e
parent3ab06c41b5863fd53e02fb5ccb7609c310c5250e
Bug 1878694 [wpt PR 44398] - Add well-known routes for Protected Audience API WPTs, a=testonly

Automatic update from web-platform-tests
Add well-known routes for Protected Audience API WPTs (#44398)

* Add well-known routes for Protected Audience API WPTs

Web Platform Tests for the [Protected Audience
API](https://github.com/WICG/turtledove/blob/main/FLEDGE.md) are in the
process of being added. As part of this API, the browser issues a GET
request to a well-known URI: `/.well-known/interest-group/permissions/`.
This is described in more detail at
https://github.com/WICG/turtledove/blob/main/FLEDGE.md#13-permission-delegation.

In order to implement dynamic handling of these routes in WPT, we need
to register these routes in the add_mount_point. Because this well-known
URI ends in a '/', we also need special handling for directory-appearing
PythonHandler-supported endpoints.

* Fix indentation in change to handlers.py

* Support default python files matching the pattern default*.py.

In order to support e.g. text substition, which requires a special
filename, e.g. default.sub.py, expand support for loading the default
file in a directory-appearing endpoint handled by a Python handler to
support any default file matching the pattern default*.py. In case
multiple files match this pattern, the first one found is used.

* Improved handling for default files matching default*.py.

* Improved handling for default files matching default*.py.

* Add tests for directory special casing for PythonHandler.

This also makes the directory special casing more deterministic by
explicitly selecting the first lexicographically sorted file match the
default*.py pattern in the requested path.

* Changed AsIsHandler to throw HTTPException instead of AssertionError.

Also added a test that shows AsIsHandler failing when trying to process
a directory.
--

wpt-commits: fec3221d5d92d6dae1816e688b9b93d3bec855e9
wpt-pr: 44398
testing/web-platform/tests/tools/serve/serve.py
testing/web-platform/tests/tools/wptserve/tests/functional/docroot/defaultpy/default.py [new file with mode: 0644]
testing/web-platform/tests/tools/wptserve/tests/functional/docroot/defaultpy/default.sub.py [new file with mode: 0644]
testing/web-platform/tests/tools/wptserve/tests/functional/docroot/defaultsubpy/default.sub.py [new file with mode: 0644]
testing/web-platform/tests/tools/wptserve/tests/functional/test_handlers.py
testing/web-platform/tests/tools/wptserve/tests/functional/test_pipes.py
testing/web-platform/tests/tools/wptserve/wptserve/handlers.py