Merge "API: Remove deprecated response values from action=login"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 29 Jul 2016 09:57:51 +0000 (09:57 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 29 Jul 2016 09:57:51 +0000 (09:57 +0000)
RELEASE-NOTES-1.28
includes/api/ApiLogin.php
tests/phpunit/includes/api/ApiLoginTest.php

index 5b77ac2..cff734b 100644 (file)
@@ -53,6 +53,9 @@ production.
   the value of $wgMaxArticleSize.
 * Property 'modulemessages' from action=parse&prop=modules was removed
   (deprecated since 1.26).
+* The following response properties from action=login, deprecated in 1.27, are
+  now removed: lgtoken, cookieprefix, sessionid. Clients should handle cookies
+  to properly manage session state.
 
 === Action API internal changes in 1.28 ===
 * Added a new hook, 'ApiMakeParserOptions', to allow extensions to better
index 0e4c6e0..1dadc07 100644 (file)
@@ -212,15 +212,6 @@ class ApiLogin extends ApiBase {
 
                                $result['lguserid'] = intval( $user->getId() );
                                $result['lgusername'] = $user->getName();
-
-                               // @todo: These are deprecated, and should be removed at some
-                               // point (1.28 at the earliest, and see T121527). They were ok
-                               // when the core cookie-based login was the only thing, but
-                               // CentralAuth broke that a while back and
-                               // SessionManager/AuthManager *really* break it.
-                               $result['lgtoken'] = $user->getToken();
-                               $result['cookieprefix'] = $this->getConfig()->get( 'CookiePrefix' );
-                               $result['sessionid'] = $session->getId();
                                break;
 
                        case 'NeedToken':
@@ -228,10 +219,6 @@ class ApiLogin extends ApiBase {
                                $this->setWarning( 'Fetching a token via action=login is deprecated. ' .
                                   'Use action=query&meta=tokens&type=login instead.' );
                                $this->logFeatureUsage( 'action=login&!lgtoken' );
-
-                               // @todo: See above about deprecation
-                               $result['cookieprefix'] = $this->getConfig()->get( 'CookiePrefix' );
-                               $result['sessionid'] = $session->getId();
                                break;
 
                        case 'WrongToken':
index 155a9dd..917a6ad 100644 (file)
@@ -190,7 +190,6 @@ class ApiLoginTest extends ApiTestCase {
                $this->assertArrayHasKey( "login", $data[0] );
                $this->assertArrayHasKey( "result", $data[0]['login'] );
                $this->assertEquals( "Success", $data[0]['login']['result'] );
-               $this->assertArrayHasKey( 'lgtoken', $data[0]['login'] );
        }
 
        public function testBotPassword() {