log {create,verify}_user_token

This commit is contained in:
deneb 2024-02-10 11:20:35 +01:00
parent 9f08d698c3
commit 6bfda3f16b

View file

@ -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!()
}