fido-common: Make extensions::Identifier de/serializable

main
Nick Zana 2 years ago
parent 2bb574e62b
commit c1c95bafc1

@ -1,3 +1,6 @@
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
/// > Extensions are identified by a string, called an extension identifier, /// > Extensions are identified by a string, called an extension identifier,
/// > chosen by the extension author. /// > chosen by the extension author.
/// > /// >
@ -18,22 +21,39 @@
/// > Extensions that may exist in multiple versions should take care to include /// > Extensions that may exist in multiple versions should take care to include
/// > a version in their identifier. In effect, different versions are thus /// > a version in their identifier. In effect, different versions are thus
/// > treated as different extensions, e.g., `myCompany_extension_01` /// > treated as different extensions, e.g., `myCompany_extension_01`
#[derive(PartialEq, Eq, PartialOrd, Ord)] #[derive(Debug, PartialEq, Eq, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum Identifier { pub enum Identifier {
#[cfg_attr(feature = "serde", serde(rename = "appid"))]
AppId, AppId,
#[cfg_attr(feature = "serde", serde(rename = "txAuthSimple"))]
TransactionAuthSimple, TransactionAuthSimple,
#[cfg_attr(feature = "serde", serde(rename = "txAuthGeneric"))]
TransactionAuthGeneric, TransactionAuthGeneric,
#[cfg_attr(feature = "serde", serde(rename = "authnSel"))]
AuthenticationSelection, AuthenticationSelection,
#[cfg_attr(feature = "serde", serde(rename = "exts"))]
Extensions, Extensions,
#[cfg_attr(feature = "serde", serde(rename = "uvi"))]
UserVerificationIndex, UserVerificationIndex,
#[cfg_attr(feature = "serde", serde(rename = "loc"))]
Location, Location,
#[cfg_attr(feature = "serde", serde(rename = "uvm"))]
UserVerificationMethod, UserVerificationMethod,
#[cfg_attr(feature = "serde", serde(rename = "credProtect"))]
CredentialProtection, CredentialProtection,
#[cfg_attr(feature = "serde", serde(rename = "credBlob"))]
CredentialBlob, CredentialBlob,
#[cfg_attr(feature = "serde", serde(rename = "largeBlobKey"))]
LargeBlobKey, LargeBlobKey,
#[cfg_attr(feature = "serde", serde(rename = "minPinLength"))]
MinPinLength, MinPinLength,
#[cfg_attr(feature = "serde", serde(rename = "hmac-secret"))]
HmacSecret, HmacSecret,
#[cfg_attr(feature = "serde", serde(rename = "appidExclude"))]
AppIdExclude, AppIdExclude,
#[cfg_attr(feature = "serde", serde(rename = "credProps"))]
CredentialProperties, CredentialProperties,
#[cfg_attr(feature = "serde", serde(rename = "largeBlob"))]
LargeBlob, LargeBlob,
} }

Loading…
Cancel
Save