API: Overhaul token handling
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 8 Aug 2014 16:56:07 +0000 (17:56 +0100)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 26 Aug 2014 18:53:45 +0000 (14:53 -0400)
commitfdddf94570efc33fd06f16c72d41636a45cf203a
tree92568e71339b40e72971a30bfb818422daddc13f
parentb728d6920b05c8b667651f7e99d749496474f02b
API: Overhaul token handling

The current token handling is a mess. This simplifies things greatly:
* *All* tokens are obtained from action=query&meta=tokens, rather than
  being spread over action=tokens, action=query&prop=info,
  action=query&prop=revisions, action=query&prop=recentchanges, and
  action=query&prop=users. All these old methods are deprecated.
* Similarly, there is only one hook to register new token types. All old
  hooks are deprecated.
* All tokens are cacheable.
* Most token types are dropped in favor of a 'csrf' token. They already
  were returning the same token anyway.
* All token-using modules will document the required token type in a
  standard manner in action=help and are documented in machine-readable
  fashion in action=paraminfo.

Note this will require updates to all extensions using tokens.

Change-Id: I2793a3f2dd64a4bebb0b4d065e09af1e9f63fb89
35 files changed:
RELEASE-NOTES-1.24
docs/hooks.txt
includes/AutoLoader.php
includes/api/ApiBase.php
includes/api/ApiBlock.php
includes/api/ApiDelete.php
includes/api/ApiEditPage.php
includes/api/ApiEmailUser.php
includes/api/ApiFileRevert.php
includes/api/ApiImageRotate.php
includes/api/ApiImport.php
includes/api/ApiMain.php
includes/api/ApiMove.php
includes/api/ApiOptions.php
includes/api/ApiParamInfo.php
includes/api/ApiPatrol.php
includes/api/ApiProtect.php
includes/api/ApiQuery.php
includes/api/ApiQueryDeletedrevs.php
includes/api/ApiQueryInfo.php
includes/api/ApiQueryRecentChanges.php
includes/api/ApiQueryRevisions.php
includes/api/ApiQueryTokens.php [new file with mode: 0644]
includes/api/ApiQueryUserInfo.php
includes/api/ApiQueryUsers.php
includes/api/ApiRevisionDelete.php
includes/api/ApiRollback.php
includes/api/ApiSetNotificationTimestamp.php
includes/api/ApiTokens.php
includes/api/ApiUnblock.php
includes/api/ApiUndelete.php
includes/api/ApiUpload.php
includes/api/ApiUserrights.php
includes/api/ApiWatch.php
includes/resourceloader/ResourceLoaderUserTokensModule.php