use async_trait::async_trait;
use unftp_core::auth::{AuthenticationError, Authenticator, Credentials, Principal};
#[derive(Debug)]
pub struct AnonymousAuthenticator;
#[async_trait]
impl Authenticator for AnonymousAuthenticator {
#[allow(clippy::type_complexity)]
#[tracing_attributes::instrument]
async fn authenticate(&self, username: &str, _creds: &Credentials) -> Result<Principal, AuthenticationError> {
Ok(Principal {
username: username.to_string(),
})
}
async fn cert_auth_sufficient(&self, _username: &str) -> bool {
true
}
}