webauthn_authenticator_rs/ctap2/
yubikey.rs1use async_trait::async_trait;
2
3use crate::{
4 prelude::WebauthnCError,
5 transport::{
6 yubikey::{YubiKeyConfig, YubiKeyToken},
7 Token,
8 },
9 ui::UiCallback,
10};
11
12use super::Ctap20Authenticator;
13
14#[async_trait]
25pub trait YubiKeyAuthenticator {
26 async fn get_yubikey_config(&mut self) -> Result<YubiKeyConfig, WebauthnCError>;
27}
28
29#[async_trait]
30impl<'a, T: Token + YubiKeyToken, U: UiCallback> YubiKeyAuthenticator
31 for Ctap20Authenticator<'a, T, U>
32{
33 #[inline]
34 async fn get_yubikey_config(&mut self) -> Result<YubiKeyConfig, WebauthnCError> {
35 self.token.get_yubikey_config().await
36 }
37}