48 parent::__construct( $query, $moduleName,
'ami' );
49 $this->authManager = $authManager;
56 'canauthenticatenow' => $this->authManager->canAuthenticateNow(),
57 'cancreateaccounts' => $this->authManager->canCreateAccounts(),
58 'canlinkaccounts' => $this->authManager->canLinkAccounts(),
61 if ( $params[
'securitysensitiveoperation'] !==
null ) {
62 $ret[
'securitysensitiveoperationstatus'] = $this->authManager->securitySensitiveOperationStatus(
63 $params[
'securitysensitiveoperation']
67 if ( $params[
'requestsfor'] ) {
68 $action = $params[
'requestsfor'];
70 $preservedReq = $helper->getPreservedRequest();
71 if ( $preservedReq ) {
73 'haspreservedstate' => $preservedReq->hasStateForAction( $action ),
74 'hasprimarypreservedstate' => $preservedReq->hasPrimaryStateForAction( $action ),
75 'preservedusername' => (string)$preservedReq->username,
79 'haspreservedstate' =>
false,
80 'hasprimarypreservedstate' =>
false,
81 'preservedusername' =>
'',
85 $reqs = $this->authManager->getAuthenticationRequests( $action, $this->
getUser() );
89 case AuthManager::ACTION_CHANGE:
91 $this->
getConfig()->
get( MainConfigNames::ChangeCredentialsBlacklist )
94 case AuthManager::ACTION_REMOVE:
96 $this->
getConfig()->
get( MainConfigNames::RemoveCredentialsBlacklist )
101 $ret += $helper->formatRequests( $reqs );
113 'securitysensitiveoperation' =>
null,
115 ParamValidator::PARAM_TYPE => [
116 AuthManager::ACTION_LOGIN,
117 AuthManager::ACTION_LOGIN_CONTINUE,
118 AuthManager::ACTION_CREATE,
119 AuthManager::ACTION_CREATE_CONTINUE,
120 AuthManager::ACTION_LINK,
121 AuthManager::ACTION_LINK_CONTINUE,
122 AuthManager::ACTION_CHANGE,
123 AuthManager::ACTION_REMOVE,
124 AuthManager::ACTION_UNLINK,
132 'action=query&meta=authmanagerinfo&amirequestsfor=' . urlencode( AuthManager::ACTION_LOGIN )
133 =>
'apihelp-query+authmanagerinfo-example-login',
134 'action=query&meta=authmanagerinfo&amirequestsfor=' . urlencode( AuthManager::ACTION_LOGIN ) .
135 '&amimergerequestfields=1'
136 =>
'apihelp-query+authmanagerinfo-example-login-merged',
137 'action=query&meta=authmanagerinfo&amisecuritysensitiveoperation=foo'
138 =>
'apihelp-query+authmanagerinfo-example-securitysensitiveoperation',
143 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Authmanagerinfo';
Helper class for AuthManager-using API modules.
static getStandardParams( $action,... $wantedParams)
Fetch the standard parameters this helper recognizes.
static blacklistAuthenticationRequests(array $reqs, array $remove)
Filter out authentication requests by class name.
getResult()
Get the result object.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
getModuleName()
Get the name of the module being executed by this instance.
A query action to return meta information about AuthManager state.
__construct(ApiQuery $query, $moduleName, AuthManager $authManager)
getHelpUrls()
Return links to more detailed help pages about the module.
getExamplesMessages()
Returns usage examples for this module.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
isReadMode()
Indicates whether this module requires read rights.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
This is a base class for all Query modules.
This is the main query class.
A class containing constants representing the names of configuration variables.