MediaWiki REL1_28
|
Helper class for AuthManager-using API modules. More...
Public Member Functions | |
__construct (ApiBase $module) | |
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, $result) | |
Logs successful or failed authentication. | |
securitySensitiveOperation ( $operation) | |
Call $manager->securitySensitiveOperationStatus() | |
Static Public Member Functions | |
static | blacklistAuthenticationRequests (array $reqs, array $blacklist) |
Filter out authentication requests by class name. | |
static | getStandardParams ( $action, $param) |
Fetch the standard parameters this helper recognizes. | |
static | newForModule (ApiBase $module) |
Static version of the constructor, for chaining. | |
Private Member Functions | |
formatFields (array $fields) | |
Clean up a field array for output. | |
formatMessage (array &$res, $key, Message $message) | |
Format a message for output. | |
Private Attributes | |
string | $messageFormat |
Message output format. | |
ApiBase | $module |
API module, for context and parameters. | |
Helper class for AuthManager-using API modules.
Intended for use via composition.
Definition at line 36 of file ApiAuthManagerHelper.php.
ApiAuthManagerHelper::__construct | ( | ApiBase | $module | ) |
ApiBase | $module | API module, for context and parameters |
Definition at line 47 of file ApiAuthManagerHelper.php.
References $module, $params, and ApiBase\extractRequestParams().
|
static |
Filter out authentication requests by class name.
AuthenticationRequest[] | $reqs | Requests to filter |
string[] | $blacklist | Class names to remove |
Definition at line 125 of file ApiAuthManagerHelper.php.
Referenced by ApiChangeAuthenticationData\execute(), ApiClientLogin\execute(), and ApiQueryAuthManagerInfo\execute().
ApiAuthManagerHelper::formatAuthenticationResponse | ( | AuthenticationResponse | $res | ) |
Format an AuthenticationResponse for return.
AuthenticationResponse | $res |
Definition at line 194 of file ApiAuthManagerHelper.php.
References $res, $ret, formatMessage(), and formatRequests().
|
private |
Clean up a field array for output.
ApiBase | $module | For context and parameters 'mergerequestfields' and 'messageformat' |
array | $fields |
Definition at line 323 of file ApiAuthManagerHelper.php.
References $module, $name, $ret, as, formatMessage(), plain, ApiResult\setArrayType(), and use.
Referenced by formatRequests().
Format a message for output.
array | &$res | Result array |
string | $key | Result key |
Message | $message |
Definition at line 69 of file ApiAuthManagerHelper.php.
References $res, Message\getKey(), Message\getParams(), Message\setContext(), and ApiResult\setIndexedTagName().
Referenced by formatAuthenticationResponse(), formatFields(), and formatRequests().
ApiAuthManagerHelper::formatRequests | ( | array | $reqs | ) |
Format an array of AuthenticationRequests for return.
AuthenticationRequest[] | $reqs |
Definition at line 278 of file ApiAuthManagerHelper.php.
References $params, $req, $ret, array(), as, formatFields(), formatMessage(), and ApiResult\META_TYPE.
Referenced by formatAuthenticationResponse().
ApiAuthManagerHelper::getPreservedRequest | ( | ) |
Fetch the preserved CreateFromLoginAuthenticationRequest, if any.
Definition at line 267 of file ApiAuthManagerHelper.php.
References $ret.
|
static |
Fetch the standard parameters this helper recognizes.
string | $action | AuthManager action |
string | $param,... | Parameters to use |
Definition at line 360 of file ApiAuthManagerHelper.php.
References $name, $params, $ret, as, ApiBase\PARAM_DFLT, ApiBase\PARAM_HELP_MSG, ApiBase\PARAM_ISMULTI, ApiBase\PARAM_REQUIRED, and ApiBase\PARAM_TYPE.
Referenced by ApiAMCreateAccount\getAllowedParams(), ApiChangeAuthenticationData\getAllowedParams(), ApiClientLogin\getAllowedParams(), ApiLinkAccount\getAllowedParams(), ApiQueryAuthManagerInfo\getAllowedParams(), and ApiRemoveAuthenticationData\getAllowedParams().
ApiAuthManagerHelper::loadAuthenticationRequests | ( | $action | ) |
ApiAuthManagerHelper::logAuthenticationResult | ( | $event, | |
$result | |||
) |
Logs successful or failed authentication.
string | AuthenticationResponse | $result | Response or error message |
string | $event | Event type (e.g. 'accountcreation') |
Definition at line 244 of file ApiAuthManagerHelper.php.
References $module, $status, and ApiBase\getModuleName().
|
static |
Static version of the constructor, for chaining.
ApiBase | $module | API module, for context and parameters |
Definition at line 59 of file ApiAuthManagerHelper.php.
References $module.
Referenced by ApiRemoveAuthenticationData\execute().
ApiAuthManagerHelper::securitySensitiveOperation | ( | $operation | ) |
Call $manager->securitySensitiveOperationStatus()
string | $operation | Operation being checked. |
UsageException |
Definition at line 98 of file ApiAuthManagerHelper.php.
References $status.
|
private |
Message output format.
Definition at line 42 of file ApiAuthManagerHelper.php.
|
private |
API module, for context and parameters.
Definition at line 39 of file ApiAuthManagerHelper.php.
Referenced by __construct(), formatFields(), logAuthenticationResult(), and newForModule().