package de.effigenix.application.usermanagement;

import de.effigenix.domain.usermanagement.PasswordHash;

/**
 * Port for password hashing and verification.
 * Implementation will be in Infrastructure Layer (BCrypt with strength 12).
 *
 * Application Layer defines the contract, Infrastructure Layer implements it.
 */
public interface PasswordHasher {

    /**
     * Hashes a plain-text password using BCrypt.
     *
     * @param plainPassword Plain-text password (never stored!)
     * @return BCrypt hash (60 characters, starts with $2a$, $2b$, or $2y$)
     */
    PasswordHash hash(String plainPassword);

    /**
     * Verifies a plain-text password against a BCrypt hash.
     *
     * @param plainPassword Plain-text password to verify
     * @param passwordHash BCrypt hash to compare against
     * @return true if password matches, false otherwise
     */
    boolean verify(String plainPassword, PasswordHash passwordHash);

    /**
     * Validates password strength (minimum requirements).
     *
     * @param plainPassword Plain-text password to validate
     * @return true if password meets requirements, false otherwise
     */
    boolean isValidPassword(String plainPassword);
}
