pub struct CollectedClientData {
    pub ty: ClientDataType,
    pub challenge: String,
    pub origin: String,
    pub cross_origin: Option<bool>,
    pub unknown_keys: IndexMap<String, Value>,
}
Expand description

The client data represents the contextual bindings of both the Relying Party and the client. It is a key-value mapping whose keys are strings. Values can be any type that has a valid encoding in JSON.

Note: The CollectedClientData may be extended in the future. Therefore it’s critical when parsing to be tolerant of unknown keys and of any reordering of the keys

This struct conforms to the JSON byte serialization format expected of CollectedClientData, detailed in section 5.8.1.1 Serialization of the WebAuthn spec. Namely the following requirements:

  • type, challenge, origin, crossOrigin must always be present in the serialized format in that order.
  • Any extra parameters must keep the order in which they were used in the signature, hence the use of IndexMap.

https://w3c.github.io/webauthn/#dictionary-client-data

Fields§

§ty: ClientDataType

This member contains the value ClientDataType::Create when creating new credentials, and ClientDataType::Get when getting an assertion from an existing credential. The purpose of this member is to prevent certain types of signature confusion attacks (where an attacker substitutes one legitimate signature for another).

§challenge: String

This member contains the base64url encoding of the challenge provided by the Relying Party. See the Cryptographic Challenges security consideration.

§origin: String

This member contains the fully qualified origin of the requester, as provided to the authenticator by the client, in the syntax defined by RFC6454.

§cross_origin: Option<bool>

This OPTIONAL member contains the inverse of the sameOriginWithAncestors argument value that was passed into the internal method

§unknown_keys: IndexMap<String, Value>

CollectedClientData can be extended in the future, this accounts for unknown keys Uses an IndexMap to preserve order of keys for JSON byte serialization

Trait Implementations§

source§

impl Clone for CollectedClientData

source§

fn clone(&self) -> CollectedClientData

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CollectedClientData

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for CollectedClientData

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for CollectedClientData

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,