feat(domain): value objects, entities, port traits with tests
This commit is contained in:
14
crates/domain/src/value_objects/password.rs
Normal file
14
crates/domain/src/value_objects/password.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
// Manual Debug — redacts hash to prevent it appearing in logs
|
||||
#[derive(Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct PasswordHash(String);
|
||||
|
||||
impl std::fmt::Debug for PasswordHash {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_tuple("PasswordHash").field(&"[redacted]").finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl PasswordHash {
|
||||
pub fn from_hash(hash: String) -> Self { Self(hash) }
|
||||
pub fn as_str(&self) -> &str { &self.0 }
|
||||
}
|
||||
Reference in New Issue
Block a user