diff --git a/crates/fido-common/src/attestation.rs b/crates/fido-common/src/attestation.rs index 0f02fdb..2b164f1 100644 --- a/crates/fido-common/src/attestation.rs +++ b/crates/fido-common/src/attestation.rs @@ -1,5 +1,5 @@ #[cfg(feature = "serde")] -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; /// > Attestation statement formats are identified by a string, called an /// > attestation statement format identifier, chosen by the author of the @@ -69,4 +69,3 @@ pub enum FormatIdentifier { #[cfg_attr(feature = "serde", serde(rename = "none"))] None, } - diff --git a/crates/fido-common/src/credential/mod.rs b/crates/fido-common/src/credential/mod.rs index 00d31b2..b814f65 100644 --- a/crates/fido-common/src/credential/mod.rs +++ b/crates/fido-common/src/credential/mod.rs @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; /// > enumeration are used for versioning the Authentication /// > Assertion and attestation structures according to the type of /// > the authenticator. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[non_exhaustive] pub enum Type { diff --git a/crates/fido-common/src/credential/public_key.rs b/crates/fido-common/src/credential/public_key.rs index 0449397..75cb131 100644 --- a/crates/fido-common/src/credential/public_key.rs +++ b/crates/fido-common/src/credential/public_key.rs @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize}; /// > This dictionary is used to supply additional parameters when /// > creating a new credential. -#[derive(Debug)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Parameters { /// > This member specifies the type of credential to be @@ -57,7 +57,6 @@ pub struct UserEntity { // Justfication for type from WebAuthn Specs: // > The user handle of the user account. A user handle is an opaque byte sequence with a // > maximum size of 64 bytes, and is not meant to be displayed to the user. - // > // // CTAP says that "while an empty account identifier is valid, it has known // interoperability hurdles in practice and platforms are RECOMMENDED to avoid sending @@ -70,7 +69,6 @@ pub struct UserEntity { /// > only for display, i.e., aiding the user in determining the /// > difference between user accounts with similar displayNames. For /// > example, "alexm", "alex.mueller@example.com" or "+14255551234". - // TODO: Figure out the String metadata encoding per https://w3c.github.io/webauthn/#sctn-strings-langdir pub name: Option, /// > A human-palatable name for the user account, intended only for /// > display. For example, "Alex Müller" or "田中倫". The Relying Party @@ -89,5 +87,5 @@ pub struct RelyingPartyEntity { /// > it is a human-palatable identifier for the Relying Party, intended /// > only for display. For example, "ACME Corporation", "Wonderful /// > Widgets, Inc." or "ОАО Примертех". - pub name: String, + pub name: Option, } diff --git a/crates/fido-common/src/registry.rs b/crates/fido-common/src/registry.rs index 2cd8dfd..f83e7ec 100644 --- a/crates/fido-common/src/registry.rs +++ b/crates/fido-common/src/registry.rs @@ -383,7 +383,7 @@ pub mod algorithms { /// > Each constant has a case-sensitive string representation (in quotes), /// > which is used in the authoritative metadata for FIDO authenticators. #[repr(u16)] - #[derive(Debug)] + #[derive(Debug, Clone, Copy, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(Deserialize, Serialize))] pub enum Signature { #[cfg_attr(feature = "serde", serde(rename = "secp256r1_ecdsa_sha256_raw"))]