fido-common: Apply minor formatting and docs fixes

Derive standard traits for several types.
Remove unecessary URLs in doc comments.
Apply rustfmt changes.
dev
Nick Zana 2 years ago
parent 0186b2ee40
commit d5529827ed
No known key found for this signature in database
GPG Key ID: 936524EE913D6538

@ -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,
}

@ -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 {

@ -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.
// > <https://w3c.github.io/webauthn/#dom-publickeycredentialuserentity-id/>
//
// 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<String>,
/// > 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<String>,
}

@ -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"))]

Loading…
Cancel
Save