// 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. #ifndef SERVICES_NETWORK_TRUST_TOKENS_SUITABLE_TRUST_TOKEN_ORIGIN_H_ #define SERVICES_NETWORK_TRUST_TOKENS_SUITABLE_TRUST_TOKEN_ORIGIN_H_ #include <optional> #include "base/types/pass_key.h" #include "url/origin.h" namespace network { // Class SuitableTrustTokenOrigin is a thin wrapper over url::Origin enforcing // invariants required of all origins suitable for keying persistent Trust // Tokens state (https://github.com/wicg/trust-token-api). These origins must // be: // - potentially trustworthy, in the sense of // network::IsOriginPotentiallyTrustworthy (this is a security requirement); and // - either HTTP or HTTPS (this is so that the origins have unique // serializations). class SuitableTrustTokenOrigin { … }; inline bool operator==(const SuitableTrustTokenOrigin& lhs, const SuitableTrustTokenOrigin& rhs) { … } inline bool operator<(const SuitableTrustTokenOrigin& lhs, const SuitableTrustTokenOrigin& rhs) { … } } // namespace network #endif // SERVICES_NETWORK_TRUST_TOKENS_SUITABLE_TRUST_TOKEN_ORIGIN_H_