pub trait CredentialStore {
type PasskeyItem: TryInto<Passkey>;
// Required methods
fn find_credentials<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ids: Option<&'life1 [PublicKeyCredentialDescriptor]>,
rp_id: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<Vec<Self::PasskeyItem>, StatusCode>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn save_credential<'life0, 'async_trait>(
&'life0 mut self,
cred: Passkey,
user: PublicKeyCredentialUserEntity,
rp: PublicKeyCredentialRpEntity
) -> Pin<Box<dyn Future<Output = Result<(), StatusCode>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Use this on a type that enables storage and fetching of credentials
Required Associated Types§
sourcetype PasskeyItem: TryInto<Passkey>
type PasskeyItem: TryInto<Passkey>
Defines the return type of find_credentials(…)
Required Methods§
sourcefn find_credentials<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ids: Option<&'life1 [PublicKeyCredentialDescriptor]>,
rp_id: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<Vec<Self::PasskeyItem>, StatusCode>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn find_credentials<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ids: Option<&'life1 [PublicKeyCredentialDescriptor]>,
rp_id: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<Vec<Self::PasskeyItem>, StatusCode>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Find all credentials matching the given ids and rp_id.
If multiple are found, it is recommended to sort the credentials using their creation date before returning as the algorithm will take the first credential from the list for assertions.
sourcefn save_credential<'life0, 'async_trait>(
&'life0 mut self,
cred: Passkey,
user: PublicKeyCredentialUserEntity,
rp: PublicKeyCredentialRpEntity
) -> Pin<Box<dyn Future<Output = Result<(), StatusCode>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn save_credential<'life0, 'async_trait>(
&'life0 mut self,
cred: Passkey,
user: PublicKeyCredentialUserEntity,
rp: PublicKeyCredentialRpEntity
) -> Pin<Box<dyn Future<Output = Result<(), StatusCode>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Save the new/updated credential into your store