From 6bfda3f16b4e31524b7bc6cd6dacf4cf70b33486 Mon Sep 17 00:00:00 2001 From: DenebTM Date: Sat, 10 Feb 2024 11:20:35 +0100 Subject: [PATCH] log {create,verify}_user_token --- src/auth.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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!() }