pub trait CredentialStore {
type PasskeyItem: TryInto<Passkey> + Send + Sync;
// 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,
options: Options,
) -> Pin<Box<dyn Future<Output = Result<(), StatusCode>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_credential<'life0, 'async_trait>(
&'life0 mut self,
cred: Passkey,
) -> Pin<Box<dyn Future<Output = Result<(), StatusCode>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StoreInfo> + 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§
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,
options: Options,
) -> 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,
options: Options,
) -> Pin<Box<dyn Future<Output = Result<(), StatusCode>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Save the new credential into your store
Sourcefn update_credential<'life0, 'async_trait>(
&'life0 mut self,
cred: Passkey,
) -> Pin<Box<dyn Future<Output = Result<(), StatusCode>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_credential<'life0, 'async_trait>(
&'life0 mut self,
cred: Passkey,
) -> Pin<Box<dyn Future<Output = Result<(), StatusCode>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update the credential in your store