Trust Tokens: Mark platform-provided issuance as a success in DevTools
A Trust Tokens issuance request is a request created by fetch(..., {trustToken: {type: 'token-request'}}) With the new "platform-provided trust tokens" expansion of the Trust Tokens feature, the request's destination origin can provide configuration indicating that the browser should divert the origin's Trust Tokens issuance requests to system-local providers, on platforms that support this behavior (currently Android). [1] In this case, there's no need to send an HTTP request directly to the destination URL provided in the fetch() call, so we return early via URLLoader::OnComplete(URLLoaderCompletionStatus). We provide a non-net::OK error code to this URLLoader::OnComplete call since we won't receive an HTTP response from the request's destination. Since this case is semantically a success, we don't want it to show up as an error in the DevTools console. This change gives it the same treatment as Trust Tokens redemption cache hits, making it return TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST from URLLoader. In order to support the DevTools browser test covering this behavior, this CL exposes some platform-provided issuance support fixtures from trust_token_browsertest.cc in the corresponding header file. [1]: https://bit.ly/platform-provided-trust-tokens Test: A DevTools browser test confirms the request shows as "finished" Bug: 1154847 Change-Id: I2d8a00b780f12faa16052d07ccba88c50dbde848 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2587436 Auto-Submit: David Van Cleve <davidvc@chromium.org> Commit-Queue: Matt Menke <mmenke@chromium.org> Reviewed-by:Matt Menke <mmenke@chromium.org> Reviewed-by:
Charlie Harrison <csharrison@chromium.org> Reviewed-by:
Simon Zünd <szuend@chromium.org> Reviewed-by:
Peter Marshall <petermarshall@chromium.org> Cr-Commit-Position: refs/heads/master@{#840198}
Showing
Please register or sign in to comment