diff --git a/credential-exchange-types/src/format.rs b/credential-exchange-types/src/format.rs index 4267bff..f5c8572 100644 --- a/credential-exchange-types/src/format.rs +++ b/credential-exchange-types/src/format.rs @@ -8,7 +8,7 @@ use crate::{ mod passkey; -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase", bound(deserialize = "E: Deserialize<'de>"))] pub struct Header { /// The version of the format definition, The current version is 0. @@ -21,7 +21,7 @@ pub struct Header { pub accounts: Vec>, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase", bound(deserialize = "E: Deserialize<'de>"))] pub struct Account { /// A unique identifier for the [Account] which is machine generated and an opaque byte @@ -49,7 +49,7 @@ pub struct Account { pub extensions: Option>>, // default [] } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase", bound(deserialize = "E: Deserialize<'de>"))] pub struct Collection { /// A unique identifier for the [Collection] which is machine generated and an opaque byte @@ -75,7 +75,7 @@ pub struct Collection { pub extensions: Option>>, // default [] } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase", bound(deserialize = "E: Deserialize<'de>"))] pub struct Item { /// A unique identifier for the [Item] which is machine generated and an opaque byte sequence @@ -110,7 +110,7 @@ pub struct Item { pub extensions: Option>>, // default [] } -#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "kebab-case")] pub enum ItemType { /// An [Item] that SHOULD contain any of the following [Credential] types: @@ -133,7 +133,7 @@ pub enum ItemType { Unknown(String), } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct LinkedItem { /// The [Item’s id][Item::id] that this [LinkedItem] refers to. Note that this [Item] might not /// be sent as part of the current exchange. @@ -145,7 +145,7 @@ pub struct LinkedItem { pub account: Option, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(tag = "name", rename_all = "kebab-case")] pub enum Extension { #[serde(untagged)] @@ -154,7 +154,7 @@ pub enum Extension { Unknown(serde_json::Value), } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(tag = "type", rename_all = "kebab-case")] pub enum Credential { BasicAuth(BasicAuthCredential), @@ -194,7 +194,7 @@ pub enum Credential { }, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct BasicAuthCredential { pub urls: Vec, @@ -204,7 +204,7 @@ pub struct BasicAuthCredential { pub password: Option, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct PasskeyCredential { pub credential_id: B64Url, @@ -217,7 +217,7 @@ pub struct PasskeyCredential { pub fido2_extensions: Option, } -#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "lowercase")] pub enum OTPHashAlgorithm { Sha1, @@ -227,7 +227,7 @@ pub enum OTPHashAlgorithm { Unknown(String), } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct EditableField { /// A unique identifier for the [EditableField] which is machine generated and an opaque byte @@ -251,7 +251,7 @@ pub struct EditableField { pub label: Option, } -#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "kebab-case")] pub enum FieldType { /// A UTF-8 encoded string value which is unconcealed and does not have a specified format. diff --git a/credential-exchange-types/src/format/passkey.rs b/credential-exchange-types/src/format/passkey.rs index 86311c7..e120f55 100644 --- a/credential-exchange-types/src/format/passkey.rs +++ b/credential-exchange-types/src/format/passkey.rs @@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize}; use crate::b64url::B64Url; -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Fido2Extensions { #[serde(default, skip_serializing_if = "Option::is_none")] @@ -17,14 +17,14 @@ pub struct Fido2Extensions { pub supplemental_keys: Option, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Fido2HmacSecret { pub alias: String, pub hmac_secret: B64Url, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Fido2LargeBlob { pub size: u64, @@ -32,7 +32,7 @@ pub struct Fido2LargeBlob { pub data: B64Url, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Fido2SupplementalKeys { #[serde(default, skip_serializing_if = "Option::is_none")]