Page MenuHomePhabricator

mw.api.getToken should not use deprecated api.php?action=tokens
Closed, DuplicatePublic

Description

mw.api.getToken uses api.php?action=tokens

api.php?action=tokens generates

"warnings": {
    "tokens": {
        "*": "action=tokens has been deprecated. Please use action=query&meta=tokens instead."
    }
}

api.php?action=query&meta=tokens has different token types. A simple change of the URL does not work because this changes the JavaScript API. mw.api.getToken has to implement a mapping from the current token types to the corresponding new token type.

Details

Reference
bz72094

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:56 AM
bzimport set Reference to bz72094.
bzimport added a subscriber: Unknown Object (MLST).
Fomafix created this task.Oct 15 2014, 8:45 PM

gerritadmin wrote:

Change 166872 had a related patch set uploaded by Gerrit Patch Uploader:
mediawiki.api: Use action=query&meta=tokens instead of action=tokens

https://gerrit.wikimedia.org/r/166872

The fix has been merged and then reverted, because it's not compatible with extensions still using deprecated PHP-side APIs for tokens.

matmarex updated the task description. (Show Details)Nov 28 2014, 11:25 PM
matmarex edited projects, added MediaWiki-API; removed Patch-For-Review.
matmarex set Security to None.
matmarex removed a subscriber: Unknown Object (MLST).
Anomie moved this task from Unsorted to Needs Code on the MediaWiki-API board.Feb 19 2015, 6:20 PM
Anomie added a subscriber: Anomie.Jul 22 2015, 2:55 PM

The fix has been merged and then reverted, because it's not compatible with extensions still using deprecated PHP-side APIs for tokens.

It would probably be helpful if someone identified these extensions and filed bugs against them (blocking this task).

Krinkle raised the priority of this task from Medium to High.Oct 21 2015, 3:38 AM
Krinkle edited projects, added Performance-Team; removed MediaWiki-General.
This comment was removed by Krinkle.
Restricted Application removed a subscriber: Liuxinyu970226. · View Herald TranscriptOct 21 2015, 3:42 AM