A helper class for throttling authentication attempts.
More...
Inherits LoggerAwareInterface.
|
| | __construct (?array $conditions=null, array $params=[]) |
| |
| | clear ( $username=null, $ip=null) |
| | Clear the throttle counter.
|
| |
| | increase ( $username=null, $ip=null, $caller=null) |
| | Increase the throttle counter and return whether the attempt should be throttled.
|
| |
| | setLogger (LoggerInterface $logger) |
| |
A helper class for throttling authentication attempts.
- Since
- 1.27
Definition at line 26 of file Throttler.php.
◆ __construct()
| MediaWiki\Auth\Throttler::__construct |
( |
?array | $conditions = null, |
|
|
array | $params = [] ) |
◆ clear()
| MediaWiki\Auth\Throttler::clear |
( |
| $username = null, |
|
|
| $ip = null ) |
Clear the throttle counter.
Should be called after a successful authentication attempt.
- Parameters
-
| string | null | $username | |
| string | null | $ip | |
Definition at line 163 of file Throttler.php.
◆ increase()
| MediaWiki\Auth\Throttler::increase |
( |
| $username = null, |
|
|
| $ip = null, |
|
|
| $caller = null ) |
Increase the throttle counter and return whether the attempt should be throttled.
Should be called before an authentication attempt.
- Parameters
-
| string | null | $username | |
| string | null | $ip | |
| string | null | $caller | The authentication method from which we were called. |
- Returns
- array|false False if the attempt should not be throttled, an associative array with three keys otherwise:
- throttleIndex: which throttle condition was met (a key of the conditions array)
- count: throttle count (ie. number of failed attempts)
- wait: time in seconds until authentication can be attempted
Definition at line 110 of file Throttler.php.
◆ logRejection()
| MediaWiki\Auth\Throttler::logRejection |
( |
array | $context | ) |
|
|
protected |
◆ normalizeThrottleConditions()
| static MediaWiki\Auth\Throttler::normalizeThrottleConditions |
( |
| $throttleConditions | ) |
|
|
staticprotected |
◆ setLogger()
| MediaWiki\Auth\Throttler::setLogger |
( |
LoggerInterface | $logger | ) |
|
◆ $cache
◆ $conditions
| array [] MediaWiki\Auth\Throttler::$conditions |
|
protected |
◆ $logger
| LoggerInterface MediaWiki\Auth\Throttler::$logger |
|
protected |
◆ $type
| string MediaWiki\Auth\Throttler::$type |
|
protected |
◆ $warningLimit
| int float MediaWiki\Auth\Throttler::$warningLimit |
|
protected |
The documentation for this class was generated from the following file: