Add UserServerKey, ServerPadlock, ServerHash types

This commit is contained in:
Xiretza 2024-02-10 11:01:40 +00:00
parent d195147f35
commit 34a7d57507

View file

@ -1,5 +1,5 @@
use secrecy::SecretString; use secrecy::SecretString;
use serde::Deserialize; use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
pub struct Password(pub SecretString); pub struct Password(pub SecretString);
@ -16,3 +16,22 @@ impl From<String> for UserToken {
Self(SecretString::new(value)) Self(SecretString::new(value))
} }
} }
#[derive(Debug, Clone, Deserialize)]
pub struct UserServerKey(pub SecretString);
impl From<String> for UserServerKey {
fn from(value: String) -> Self {
Self(SecretString::new(value))
}
}
#[derive(Debug, Clone, Deserialize)]
pub struct ServerPadlock(pub SecretString);
impl From<String> for ServerPadlock {
fn from(value: String) -> Self {
Self(SecretString::new(value))
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ServerHash(pub Vec<u8>);