Page MenuHomePhabricator

Display convenient links from OAuth special pages to each other (where appropriate)
Closed, ResolvedPublic

Description

The OAuth extension should make it easier for users to discover other actions for a specific OAuth consumer from each of it's special page, where it makes sense. These include:

Uii, that looks nice, and it also allows us to get multiple students into the OAuth extension, one for each linking, isn't it? So, just for clarification, these are the links we want to introduce, right?

  • Special:OAuthListConsumers/view/<key>-> Special:OAuthConsumerRegistration/update/<key> (owner only)
  • Special:OAuthListConsumers/view/<key> -> Special:OAuthManageConsumers/<key> (admin only)
  • Special:OAuthListConsumers/view/<key> -> Special:OAuthManageMyGrants/update/<id> (only if user granted this client[1]) -> https://gerrit.wikimedia.org/r/c/mediawiki/extensions/OAuth/+/571067
  • Special:OAuthConsumerRegistration/update/<key> -> Special:OAuthListConsumers/view/<key> (everyone)
  • Special:OAuthManageConsumers/<key> -> Special:OAuthListConsumers/view/<key> (everyone)
  • Special:OAuthManageMyGrants/update/<id> -> Special:OAuthListConsumers/view/<key> (everyone)

The links can be added as sitelinks.

[1]
From key to acceptance id: create consumer via MWOAuthConsumer::newFromKey; create acceptance via MWOAuthConsumerAcceptance::newFromUserConsumerWiki and MWOAuthUtils::getCentralIdFromLocalUser; use getId. From acceptance id to key: create acceptance via MWOAuthConsumerAcceptance::newFromId; get consumer id via getId; get consumer via MWOAuthConsumer::newFromId; use getConsumerKey.

Original task:

Ideally, we want to have a button / link to go from the view page of an OAuth page to its management page.

from this:
https://meta.wikimedia.org/wiki/Special:OAuthListConsumers/view/c122a589c582777abedab6d24ad9b6ee

to this: https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/update/c122a589c582777abedab6d24ad9b6ee

Getting Started Resources

Event Timeline

Tgr added subscribers: Ammarpad, Florian, Tgr.

There are three views, Special:OAuthListConsumers/view/<key> (public), Special:OAuthConsumerRegistration/update/<key> (owner) and Special:OAuthManageConsumers/<key> (admin). Crosslinking each of them (to the extent the user has permissions) from every other would certainly be nice. It's fairly easy, maybe GCI mentors are interested (@Florian, @Ammarpad?)

Uii, that looks nice, and it also allows us to get multiple students into the OAuth extension, one for each linking, isn't it? So, just for clarification, these are the links we want to introduce, right?

Special:OAuthListConsumers/view/<key>-> Special:OAuthConsumerRegistration/update/<key> (owner only) -> https://codein.withgoogle.com/dashboard/tasks/5226177791262720/
Special:OAuthListConsumers/view/<key> -> Special:OAuthManageConsumers/<key> (admin only) -> https://codein.withgoogle.com/dashboard/tasks/5922937232687104/

Special:OAuthConsumerRegistration/update/<key> -> Special:OAuthListConsumers/view/<key> (everyone) -> https://codein.withgoogle.com/dashboard/tasks/6475187634044928/
Special:OAuthConsumerRegistration/update/<key> -> Special:OAuthManageConsumers/<key> (admin only) -> https://codein.withgoogle.com/dashboard/tasks/5506873499844608/

Special:OAuthManageConsumers/<key> -> Special:OAuthListConsumers/view/<key> (everyone) -> https://codein.withgoogle.com/dashboard/tasks/4994274052014080/
Special:OAuthManageConsumers/<key> -> Special:OAuthConsumerRegistration/update/<key> (owner only) -> https://codein.withgoogle.com/dashboard/tasks/5276117708046336/

I would suggest doing this as sitelinks (directly under the title of the special pages)!?

If that's correct, I'll create the GCI tasks out of it :)

@Tgr Should we merge T166826 here? Also what do you think of T112062?

Thanks Florian!

OAuthManageConsumers -> OAuthConsumerRegistration and the reverse is probably not really useful in practice. The other four are legit; view is what people tend to use on wiki since that works for everyone so connecting that back and forth with the forms is useful.

There's also Special:OAuthManageMyGrants/update/<id> (for revoking grants as a user) which might also be useful to link to/from OAuthListConsumers/view (no value in linking with the others), but that's a bit more complicated since that's a different ID. (From key to acceptance id: create consumer via MWOAuthConsumer::newFromKey; create acceptance via MWOAuthConsumerAcceptance::newFromUserConsumerWiki and MWOAuthUtils::getCentralIdFromLocalUser; use getId. From acceptance id to key: create acceptance via MWOAuthConsumerAcceptance::newFromId; get consumer id via getId; get consumer via MWOAuthConsumer::newFromId; use getConsumerKey.)

Another complication is that Special:OAuthListConsumers (and Special:OAuthManageMyGrants) exists on all wikis but Special:OAuthConsumerRegistration and Special:OAuthManageConsumers on the central wiki only. Given the massive mess that is interwiki handling in MediaWiki, it's probably best to just not show them when not on the central wiki (there's MWOAuthUtils::isCentralWiki for checking).

I would suggest doing this as sitelinks (directly under the title of the special pages)!?

Makes sense. Note though that most of these already make use of sitelinks to some extent (or maybe just show similarly formatted links, I'm not sure).

Also if you are looking for more easy tasks, the Special:OAuthConsumerRegistration/list, Special:OAuthListConsumers and Special:OAuthListConsumers/view/... UIs are disaster areas and a GCI student with interest in design could improve them a lot.

@Tgr Should we merge T166826 here? Also what do you think of T112062?

Thanks, T112062: Hard to navigate between different types of OAuth pages is indeed the same. I forgot about having filed that.

T112062: Hard to navigate between different types of OAuth pages is a bit different (it's about Special:OAuthConsumerRegistration/list) but also an easy task. mwoauthlistconsumers-view could be reused for the message.

T112062: Hard to navigate between different types of OAuth pages is a bit different (it's about Special:OAuthConsumerRegistration/list) but also an easy task. mwoauthlistconsumers-view could be reused for the message.

I assume you mean T166826: Add /view links to the /list page here.

OAuthManageConsumers -> OAuthConsumerRegistration and the reverse is probably not really useful in practice.

Agreed, I'll remove them :)

There's also Special:OAuthManageMyGrants/update/<id> (for revoking grants as a user) which might also be useful to link to/from OAuthListConsumers/view (no value in linking with the others), but that's a bit more complicated since that's a different ID. (From key to acceptance id: create consumer via MWOAuthConsumer::newFromKey; create acceptance via MWOAuthConsumerAcceptance::newFromUserConsumerWiki and MWOAuthUtils::getCentralIdFromLocalUser; use getId. From acceptance id to key: create acceptance via MWOAuthConsumerAcceptance::newFromId; get consumer id via getId; get consumer via MWOAuthConsumer::newFromId; use getConsumerKey.)

Let's see if a GCI student wants to take that challenge :)

Another complication is that Special:OAuthListConsumers (and Special:OAuthManageMyGrants) exists on all wikis but Special:OAuthConsumerRegistration and Special:OAuthManageConsumers on the central wiki only. Given the massive mess that is interwiki handling in MediaWiki, it's probably best to just not show them when not on the central wiki (there's MWOAuthUtils::isCentralWiki for checking).

Umpf... I already smelled something like that :D I'll add the condition to the tasks :)

Florian renamed this task from Display a convenient link from `view` to `update` to Display convenient links from OAuth special pages to each other (where appropriate).Jan 5 2020, 11:14 AM
Florian updated the task description. (Show Details)

I added the new set of links and the GCI tasks for them to the description.

@Tgr: To the sitelinks problem: We could also hijack the SkinTemplateOutputPageBeforeExec to add these actions as nav_urls in the Tools section on the left navigation menu. What do you think about that? The problem is, that this information must not need to be used by Skins/Templates, so the information could be "lost" when not added as sitelinks to the special page. And it is more complicated to achieve, though. To be honest: I'm not sure if I like that idea myself at all :D

I doubt I'd notice extra links in the sidebar, it's so full of stuff of dubious usefulness already. Sitelinks (or even something custom within the content area) are more useful IMO.

Hi folks! As GCI is over, could we remove the GCI site links from the task description? From a newcomer's point of view, I don't quite understand what exactly I am supposed to do in this task. For example, is it about adding new links (if so where) or making adjustments to existing one (if so how to get to those links)? Then, I am not sure what exactly this section is about [1] From key to acceptance id: create consumer via MWOAuthConsumer::newFromKey. As this task is still a good first task, I think it would benefit from helpful getting started steps.

Special pages are in the includes/frontend/specialpages directory. An example of adding links can be seen in SpecialMWOAuthManageConsumers::addQueueSubtitleLinks() - start from that and use some judgement wrt formatting.

Change 571067 had a related patch set uploaded (by Florianschmidtwelzow; owner: Florianschmidtwelzow):
[mediawiki/extensions/OAuth@master] [Special:OAuthListConsumers/view/<key>] add convenient navigation links

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

Change 571067 merged by jenkins-bot:
[mediawiki/extensions/OAuth@master] [Special:OAuthListConsumers/view/<key>] add convenient navigation links

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

Ammarpad assigned this task to Florian.
Florian removed Florian as the assignee of this task.

Oops, nice to see that this one was resolved, however, there're still links missing:

Special:OAuthConsumerRegistration/update/<key> -> Special:OAuthListConsumers/view/<key> (everyone)

Special:OAuthManageConsumers/<key> -> Special:OAuthListConsumers/view/<key> (everyone)

Special:OAuthManageMyGrants/update/<id> -> Special:OAuthListConsumers/view/<key> (everyone)

Unassigning myself as well. I'm not sure, when I find the time for doing that, and I don't want to block someone else doing it :)

Change 573394 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/extensions/OAuth@master] OAuth: Add navigation links to special pages (part two)

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

Change 573394 merged by jenkins-bot:
[mediawiki/extensions/OAuth@master] OAuth: Add navigation links to special pages (part two)

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

Looks great, thanks @Florian and @Ammarpad!

One small fix is left:

Another complication is that Special:OAuthListConsumers (and Special:OAuthManageMyGrants) exists on all wikis but Special:OAuthConsumerRegistration and Special:OAuthManageConsumers on the central wiki only. Given the massive mess that is interwiki handling in MediaWiki, it's probably best to just not show them when not on the central wiki (there's MWOAuthUtils::isCentralWiki for checking).

Change 575761 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/extensions/OAuth@master] OAuth: Add navigation links to special pages (part three)

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

Florian claimed this task.

Change 575761 merged by jenkins-bot:
[mediawiki/extensions/OAuth@master] OAuth: Add navigation links to special pages (part three)

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