impl From<String> for {Password,UserToken}
This commit is contained in:
parent
9cd4848ce8
commit
e4aa6c1909
10
src/auth.rs
10
src/auth.rs
|
@ -8,9 +8,19 @@ use tracing::instrument;
|
||||||
use crate::db::{Database, SqliteDatabase};
|
use crate::db::{Database, SqliteDatabase};
|
||||||
#[derive(Debug, Clone, Deserialize)]
|
#[derive(Debug, Clone, Deserialize)]
|
||||||
pub struct Password(pub SecretString);
|
pub struct Password(pub SecretString);
|
||||||
|
impl From<String> for Password {
|
||||||
|
fn from(value: String) -> Self {
|
||||||
|
Self(SecretString::new(value))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Deserialize)]
|
#[derive(Debug, Clone, Deserialize)]
|
||||||
pub struct UserToken(pub SecretString);
|
pub struct UserToken(pub SecretString);
|
||||||
|
impl From<String> for UserToken {
|
||||||
|
fn from(value: String) -> Self {
|
||||||
|
Self(SecretString::new(value))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Authenticator<DB: Database> {
|
pub struct Authenticator<DB: Database> {
|
||||||
|
|
Loading…
Reference in a new issue