diff --git a/src/auth.rs b/src/auth.rs index 7d0f2c8..324db45 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -1,11 +1,14 @@ -use secrecy::SecretString; +use secrecy::{DebugSecret, SecretString}; +use tracing::instrument; -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct Password(pub SecretString); -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct UserToken(pub SecretString); +impl DebugSecret for UserToken {} +#[derive(Debug)] pub struct Authenticator { // TODO } @@ -15,10 +18,12 @@ impl Authenticator { Self {} } - pub fn create_user_token(&mut self, username: &str, password: &str) -> UserToken { + #[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!() }