use secrecy::{DebugSecret, SecretString}; use tracing::instrument; #[derive(Debug, Clone)] pub struct Password(pub SecretString); #[derive(Debug, Clone)] pub struct UserToken(pub SecretString); impl DebugSecret for UserToken {} #[derive(Debug)] pub struct Authenticator { // TODO } impl Authenticator { pub fn new(/* database credentials ? */) -> Self { Self {} } #[instrument] pub fn create_user_token(&mut self, username: &str, password: &Password) -> UserToken { todo!() } #[instrument] pub fn verify_user_token(&self, token: &UserToken) -> bool { todo!() } }