chromium/third_party/blink/public/mojom/authenticator_mojom_traits.h

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_PUBLIC_MOJOM_AUTHENTICATOR_MOJOM_TRAITS_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_AUTHENTICATOR_MOJOM_TRAITS_H_

#include <optional>
#include <string>
#include <vector>

#include "base/containers/flat_tree.h"
#include "device/fido/authenticator_selection_criteria.h"
#include "device/fido/cable/cable_discovery_data.h"
#include "device/fido/fido_constants.h"
#include "device/fido/fido_transport_protocol.h"
#include "device/fido/public_key_credential_descriptor.h"
#include "device/fido/public_key_credential_params.h"
#include "device/fido/public_key_credential_rp_entity.h"
#include "device/fido/public_key_credential_user_entity.h"
#include "mojo/public/cpp/bindings/array_traits_stl.h"
#include "mojo/public/cpp/bindings/enum_traits.h"
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "third_party/blink/public/common/common_export.h"
#include "third_party/blink/public/mojom/webauthn/authenticator.mojom-shared.h"

namespace mojo {

template <>
struct BLINK_COMMON_EXPORT EnumTraits<blink::mojom::AuthenticatorTransport,
                                      device::FidoTransportProtocol> {};

template <>
struct BLINK_COMMON_EXPORT
    EnumTraits<blink::mojom::PublicKeyCredentialType, device::CredentialType> {};

template <>
struct BLINK_COMMON_EXPORT
    StructTraits<blink::mojom::PublicKeyCredentialParametersDataView,
                 device::PublicKeyCredentialParams::CredentialInfo> {};

template <>
struct BLINK_COMMON_EXPORT
    StructTraits<blink::mojom::PublicKeyCredentialDescriptorDataView,
                 device::PublicKeyCredentialDescriptor> {};

template <>
struct BLINK_COMMON_EXPORT EnumTraits<blink::mojom::AuthenticatorAttachment,
                                      device::AuthenticatorAttachment> {};

template <>
struct BLINK_COMMON_EXPORT EnumTraits<blink::mojom::ResidentKeyRequirement,
                                      device::ResidentKeyRequirement> {};

template <>
struct BLINK_COMMON_EXPORT EnumTraits<blink::mojom::UserVerificationRequirement,
                                      device::UserVerificationRequirement> {};

template <>
struct BLINK_COMMON_EXPORT
    EnumTraits<blink::mojom::LargeBlobSupport, device::LargeBlobSupport> {};

template <>
struct BLINK_COMMON_EXPORT
    StructTraits<blink::mojom::AuthenticatorSelectionCriteriaDataView,
                 device::AuthenticatorSelectionCriteria> {};

template <>
struct BLINK_COMMON_EXPORT
    StructTraits<blink::mojom::PublicKeyCredentialRpEntityDataView,
                 device::PublicKeyCredentialRpEntity> {};

template <>
struct BLINK_COMMON_EXPORT
    StructTraits<blink::mojom::PublicKeyCredentialUserEntityDataView,
                 device::PublicKeyCredentialUserEntity> {};

template <>
struct BLINK_COMMON_EXPORT
    StructTraits<blink::mojom::CableAuthenticationDataView,
                 device::CableDiscoveryData> {};

template <>
struct BLINK_COMMON_EXPORT
    EnumTraits<blink::mojom::AttestationConveyancePreference,
               device::AttestationConveyancePreference> {};

}  // namespace mojo

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_AUTHENTICATOR_MOJOM_TRAITS_H_