1Password / passkey-rs

A framework for defining Webauthn Authenticators that support passkeys
Apache License 2.0
116 stars 17 forks source link

CollectedClientData extensibility #5

Closed hariria closed 9 months ago

hariria commented 10 months ago

It's unclear how the CollectedClientData struct would accommodate new keys in the future given its current state. Are there any plans to add an additional field to accommodate for unexpected keys? Something like kandim's CollectedClientData:

/// The data collected and hashed in the operation.
/// <https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata>
#[derive(Debug, Serialize, Clone, Deserialize)]
pub struct CollectedClientData {
    /// The credential type
    #[serde(rename = "type")]
    pub type_: String,
    /// The challenge.
    pub challenge: Base64UrlSafeData,
    /// The rp origin as the browser understood it.
    pub origin: url::Url,
    /// The inverse of the sameOriginWithAncestors argument value that was
    /// passed into the internal method.
    #[serde(rename = "crossOrigin", skip_serializing_if = "Option::is_none")]
    pub cross_origin: Option<bool>,
    /// tokenBinding.
    #[serde(rename = "tokenBinding")]
    pub token_binding: Option<TokenBinding>,
    /// This struct be extended, so it's important to be tolerant of unknown
    /// keys.
    #[serde(flatten)]
    pub unknown_keys: BTreeMap<String, serde_json::value::Value>,
}
Progdrasil commented 9 months ago

Closed by #6