use serde::{Deserialize, Serialize};
#[cfg(feature = "typeshare")]
use typeshare::typeshare;
mod credential_properties;
mod pseudo_random_function;
pub use credential_properties::*;
pub use pseudo_random_function::*;
#[cfg(doc)]
use crate::webauthn::PublicKeyCredential;
#[derive(Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(feature = "typeshare", typeshare)]
pub struct AuthenticationExtensionsClientInputs {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cred_props: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub prf: Option<AuthenticationExtensionsPrfInputs>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub prf_already_hashed: Option<AuthenticationExtensionsPrfInputs>,
}
impl AuthenticationExtensionsClientInputs {
pub fn zip_contents(self) -> Option<Self> {
let Self {
cred_props,
prf,
prf_already_hashed,
} = &self;
let has_cred_props = cred_props.is_some();
let has_prf = prf.is_some();
let has_prf_already_hashed = prf_already_hashed.is_some();
(has_cred_props || has_prf || has_prf_already_hashed).then_some(self)
}
}
#[derive(Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(feature = "typeshare", typeshare(swift = "Equatable, Hashable"))]
pub struct AuthenticationExtensionsClientOutputs {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cred_props: Option<CredentialPropertiesOutput>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub prf: Option<AuthenticationExtensionsPrfOutputs>,
}