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).

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 edited projects, added MediaWiki-Action-API; removed Patch-For-Review.
matmarex set Security to None.
matmarex removed a subscriber: Unknown Object (MLST).

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.