use async_trait::async_trait;
use crate::{
prelude::WebauthnCError,
transport::{
yubikey::{YubiKeyConfig, YubiKeyToken},
Token,
},
ui::UiCallback,
};
use super::Ctap20Authenticator;
#[async_trait]
pub trait YubiKeyAuthenticator {
async fn get_yubikey_config(&mut self) -> Result<YubiKeyConfig, WebauthnCError>;
}
#[async_trait]
impl<'a, T: Token + YubiKeyToken, U: UiCallback> YubiKeyAuthenticator
for Ctap20Authenticator<'a, T, U>
{
#[inline]
async fn get_yubikey_config(&mut self) -> Result<YubiKeyConfig, WebauthnCError> {
self.token.get_yubikey_config().await
}
}