blob: a2b595ec9ac8e0746af6a5676143591569e21c9e [file] [log] [blame]
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
enum RefreshPolicy { "none", "refresh" };
enum OperationType { "token-request", "send-srr", "srr-token-redemption" };
enum SignRequestData { "omit", "include", "headers-only" };
// A TrustToken object represents a request to execute a Trust Tokens protocol
// operation (https://github.com/wicg/trust-token-api).
dictionary TrustToken {
// |type| is the only required parameter; all other parameters are necessary
// only for certain operations.
required OperationType type;
// --- Parameters only for token redemption
// The following parameters are ignored unless |type| is
// "srr-token-redemption":
// 1. refreshPolicy
RefreshPolicy refreshPolicy = "none";
// --- Parameters only for request signing
// The following parameters are ignored unless |type| is "send-srr":
// 1. |issuer|
// 2. |additionalSignedHeaders|
// 3. |includeTimestampHeader|
// 4. |signRequestData|
//
// Additionally, |issuer| is required when |type| is "send-srr".
USVString issuer;
sequence<USVString> additionalSignedHeaders;
boolean includeTimestampHeader = false;
SignRequestData signRequestData = "omit";
};