Page MenuHomePhabricator

ApiTokens should be a query module
Closed, ResolvedPublic

Description

Author: a.d.bergi

Description:
relating to Bug 27757

The idea was good to add a possibilty for retrieving tokens without specifying a page. Still, it should be a query module instead of an extra action.

An advantage would be that this allows retrieving information about the user and the wiki in only one request, as you can combine queries.

Tokens are clearly a meta property ([[mw:API:Meta]]), I suppose they could even be integrated into the userinfo module (where they'd belong also logically - retrieving information about the currently logged-in user).


Version: 1.20.x
Severity: normal

Details

Reference
bz36078

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:22 AM
bzimport set Reference to bz36078.

I have a question to the whole concept, asking in bug 27757 :)

a.d.bergi wrote:

gerrit patch set

Attached:

You can make easy links with "gerrit<space><changenumber>": gerrit 5300

a.d.bergi wrote:

(In reply to comment #3)

You can make easy links with "gerrit<space><changenumber>": Gerrit change #5300

OK, but why does [[mw:How to become a MediaWiki hacker#Committing]] state "Post a link to your Gerrit changeset _as_an_attachment_ to the appropriate bug report in Bugzilla"?

(In reply to comment #4)

(In reply to comment #3)

You can make easy links with "gerrit<space><changenumber>": Gerrit change #5300

OK, but why does [[mw:How to become a MediaWiki hacker#Committing]] state "Post
a link to your Gerrit changeset _as_an_attachment_ to the appropriate bug
report in Bugzilla"?

That is a good question. I am not sure, why that is there and why bugs should mark with "patch", when the patch is already commited to gerrit.

I have add a hint to gerrit link syntax for bugzilla[1].

[1] https://www.mediawiki.org/w/index.php?title=How_to_become_a_MediaWiki_hacker&diff=530342&oldid=518421

a.d.bergi wrote:

Why was this reverted in gerrit change 6596 ?

beau wrote:

It was not reverted. Your change is still awaiting review and merge. The change you linked moves single token (options) to action=tokens.

This issue has been raised in https://bugzilla.wikimedia.org/show_bug.cgi?id=27757#c16:

"I have a question here - currently the token is session-based, but if no longer
bind the token to the target page (edit|delete|protect|move) or the user
(block|unblock), aren't we losing possibility of ever introducing a
notification/conflict resolution/etc. mechanism to notify ("someone is working
on this right now") - kind of "soft advisory locking" on an object?

FlaggedRevs is trying to do this to show that somebody is reviewing the page
right now."

There is also a comment in the code review from Anomie:

"But I think we really need to take a step back and decide just what the model for each kind of token really is, and make it available from the place where it makes the most sense. For example, the token for action=edit currently depends just on the user/session. But do we want to basically "reserve the right" to make it depend on the page being edited? If so, it should stay in prop=info and not be added here; if not, add it here *and* deprecate it in prop=info."

I think this should be addressed/discussed before committing this change.

Overall token discussion is in bug 45199.