Closed Bug 1627735 Opened 6 years ago Closed 6 years ago

[wpt-sync] Sync PR 22728 - Trust Tokens: Report errors when operations fail

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 22728 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/22728
Details from upstream follow.

David Van Cleve <davidvc@chromium.org> wrote:

Trust Tokens: Report errors when operations fail

The experimental Trust Token API [*], which we're origin trialling soon,
soon, allows Fetch and XHR callers to specify that an additional
cryptographic operation should be executed as part of sending a request.
Before sending the request, network-stack Trust Tokens protocol logic
checks cryptographic preconditions and possibly adds a request header;
when receiving the corresponding response, the logic verifies the
presence and integrity of corresponding response header and updates
persistent state.

We'd like some way to communicate the outcome of a Trust Tokens
operation to the client invoking the API. This CL adds a preliminary
way to do this by

  • partitioning Trust Tokens "errors" into three cases: failing a
    precondition, hitting the Signed Redemption Record cache (not an error
    from the Trust Tokens perspective, but it results in the page load
    failing and it is important for the client of the Trust Tokens call to
    be able to distinguish between this and a generic load failure), and
    any other Trust Tokens failure;
  • communicating this via Fetch by throwing corresponding exceptions
    on failure; and
  • adding a new trustTokenOperationError attribute to XHR, populated when
    a request fails with a Trust Tokens
    error.

We're not sure exactly what error information will be useful for
developers, and we'll evalute ergonomics during the origin trial.

[*]
https://docs.google.com/document/d/1TNnya6B8pyomDK2F1R9CL3dY10OAmqWlnCxsWyOBDVQ/edit#

R=jbroman,csharrison

Bug: 1066649
Change-Id: I509dcb7d25559b73c23082bd915d67100a9a30ad

Reviewed-on: https://chromium-review.googlesource.com/2136864
WPT-Export-Revision: 15f7c0636b56794b07e115a85ff7f0b8245c80ba

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.