PHP Class Airship\Engine\Security\AirBrake

Progressive rate-limiting
Afficher le fichier Open project: paragonie/airship

Protected Properties

Свойство Type Description
$config array
$db Database

Méthodes publiques

Méthode Description
__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

Method Details

__construct() public méthode

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

failFast() public méthode

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
Résultat boolean

getAccountRecoveryAttempts() public méthode

Get the number of recent account recovery attempts
public getAccountRecoveryAttempts ( string $username, string $ip ) : integer
$username string
$ip string
Résultat integer

getCutoff() public méthode

Convert a number of seconds into the appropriate DateInterval
public getCutoff ( integer $expire ) : DateInterval
$expire integer
Résultat DateInterval

getDelay() public méthode

Get the throttling delay (in milliseconds)
public getDelay ( string $username, string $ip, string $action = self::ACTION_LOGIN ) : integer
$username string
$ip string
$action string
Résultat integer

getFailedLoginAttempts() public méthode

Get the number of recent failed login attempts
public getFailedLoginAttempts ( string $username, string $ip ) : integer
$username string
$ip string
Résultat integer

getFastExit() public méthode

public getFastExit ( ) : boolean
Résultat boolean

getIPv4Subnet() public méthode

Return the given subnet for an IPv4 address and mask bits
public getIPv4Subnet ( string $ip, integer $maskBits = 32 ) : string
$ip string
$maskBits integer
Résultat string

getIPv6Subnet() public méthode

Return the given subnet for an IPv6 address and mask bits
public getIPv6Subnet ( string $ip, integer $maskBits = 48 ) : string
$ip string
$maskBits integer
Résultat string

getLogPublicKey() public méthode

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
Résultat EncryptionPublicKey

getSubnet() public méthode

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
Résultat string

registerAccountRecoveryAttempt() public méthode

Register account recovery attempt
public registerAccountRecoveryAttempt ( string $username, string $ip ) : boolean
$username string
$ip string
Résultat boolean

registerLoginFailure() public méthode

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
Résultat boolean

Property Details

$config protected_oe property

protected array $config
Résultat array

$db protected_oe property

protected Database $db
Résultat Database