Page MenuHomePhabricator

Set up a Pywikibot OAuth test client on the Beta cluster
Closed, ResolvedPublic

Description

We aim to be testing on the Beta-Cluster soon.
See T100796.

It would be good to have OAuth also tested on the beta cluster. This doesnt depend on T100796, as the beta cluster could be used for only the OAuth tests.

See http://deployment.wikimedia.beta.wmflabs.org/wiki/Main_Page

Report

I investigated all available sites listed on http://deployment.wikimedia.beta.wmflabs.org/wiki/Special:SiteMatrix, only deployment has OAuth consumer registration enabled. I think deployment is not for testing. So the best choice is to add a new wiki for this purpose in my opinion.

How to add a new wiki: https://wikitech.wikimedia.org/wiki/Nova_Resource:Deployment-prep/Add_a_wiki

[Update]

As @hashar and @csteipp mentioned, deployment acts as a central wiki, so OAuth client registration is activated there.
The process fo setting up an OAuth client:

  1. Register on deployment
  2. Log into deployment and navigate to Propose page
  3. Fill in the form according to your OAuth client and submit. REMEMBER to record OAuth consumer token and secrect token
  4. As soon as the proposal is verified, OAuth client should work.

Note: Only Autoconfirmed users and Confirmed users have the right to propose new OAuth consumers. If you're not in either of these two groups, you may need to ask @hashar or @csteipp for help.

Event Timeline

jayvdb assigned this task to VcamX.
jayvdb raised the priority of this task from to Medium.
jayvdb updated the task description. (Show Details)
jayvdb subscribed.
VcamX set Security to None.
VcamX updated the task description. (Show Details)

The deployment.wikimedia wiki is indeed the OAuth. commonsettings-labs.php has:

if ( $wmgUseOAuth ) {
    $wgMWOAuthCentralWiki = 'deploymentwiki'; // T59403

    // T61141 - Return this to true and reset secrets once SSL works in labs
    $wgMWOAuthSecureTokenTransfer = false;
}

So it looks like it is perfectly legitimate for your test suite to require OAuth tokens from there :)

'deployment' is very confusing, it is more or less the equivalent of meta for the beta cluster.

Thanks for your reply, @hashar! I've registered on deployment but don't have rights to propose. It told me that only users of group Autoconfirmed users and Confirmed users have rights. I'm in Users group. Could you help me with that? My username is also 'Vcamx'.

I have marked the global account VcamX as a confirmed user:

08:40 UTC, 21 July 2015 Hashar (Talk | contribs | block) changed group membership for User:VcamX from (none) to confirmed user (pywikibot and OAuth https://phabricator.wikimedia.org/T104764)

@hashar I've proposed a consumer. The callback url of the previous one I proposed is wrong so it could be rejected.

Excellent! Thanks for the direct links that saved me a lot of time since I am not at all familiar with OAuth interface. Seems the v1.1 with the proper URL is now approved : http://deployment.wikimedia.beta.wmflabs.org/wiki/Special:OAuthManageConsumers/approved :)

Hey @csteipp , for info the pywikibot framework is experimenting with OAuth on the beta cluster. I guess the framework will eventually get rid of user/passwords \o/

Yes, beta, like production, is setup with a central OAuth server so clients
only need one authorization to use OAuth on all wikis in the cluster. In
beta that's deployment, so that's where you should do the registration.

If you set the callback to Special:OAuth/verified, it just shows you the
authorization token. Not sure if that helps, but that's what I do for
command line clients.

jayvdb renamed this task from Investigate process for setting up an OAuth client on the Beta cluster to Set up a Pywikibot OAuth test client on the Beta cluster.Jul 24 2015, 7:32 AM

Rather than wait for T100797: Set up Pywikibot account on beta sites to run user tests, I think this test should have a dedicated account "Pywikibot-oauth". Travis can have a separate environment variable for this account name and any secrets needed.

Hi @hashar. After discussion with @jayvdb, we'd like to use Pywikibot-oauth as an official account for OAuth testing. Could you help me to assign this account to group of Confirmed users so I could propose a new OAuth client? Thank you!

Changed group membership for User:Pywikibot-oauth from (none) to confirmed user :-}

@hashar Thanks! Th new consumer is proposed. I think the old one could be set to disabled or expired.

@hashar, it looks like the OAuth client lacks the two permissions about watch list:
https://travis-ci.org/VcamX/pywikibot-core/jobs/73185512#L741
https://travis-ci.org/VcamX/pywikibot-core/jobs/73185512#L800
Sorry for my careless. I proposed a new client, also the old one could be disabled. Thank you! :)

I disabled the old consumer and approved the new one :-)

Thanks @hashar!
The tests seem to work well on the beta cluster :D