fido-common: derives comparison traits for several types

Derives PartialOrd and Ord for credential::public_key::Parameters
Derives PartialEq, Eq, PartialOrd and Ord for credential::public_key::UserEntity

Also derives clone and copy for some types.
main
Nick Zana 2 years ago
parent 03fb2f1eb6
commit d5a4a03c0d

@ -34,7 +34,7 @@ pub(crate) mod algorithm {
/// > This dictionary is used to supply additional parameters when /// > This dictionary is used to supply additional parameters when
/// > creating a new credential. /// > creating a new credential.
#[cfg_eval] #[cfg_eval]
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Parameters { pub struct Parameters {
/// > This member specifies the type of credential to be /// > This member specifies the type of credential to be
@ -52,7 +52,7 @@ pub struct Parameters {
/// > This dictionary identifies a specific public key credential. /// > This dictionary identifies a specific public key credential.
#[cfg_eval] #[cfg_eval]
#[derive(Debug, Clone)] #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
#[cfg_attr( #[cfg_attr(
feature = "serde", feature = "serde",
serde_as, serde_as,
@ -118,7 +118,7 @@ pub struct UserEntity {
/// > This `PublicKeyCredentialRpEntity` data structure describes a Relying /// > This `PublicKeyCredentialRpEntity` data structure describes a Relying
/// > Party with which the new public key credential will be associated. /// > Party with which the new public key credential will be associated.
#[derive(Debug)] #[derive(Debug, Clone)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct RelyingPartyEntity { pub struct RelyingPartyEntity {
/// > A unique identifier for the Relying Party entity. /// > A unique identifier for the Relying Party entity.

@ -21,7 +21,7 @@ use serde::{Deserialize, Serialize};
/// > 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(Debug, PartialEq, Eq, PartialOrd, Ord)] #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum Identifier { pub enum Identifier {
#[cfg_attr(feature = "serde", serde(rename = "appid"))] #[cfg_attr(feature = "serde", serde(rename = "appid"))]

Loading…
Cancel
Save