ApiClientLimitResult
in package
FinalYes
Result of an application key limit check. For an exceeded limit it carries the window that caused it, `Retry-After` (seconds to the end of the window, at least 1) and whether this is the first refusal in the window; only that one is written to the auth log, so a flood does not flood the log too.
Table of Contents
Constants
- WINDOW_IP : string = 'ip_minute'
- WINDOW_MINUTE : string = 'client_minute'
- WINDOW_SECOND : string = 'client_second'
- WINDOW_USER : string = 'user_minute'
Properties
- $allowed : bool
- $firstRefusal : bool
- $limit : int
- $retryAfter : int
- $window : string|null
Methods
- allowed() : self
- exceeded() : self
- __construct() : mixed
Constants
WINDOW_IP
public
string
WINDOW_IP
= 'ip_minute'
WINDOW_MINUTE
public
string
WINDOW_MINUTE
= 'client_minute'
WINDOW_SECOND
public
string
WINDOW_SECOND
= 'client_second'
WINDOW_USER
public
string
WINDOW_USER
= 'user_minute'
Properties
$allowed read-only
public
bool
$allowed
$firstRefusal read-only
public
bool
$firstRefusal
= false
$limit read-only
public
int
$limit
= 0
$retryAfter read-only
public
int
$retryAfter
= 0
$window read-only
public
string|null
$window
= null
Methods
allowed()
public
static allowed() : self
Return values
selfexceeded()
public
static exceeded(string $window, int $limit, int $retryAfter, bool $firstRefusal) : self
Parameters
- $window : string
- $limit : int
- $retryAfter : int
- $firstRefusal : bool
Return values
self__construct()
private
__construct(bool $allowed[, string|null $window = null ][, int $limit = 0 ][, int $retryAfter = 0 ][, bool $firstRefusal = false ]) : mixed
Parameters
- $allowed : bool
- $window : string|null = null
- $limit : int = 0
- $retryAfter : int = 0
- $firstRefusal : bool = false