PHP Класс Airship\Engine\Security\AirBrake

Progressive rate-limiting
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$config array
$db Database

Открытые методы

Метод Описание
__construct ( Database $db = null, array $config = [] ) AirBrake constructor.
failFast ( string $username, string $ip, string $action = self::ACTION_LOGIN ) : boolean Returns true if we must fail fast and return an error message.
getAccountRecoveryAttempts ( string $username, string $ip ) : integer Get the number of recent account recovery attempts
getCutoff ( integer $expire ) : DateInterval Convert a number of seconds into the appropriate DateInterval
getDelay ( string $username, string $ip, string $action = self::ACTION_LOGIN ) : integer Get the throttling delay (in milliseconds)
getFailedLoginAttempts ( string $username, string $ip ) : integer Get the number of recent failed login attempts
getFastExit ( ) : boolean
getIPv4Subnet ( string $ip, integer $maskBits = 32 ) : string Return the given subnet for an IPv4 address and mask bits
getIPv6Subnet ( string $ip, integer $maskBits = 48 ) : string Return the given subnet for an IPv6 address and mask bits
getLogPublicKey ( string $publicKey = '' ) : EncryptionPublicKey Get the EncryptionPublicKey used for encrypting password guesses to give admins insight into the type of attack being launched.
getSubnet ( string $ip ) : string Return the given subnet for an IP and the configured mask bits
registerAccountRecoveryAttempt ( string $username, string $ip ) : boolean Register account recovery attempt
registerLoginFailure ( string $username, string $ip, integer $numFailures, HiddenString $password = null ) : boolean Register a failed login attempt

Описание методов

__construct() публичный Метод

AirBrake constructor.
public __construct ( Database $db = null, array $config = [] )
$db Database
$config array

failFast() публичный Метод

Returns true if we must fail fast and return an error message.
public failFast ( string $username, string $ip, string $action = self::ACTION_LOGIN ) : boolean
$username string
$ip string
$action string
Результат boolean

getAccountRecoveryAttempts() публичный Метод

Get the number of recent account recovery attempts
public getAccountRecoveryAttempts ( string $username, string $ip ) : integer
$username string
$ip string
Результат integer

getCutoff() публичный Метод

Convert a number of seconds into the appropriate DateInterval
public getCutoff ( integer $expire ) : DateInterval
$expire integer
Результат DateInterval

getDelay() публичный Метод

Get the throttling delay (in milliseconds)
public getDelay ( string $username, string $ip, string $action = self::ACTION_LOGIN ) : integer
$username string
$ip string
$action string
Результат integer

getFailedLoginAttempts() публичный Метод

Get the number of recent failed login attempts
public getFailedLoginAttempts ( string $username, string $ip ) : integer
$username string
$ip string
Результат integer

getFastExit() публичный Метод

public getFastExit ( ) : boolean
Результат boolean

getIPv4Subnet() публичный Метод

Return the given subnet for an IPv4 address and mask bits
public getIPv4Subnet ( string $ip, integer $maskBits = 32 ) : string
$ip string
$maskBits integer
Результат string

getIPv6Subnet() публичный Метод

Return the given subnet for an IPv6 address and mask bits
public getIPv6Subnet ( string $ip, integer $maskBits = 48 ) : string
$ip string
$maskBits integer
Результат string

getLogPublicKey() публичный Метод

Get the EncryptionPublicKey used for encrypting password guesses to give admins insight into the type of attack being launched.
public getLogPublicKey ( string $publicKey = '' ) : EncryptionPublicKey
$publicKey string Hex-encoded public key
Результат EncryptionPublicKey

getSubnet() публичный Метод

Determine if the IP is an IPv4 or IPv6 address, then pass to the correct method for handling that specific type.
public getSubnet ( string $ip ) : string
$ip string
Результат string

registerAccountRecoveryAttempt() публичный Метод

Register account recovery attempt
public registerAccountRecoveryAttempt ( string $username, string $ip ) : boolean
$username string
$ip string
Результат boolean

registerLoginFailure() публичный Метод

Register a failed login attempt
public registerLoginFailure ( string $username, string $ip, integer $numFailures, HiddenString $password = null ) : boolean
$username string
$ip string
$numFailures integer
$password HiddenString
Результат boolean

Описание свойств

$config защищенное свойство

protected array $config
Результат array

$db защищенное свойство

protected Database $db
Результат Database