domain crate code quality cleanup

strip all comments, extract tests to tests/ dirs,
remove #[allow(clippy::...)], extract magic numbers to
constants, refactor schedule engine private methods to
use param structs, add Default impls, clippy.toml for
persistence constructors
This commit is contained in:
2026-07-12 04:02:12 +02:00
parent d650e2ba07
commit 98a54245b1
54 changed files with 1190 additions and 1942 deletions

View File

@@ -1,19 +1,8 @@
//! Authentication port.
//!
//! Abstracts password hashing and verification so the domain layer
//! never depends on a specific hashing algorithm (bcrypt, argon2, etc.).
use crate::errors::DomainResult;
/// Port for password hashing and verification.
///
/// Implementations live in the infra layer (e.g. `BcryptAuthService`).
/// These methods are intentionally synchronous — hashing libraries are CPU-bound
/// and should be spawned on a blocking thread pool by the caller if needed.
// Intentionally sync: CPU-bound hashing should run on a blocking thread pool
pub trait AuthService: Send + Sync {
/// Hash a plaintext password and return the encoded hash string.
fn hash_password(&self, password: &str) -> DomainResult<String>;
/// Verify a plaintext password against an encoded hash.
fn verify_password(&self, password: &str, hash: &str) -> DomainResult<bool>;
}