MediaWiki
1.30.2
|
A pre-authentication provider to throttle authentication actions. More...
Public Member Functions | |
__construct ( $params=[]) | |
postAuthentication ( $user, AuthenticationResponse $response) | |
setConfig (Config $config) | |
Set configuration. More... | |
testForAccountCreation ( $user, $creator, array $reqs) | |
Determine whether an account creation may begin. More... | |
testForAuthentication (array $reqs) | |
Determine whether an authentication may begin. More... | |
Public Member Functions inherited from MediaWiki\Auth\AbstractPreAuthenticationProvider | |
getAuthenticationRequests ( $action, array $options) | |
Return the applicable list of AuthenticationRequests. More... | |
postAccountCreation ( $user, $creator, AuthenticationResponse $response) | |
Post-creation callback. More... | |
postAccountLink ( $user, AuthenticationResponse $response) | |
Post-link callback. More... | |
testForAccountLink ( $user) | |
Determine whether an account may linked to another authentication method. More... | |
testUserForCreation ( $user, $autocreate, array $options=[]) | |
Determine whether an account may be created. More... | |
Public Member Functions inherited from MediaWiki\Auth\AbstractAuthenticationProvider | |
getUniqueId () | |
@inheritDoc More... | |
setLogger (LoggerInterface $logger) | |
setManager (AuthManager $manager) | |
Set AuthManager. More... | |
Protected Attributes | |
Throttler | $accountCreationThrottle |
BagOStuff | $cache |
Throttler | $passwordAttemptThrottle |
array | $throttleSettings |
Protected Attributes inherited from MediaWiki\Auth\AbstractAuthenticationProvider | |
Config | $config |
LoggerInterface | $logger |
AuthManager | $manager |
A pre-authentication provider to throttle authentication actions.
Adding this provider will throttle account creations and primary authentication attempts (more specifically, any authentication that returns FAIL on failure). Secondary authentication cannot be easily throttled on a framework level (since it would typically return UI on failure); secondary providers are expected to do their own throttling.
Definition at line 37 of file ThrottlePreAuthenticationProvider.php.
MediaWiki\Auth\ThrottlePreAuthenticationProvider::__construct | ( | $params = [] | ) |
array | $params |
|
Definition at line 58 of file ThrottlePreAuthenticationProvider.php.
References $params, cache, and ObjectCache\getLocalClusterInstance().
MediaWiki\Auth\ThrottlePreAuthenticationProvider::postAuthentication | ( | $user, | |
AuthenticationResponse | $response | ||
) |
null | \\User | $user | |
AuthenticationResponse | $response |
Reimplemented from MediaWiki\Auth\AbstractPreAuthenticationProvider.
Definition at line 161 of file ThrottlePreAuthenticationProvider.php.
References $name, $response, $user, as, and MediaWiki\Auth\AuthenticationResponse\PASS.
MediaWiki\Auth\ThrottlePreAuthenticationProvider::setConfig | ( | Config | $config | ) |
Set configuration.
Config | $config |
Reimplemented from MediaWiki\Auth\AbstractAuthenticationProvider.
Definition at line 65 of file ThrottlePreAuthenticationProvider.php.
References MediaWiki\Auth\ThrottlePreAuthenticationProvider\$accountCreationThrottle, MediaWiki\Auth\AbstractAuthenticationProvider\$config, and cache.
MediaWiki\Auth\ThrottlePreAuthenticationProvider::testForAccountCreation | ( | $user, | |
$creator, | |||
array | $reqs | ||
) |
Determine whether an account creation may begin.
Called from AuthManager::beginAccountCreation()
User | $user | User being created (not added to the database yet). This may become a "UserValue" in the future, or User may be refactored into such. |
User | $creator | User doing the creation. This may become a "UserValue" in the future, or User may be refactored into such. |
AuthenticationRequest[] | $reqs |
Reimplemented from MediaWiki\Auth\AbstractPreAuthenticationProvider.
Definition at line 102 of file ThrottlePreAuthenticationProvider.php.
References Hooks\run(), and wfMessage().
MediaWiki\Auth\ThrottlePreAuthenticationProvider::testForAuthentication | ( | array | $reqs | ) |
Determine whether an authentication may begin.
Called from AuthManager::beginAuthentication()
AuthenticationRequest[] | $reqs |
Reimplemented from MediaWiki\Auth\AbstractPreAuthenticationProvider.
Definition at line 124 of file ThrottlePreAuthenticationProvider.php.
References $e, $name, $username, as, MediaWiki\Auth\AuthenticationRequest\getUsernameFromRequests(), and wfMessage().
|
protected |
Definition at line 42 of file ThrottlePreAuthenticationProvider.php.
Referenced by MediaWiki\Auth\ThrottlePreAuthenticationProvider\setConfig().
|
protected |
Definition at line 48 of file ThrottlePreAuthenticationProvider.php.
|
protected |
Definition at line 45 of file ThrottlePreAuthenticationProvider.php.
|
protected |
Definition at line 39 of file ThrottlePreAuthenticationProvider.php.