diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-10-11 14:59:36 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-10-11 14:59:36 -0400 |
| commit | a260438c5f0697b64aa1915b96f3b8ce25db070c (patch) | |
| tree | 7bf1e3293f25fc4f5b63a422c039e7cc9ba70ddd /src | |
| parent | 1798988c5bc6ad8c2286848df14c7fa478e135d1 (diff) | |
Blind debug output for StoredHash.
This is a little excessive, as PasswordHash (which StoredHash converts to) _does_ derive Debug and exposes the hash, but I'll feel better if the hash never ends up in logs.
Diffstat (limited to 'src')
| -rw-r--r-- | src/login/password.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/login/password.rs b/src/login/password.rs index da3930f..14fd981 100644 --- a/src/login/password.rs +++ b/src/login/password.rs @@ -4,7 +4,7 @@ use argon2::Argon2; use password_hash::{PasswordHash, PasswordHasher, PasswordVerifier, SaltString}; use rand_core::OsRng; -#[derive(Debug, sqlx::Type)] +#[derive(sqlx::Type)] #[sqlx(transparent)] pub struct StoredHash(String); @@ -23,6 +23,12 @@ impl StoredHash { } } +impl fmt::Debug for StoredHash { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_tuple("StoredHash").field(&"********").finish() + } +} + #[derive(serde::Deserialize)] #[serde(transparent)] pub struct Password(String); |
