log {create,verify}_user_token
This commit is contained in:
parent
9f08d698c3
commit
6bfda3f16b
1 changed files with 9 additions and 4 deletions
13
src/auth.rs
13
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!()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue