30 $this->
addWarning( [
'apiwarn-tokens-origin' ] );
42 foreach ( $params[
'type'] as $type ) {
43 $token =
self::getToken( $user, $session, $salts[$type] )->toString();
44 $fit = $this->
getResult()->addValue(
$path, $type .
'token', $token );
49 array_diff( $params[
'type'], $done ) );
71 'rollback' =>
'rollback',
72 'userrights' =>
'userrights',
73 'login' => [
'',
'login' ],
74 'createaccount' => [
'',
'createaccount' ],
78 $hookRunner->onApiQueryTokensRegisterTypes( $salts );
98 if ( is_array( $salt ) ) {
99 $token = $session->getToken( ...$salt );
103 if ( $token->wasNew() ) {
113 ParamValidator::PARAM_DEFAULT =>
'csrf',
114 ParamValidator::PARAM_ISMULTI =>
true,
115 ParamValidator::PARAM_TYPE => array_keys( self::getTokenTypeSalts() ),
116 ParamValidator::PARAM_ALL =>
true,
124 'action=query&meta=tokens'
125 =>
'apihelp-query+tokens-example-simple',
126 'action=query&meta=tokens&type=watch|patrol'
127 =>
'apihelp-query+tokens-example-types',
139 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Tokens';
144class_alias( ApiQueryTokens::class,
'ApiQueryTokens' );