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);
|
pub struct Password(pub SecretString);
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct UserToken(pub SecretString);
|
pub struct UserToken(pub SecretString);
|
||||||
|
impl DebugSecret for UserToken {}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct Authenticator {
|
pub struct Authenticator {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
@ -15,10 +18,12 @@ impl Authenticator {
|
||||||
Self {}
|
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!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[instrument]
|
||||||
pub fn verify_user_token(&self, token: &UserToken) -> bool {
|
pub fn verify_user_token(&self, token: &UserToken) -> bool {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue