// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
enum PrivateTokenVersion {"1"};
enum RefreshPolicy { "none", "refresh" };
enum OperationType { "token-request", "send-redemption-record", "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 PrivateToken {
// |version| specifies the token version to be used.
required PrivateTokenVersion version;
// |operation| is a required parameter that specifies the token operation.
required OperationType operation;
// --- Parameters only for token redemption
// The following parameters are ignored unless |operation| is
// "token-redemption":
// 1. refreshPolicy
RefreshPolicy refreshPolicy = "none";
// --- Parameters only for request signing
// The following parameters are ignored unless |operation| is "send-redemption-record":
// 1. |issuers|
//
// Additionally, |issuers| must be nonempty when |operation| is "send-redemption-record".
sequence<USVString> issuers;
};