namespace SeaHaven.Services.Interfaces
{
///
/// Per-account limits on the anonymous password reset flow, keyed on the
/// normalized email so they hold however many client addresses an attacker uses.
///
public interface IPasswordResetThrottle
{
///
/// Counts a code request for the email and returns true while it is within the
/// hourly and daily limits. A refused request is not counted.
///
bool TryAcceptCodeRequest(string email);
///
/// Reserves one failed check for the email before a code is compared. Returns
/// false once the account has used its failed checks for the window.
///
bool TryReserveCheck(string email);
/// Gives back the reservation of a check whose code matched.
void ReleaseCheck(string email);
}
}