|
MediaWiki master
|
Helper class for AuthManager-using API modules. More...
Public Member Functions | |
| __construct (ApiBase $module, ?AuthManager $authManager=null, ?UserIdentityUtils $identityUtils=null) | |
| formatAuthenticationResponse (AuthenticationResponse $res) | |
| Format an AuthenticationResponse for return. | |
| formatRequests (array $reqs) | |
| Format an array of AuthenticationRequests for return. | |
| getPreservedRequest () | |
| Fetch the preserved CreateFromLoginAuthenticationRequest, if any. | |
| loadAuthenticationRequests ( $action) | |
| Fetch and load the AuthenticationRequests for an action. | |
| logAuthenticationResult ( $event, UserIdentity $performer, AuthenticationResponse $result) | |
| Logs successful or failed authentication. | |
| securitySensitiveOperation ( $operation) | |
| Call $manager->securitySensitiveOperationStatus() | |
Static Public Member Functions | |
| static | blacklistAuthenticationRequests (array $reqs, array $remove) |
| Filter out authentication requests by class name. | |
| static | getStandardParams ( $action,... $wantedParams) |
| Fetch the standard parameters this helper recognizes. | |
| static | newForModule (ApiBase $module, ?AuthManager $authManager=null) |
| Static version of the constructor, for chaining. | |
Helper class for AuthManager-using API modules.
Intended for use via composition.
Definition at line 31 of file ApiAuthManagerHelper.php.
| MediaWiki\Api\ApiAuthManagerHelper::__construct | ( | ApiBase | $module, |
| ?AuthManager | $authManager = null, | ||
| ?UserIdentityUtils | $identityUtils = null ) |
| ApiBase | $module | API module, for context and parameters |
| AuthManager | null | $authManager | |
| UserIdentityUtils | null | $identityUtils |
Definition at line 48 of file ApiAuthManagerHelper.php.
References MediaWiki\Api\ApiBase\extractRequestParams(), and MediaWiki\MediaWikiServices\getInstance().
|
static |
Filter out authentication requests by class name.
| AuthenticationRequest[] | $reqs | Requests to filter |
| string[] | $remove | Class names to remove |
Definition at line 133 of file ApiAuthManagerHelper.php.
Referenced by MediaWiki\Api\ApiChangeAuthenticationData\execute(), MediaWiki\Api\ApiClientLogin\execute(), and MediaWiki\Api\ApiQueryAuthManagerInfo\execute().
| MediaWiki\Api\ApiAuthManagerHelper::formatAuthenticationResponse | ( | AuthenticationResponse | $res | ) |
Format an AuthenticationResponse for return.
| AuthenticationResponse | $res |
Definition at line 198 of file ApiAuthManagerHelper.php.
References MediaWiki\Api\ApiMessage\create(), and MediaWiki\Api\ApiAuthManagerHelper\formatRequests().
| MediaWiki\Api\ApiAuthManagerHelper::formatRequests | ( | array | $reqs | ) |
Format an array of AuthenticationRequests for return.
| AuthenticationRequest[] | $reqs |
Definition at line 281 of file ApiAuthManagerHelper.php.
References MediaWiki\Api\ApiResult\META_TYPE.
Referenced by MediaWiki\Api\ApiAuthManagerHelper\formatAuthenticationResponse().
| MediaWiki\Api\ApiAuthManagerHelper::getPreservedRequest | ( | ) |
Fetch the preserved CreateFromLoginAuthenticationRequest, if any.
Definition at line 270 of file ApiAuthManagerHelper.php.
|
static |
Fetch the standard parameters this helper recognizes.
| string | $action | AuthManager action |
| string | ...$wantedParams Parameters to use |
Definition at line 363 of file ApiAuthManagerHelper.php.
References MediaWiki\Api\ApiBase\PARAM_HELP_MSG.
Referenced by MediaWiki\Api\ApiAMCreateAccount\getAllowedParams(), MediaWiki\Api\ApiChangeAuthenticationData\getAllowedParams(), MediaWiki\Api\ApiClientLogin\getAllowedParams(), MediaWiki\Api\ApiLinkAccount\getAllowedParams(), MediaWiki\Api\ApiQueryAuthManagerInfo\getAllowedParams(), and MediaWiki\Api\ApiRemoveAuthenticationData\getAllowedParams().
| MediaWiki\Api\ApiAuthManagerHelper::loadAuthenticationRequests | ( | $action | ) |
Fetch and load the AuthenticationRequests for an action.
| string | $action | One of the AuthManager::ACTION_* constants |
Definition at line 148 of file ApiAuthManagerHelper.php.
References MediaWiki\Auth\AuthenticationRequest\getUniqueId().
| MediaWiki\Api\ApiAuthManagerHelper::logAuthenticationResult | ( | $event, | |
| UserIdentity | $performer, | ||
| AuthenticationResponse | $result ) |
Logs successful or failed authentication.
| string | $event | Event type (e.g. 'accountcreation') |
| UserIdentity | $performer | |
| AuthenticationResponse | $result | Response or error message |
Definition at line 250 of file ApiAuthManagerHelper.php.
References MediaWiki\Api\ApiBase\getModuleName().
|
static |
Static version of the constructor, for chaining.
| ApiBase | $module | API module, for context and parameters |
| AuthManager | null | $authManager |
Definition at line 68 of file ApiAuthManagerHelper.php.
Referenced by MediaWiki\Api\ApiRemoveAuthenticationData\execute().
| MediaWiki\Api\ApiAuthManagerHelper::securitySensitiveOperation | ( | $operation | ) |
Call $manager->securitySensitiveOperationStatus()
| string | $operation | Operation being checked. |
| ApiUsageException |
Definition at line 108 of file ApiAuthManagerHelper.php.