interface LoginThrottleInterface (View source)

Records login attempts and reports lockouts; the Application layer owns the storage and thresholds.

Stage identifiers are the {\Poweradmin\Domain\Port\LoginAttemptStage} values.

Methods

void
recordAttempt(string $username, string $ipAddress, bool $successful, string $attemptType = 'password', int|null $userId = null)

No description

bool
isAccountLocked(string $username, string $ipAddress, string $attemptType = 'password', int|null $userId = null)

No description

Details

void recordAttempt(string $username, string $ipAddress, bool $successful, string $attemptType = 'password', int|null $userId = null)

No description

Parameters

string $username
string $ipAddress
bool $successful
string $attemptType

Lockout stage identifier; defaults to "password" so existing callers (SQL/LDAP/DDNS) are unchanged. Pass STAGE_MFA from the MFA verify path to keep second-factor failures from polluting the first-factor counter.

int|null $userId

Account the attempt belongs to. Pass it whenever the caller already knows it, rather than relying on the username to resolve: the MFA stage verifies against the pending user id, and keying the counter on a separately held session name would let the two drift.

Return Value

void

bool isAccountLocked(string $username, string $ipAddress, string $attemptType = 'password', int|null $userId = null)

No description

Parameters

string $username
string $ipAddress
string $attemptType
int|null $userId

Return Value

bool