MediaWiki REL1_40
|
A pre-authentication provider to throttle authentication actions. More...
Inherits MediaWiki\Auth\AbstractPreAuthenticationProvider.
Public Member Functions | ||||||||||
__construct ( $params=[]) | ||||||||||
postAuthentication ( $user, AuthenticationResponse $response) | ||||||||||
testForAccountCreation ( $user, $creator, array $reqs) | ||||||||||
Determine whether an account creation may begin.Called from AuthManager::beginAccountCreation()
| ||||||||||
testForAuthentication (array $reqs) | ||||||||||
Determine whether an authentication may begin.Called from AuthManager::beginAuthentication()
| ||||||||||
Public Member Functions inherited from MediaWiki\Auth\AbstractPreAuthenticationProvider | ||||||||||
getAuthenticationRequests ( $action, array $options) | ||||||||||
Return the applicable list of AuthenticationRequests.Possible values for $action depend on whether the implementing class is also a PreAuthenticationProvider, PrimaryAuthenticationProvider, or SecondaryAuthenticationProvider.
| ||||||||||
postAccountCreation ( $user, $creator, AuthenticationResponse $response) | ||||||||||
Post-creation callback.This will be called at the end of an account creation attempt. It will not be called if the account creation process results in a session timeout (possibly after a successful user creation, while a secondary provider is waiting for a response).
| ||||||||||
postAccountLink ( $user, AuthenticationResponse $response) | ||||||||||
Post-link callback.This will be called at the end of an account linking attempt.
| ||||||||||
testForAccountLink ( $user) | ||||||||||
Determine whether an account may linked to another authentication method.
| ||||||||||
testUserForCreation ( $user, $autocreate, array $options=[]) | ||||||||||
Determine whether an account may be created.
| ||||||||||
Public Member Functions inherited from MediaWiki\Auth\AbstractAuthenticationProvider | ||||||||||
getUniqueId () | ||||||||||
Return a unique identifier for this instance.This must be the same across requests. If multiple instances return the same ID, exceptions will be thrown from AuthManager.
| ||||||||||
init (LoggerInterface $logger, AuthManager $manager, HookContainer $hookContainer, Config $config, UserNameUtils $userNameUtils) | ||||||||||
Initialise with dependencies of an AuthenticationProvider. | ||||||||||
setConfig (Config $config) | ||||||||||
setHookContainer (HookContainer $hookContainer) | ||||||||||
setLogger (LoggerInterface $logger) | ||||||||||
setManager (AuthManager $manager) | ||||||||||
Protected Member Functions | |
postInitSetup () | |
A provider can override this to do any necessary setup after init() is called. | |
Protected Member Functions inherited from MediaWiki\Auth\AbstractAuthenticationProvider | |
getHookContainer () | |
getHookRunner () | |
Protected Attributes | |
Throttler | $accountCreationThrottle |
BagOStuff | $cache |
Throttler | $passwordAttemptThrottle |
array | $throttleSettings |
Protected Attributes inherited from MediaWiki\Auth\AbstractAuthenticationProvider | |
Config | $config |
LoggerInterface | $logger |
AuthManager | $manager |
UserNameUtils | $userNameUtils |
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.
MediaWiki\Auth\ThrottlePreAuthenticationProvider::postAuthentication | ( | $user, | |
AuthenticationResponse | $response ) |
null | \\User | $user | |
AuthenticationResponse | $response |
Reimplemented from MediaWiki\Auth\AbstractPreAuthenticationProvider.
Definition at line 163 of file ThrottlePreAuthenticationProvider.php.
References MediaWiki\Auth\AuthenticationResponse\PASS.
|
protected |
A provider can override this to do any necessary setup after init() is called.
Reimplemented from MediaWiki\Auth\AbstractAuthenticationProvider.
Definition at line 64 of file ThrottlePreAuthenticationProvider.php.
References MediaWiki\Auth\ThrottlePreAuthenticationProvider\$accountCreationThrottle, MediaWiki\MainConfigNames\AccountCreationThrottle, and MediaWiki\MainConfigNames\PasswordAttemptThrottle.
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 100 of file ThrottlePreAuthenticationProvider.php.
References MediaWiki\Auth\AbstractAuthenticationProvider\getHookRunner(), 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 122 of file ThrottlePreAuthenticationProvider.php.
References MediaWiki\Auth\AuthenticationRequest\getUsernameFromRequests(), and wfMessage().
|
protected |
Definition at line 42 of file ThrottlePreAuthenticationProvider.php.
Referenced by MediaWiki\Auth\ThrottlePreAuthenticationProvider\postInitSetup().
|
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.