feat(export): add auth password_hash export
zhenyi committed
Added lib/export/auth/password_hash.rs lib/export/auth/password_hash.rs +23 −0 View lib/export/auth/password_hash.rs
@@ -0,0 +1,23 @@
1use serde::{Deserialize, Serialize};
2
3/// Input payload for hashing / verifying a password.
4#[derive(Debug, Clone)]
5pub struct PasswordInput<'a> {
6 pub password: &'a str,
7}
8
9/// Result of [`hash_password`]: a PHC-formatted Argon2id string.
10#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct PasswordHashString(pub String);
12
13impl AsRef<str> for PasswordHashString {
14 fn as_ref(&self) -> &str {
15 &self.0
16 }
17}
18
19/// Strength validation request for the password policy.
20#[derive(Debug, Clone)]
21pub struct ValidatePasswordRequest<'a> {
22 pub password: &'a str,
23}