AuthManager fixups around the login→RESTART→create flow
authorBrad Jorsch <bjorsch@wikimedia.org>
Thu, 26 May 2016 17:09:14 +0000 (13:09 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 31 May 2016 15:44:02 +0000 (11:44 -0400)
commit9bb2875e2eb7e5deeff7b6647616eb279906b27b
treeb4a538f1f32206e4cb2ddccbade778c32f1c5bf6
parent5f6518239e472f11c87307464647687e1bf2c5a1
AuthManager fixups around the login→RESTART→create flow

* ApiQueryAuthManagerInfo will differentiate between preserved linking
  data and a preserved createRequest.
* ApiQueryAuthManagerInfo will indicate the preserved username, if any,
  because the client will have to pass that back to action=createaccount.
* ApiClientLogin won't tell about the confusing
  CreateFromLoginAuthenticationRequest returned on RESTART responses.
* Explain how 'preservestate' works in ApiAMCreateAccount's auto-doc.
* ConfirmLinkSecondaryAuthenticationProvider will filter out requests
  that can no longer be used (i.e. if it was for linking the account
  that got used for creation).
* All the complicated code in AuthManager::beginAccountCreation() was
  trying to deal with allowing the client to pass only the
  CreateFromLoginAuthenticationRequest. That was dumb, removed it.
* Added methods to CreateFromLoginAuthenticationRequest to indicate its
  status with respect to different kinds of preserved state.
* Increase accuracy of the AuthenticationResponse::$createRequest doc.

Change-Id: I726d79de18e739d6e60c1eea51453433c21ba207
12 files changed:
includes/api/ApiAMCreateAccount.php
includes/api/ApiClientLogin.php
includes/api/ApiQueryAuthManagerInfo.php
includes/api/i18n/en.json
includes/api/i18n/qqq.json
includes/auth/AuthManager.php
includes/auth/AuthenticationResponse.php
includes/auth/ConfirmLinkSecondaryAuthenticationProvider.php
includes/auth/CreateFromLoginAuthenticationRequest.php
tests/phpunit/includes/auth/AuthManagerTest.php
tests/phpunit/includes/auth/ConfirmLinkSecondaryAuthenticationProviderTest.php
tests/phpunit/includes/auth/CreateFromLoginAuthenticationRequestTest.php