44 $this->
addWarning( [
'apiwarn-tokens-origin' ] );
56 foreach (
$params[
'type'] as $type ) {
57 $token =
self::getToken( $user, $session, $salts[$type] )->toString();
58 $fit = $this->
getResult()->addValue(
$path, $type .
'token', $token );
63 array_diff(
$params[
'type'], $done ) );
85 'rollback' =>
'rollback',
86 'userrights' =>
'userrights',
87 'login' => [
'',
'login' ],
88 'createaccount' => [
'',
'createaccount' ],
92 $hookRunner->onApiQueryTokensRegisterTypes( $salts );
112 if ( is_array( $salt ) ) {
114 return $session->getToken( ...$salt );
123 ParamValidator::PARAM_DEFAULT =>
'csrf',
124 ParamValidator::PARAM_ISMULTI =>
true,
125 ParamValidator::PARAM_TYPE => array_keys( self::getTokenTypeSalts() ),
126 ParamValidator::PARAM_ALL =>
true,
133 'action=query&meta=tokens'
134 =>
'apihelp-query+tokens-example-simple',
135 'action=query&meta=tokens&type=watch|patrol'
136 =>
'apihelp-query+tokens-example-types',
146 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Tokens';
151class_alias( ApiQueryTokens::class,
'ApiQueryTokens' );
array $params
The job parameters.