aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiAuthManagerHelper.php
diff options
context:
space:
mode:
authorBrad Jorsch <bjorsch@wikimedia.org>2016-05-24 14:05:52 -0400
committerBrad Jorsch <bjorsch@wikimedia.org>2016-05-30 08:25:19 -0400
commite10f96cff1968df001b068efd3147dd53f41d3bc (patch)
tree77dd50b62a90ecb4c1429f8bc90523c1249cd894 /includes/api/ApiAuthManagerHelper.php
parent5cbada9dea3f22e7bb33250197b156e8628b8e4a (diff)
downloadmediawikicore-e10f96cff1968df001b068efd3147dd53f41d3bc.tar.gz
mediawikicore-e10f96cff1968df001b068efd3147dd53f41d3bc.zip
API: Fixes for AuthManager
* Set API response metadata on the AuthenticationRequest metadata so it is output as an assoc generally. * Remove the 'image' field in AuthenticationRequest::getFieldInfo()'s response, since we ended up not using it anywhere. * Make it so meta=authmanagerinfo can be used on private wikis without logging in, so action=clientlogin can be used to log in. ** This generalizes the exception for meta=tokens that was added in I83dafb030. * ApiAuthManagerInfo needs the "messageformat" parameter. * ApiAuthManagerInfo shouldn't be publically cached, since the responses vary depending on session state. Change-Id: Iea5ddb4ef9febed18f16a7ae8314968026f39148
Diffstat (limited to 'includes/api/ApiAuthManagerHelper.php')
-rw-r--r--includes/api/ApiAuthManagerHelper.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/includes/api/ApiAuthManagerHelper.php b/includes/api/ApiAuthManagerHelper.php
index 299740571b79..e30f22b64e71 100644
--- a/includes/api/ApiAuthManagerHelper.php
+++ b/includes/api/ApiAuthManagerHelper.php
@@ -244,7 +244,7 @@ class ApiAuthManagerHelper {
$describe = $req->describeCredentials();
$reqInfo = [
'id' => $req->getUniqueId(),
- 'metadata' => $req->getMetadata(),
+ 'metadata' => $req->getMetadata() + [ ApiResult::META_TYPE => 'assoc' ],
];
switch ( $req->required ) {
case AuthenticationRequest::OPTIONAL:
@@ -283,7 +283,6 @@ class ApiAuthManagerHelper {
private function formatFields( array $fields ) {
static $copy = [
'type' => true,
- 'image' => true,
'value' => true,
];