Skip to content

WPT tests for security features applied to speculation rules ruleset fetch #43488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Dec 2, 2023

This adds WPT coverage for the fetch of the speculation rules
themselves (via the Speculation-Rules header). These are fairly
standard in how they work, but because these requests are currently
triggered only via a response header, they don't mesh very well with
the existing test harness for several reasons:

  1. We need to make a new context to issue the request. A window
    works most naturally, since a UA might not bother fetching rules
    in a subframe).

    This has knock-on consequences, like the need to replicate the
    headers for the security features to this opened window, which
    is awkward because what these headers were isn't plumbed in yet
    and isn't easy to obtain from script.

  2. Since this isn't requested via an element or script API, there
    is currently no explicit signal when this request has completed,
    successfully or otherwise. Instead, we poll the server to see
    when it has processed the request, timing out after some time
    if the request has not been seen (this is expected in the case
    that it is blocked).

    This has the potential to be flaky, though some steps are taken
    to mitigate this (and further ones could be, like using a longer
    or infinite timeout when the request should be allowed, but this
    requires plumbing the expected result deeper, which is awkward
    with the test generation machinery).

  3. Since it is processed as a response header early in the
    lifecycle of the document, we can't rely on
    securitypolicyviolation events to be fired in that context with
    any determinism. In theory this could be worked around by having
    the server process violation reports but this has its own issues.
    Instead they're skipped here, but not in an elegant way.

Bug: 1507833
Change-Id: I3e5de39191241ebee592c8e9ea85e38f462e1d7c

Reviewed-on: https://chromium-review.googlesource.com/5078187
WPT-Export-Revision: 1e86f21b18197551ab05937ef3d77c87fc2ce5ae

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-5078187 branch 2 times, most recently from f027f57 to 4d6f235 Compare December 4, 2023 04:29
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-5078187 branch 2 times, most recently from d6e9eec to 355de66 Compare December 5, 2023 23:26
…fetch

This adds WPT coverage for the fetch of the speculation rules
themselves (via the `Speculation-Rules` header). These are fairly
standard in how they work, but because these requests are currently
triggered only via a response header, they don't mesh very well with
the existing test harness for several reasons:

1. We need to make a new context to issue the request. A window
   works most naturally, since a UA might not bother fetching rules
   in a subframe).

   This has knock-on consequences, like the need to replicate the
   headers for the security features to this opened window, which
   is awkward because what these headers were isn't plumbed in yet
   and isn't easy to obtain from script.

2. Since this isn't requested via an element or script API, there
   is currently no explicit signal when this request has completed,
   successfully or otherwise. Instead, we poll the server to see
   when it has processed the request, timing out after some time
   if the request has not been seen (this is expected in the case
   that it is blocked).

   This has the potential to be flaky, though some steps are taken
   to mitigate this (and further ones could be, like using a longer
   or infinite timeout when the request should be allowed, but this
   requires plumbing the expected result deeper, which is awkward
   with the test generation machinery).

3. Since it is processed as a response header early in the
   lifecycle of the document, we can't rely on
   securitypolicyviolation events to be fired in that context with
   any determinism. In theory this could be worked around by having
   the server process violation reports but this has its own issues.
   Instead they're skipped here, but not in an elegant way.

Bug: 1507833
Change-Id: I3e5de39191241ebee592c8e9ea85e38f462e1d7c
@chromium-wpt-export-bot chromium-wpt-export-bot changed the title WIP: WPT tests for security features (CSP, mixed content, fetch metadata) applied to speculation rules resource fetch WPT tests for security features applied to speculation rules ruleset fetch Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants