Page MenuHomePhabricator

CentralAuth's group membership is not reliable
Closed, ResolvedPublic

Description

SpecialCentralAuth uses UserGroupMembership::getMembershipForUser, which is given an userid and a database, but the database is ignored, which results in SpecialCentralAuth receiving incorrect results. An example is available at https://en.wikipedia.beta.wmflabs.org/wiki/Special:CentralAuth/Dyolf77_TEST. The acount should have confirmed, oversight, sysop at commons, but that's not true.

A fix: Use UserGroupManagerFactory at https://github.com/wikimedia/mediawiki-extensions-CentralAuth/blob/master/includes/CentralAuthUser.php#L2554, to get the DB-specific UserGroupManager.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Urbanecm triaged this task as Unbreak Now! priority.Jun 8 2020, 9:29 PM

This is going to seriously break Special:CentralAuth in production if train goes forward.

@Pchelolo see above - if the fix for CentralAuth can't be reviewed in time, we'll probably need to revert https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/545690

Change 603618 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[mediawiki/extensions/CentralAuth@master] CentralAuthUser: Stop using depracated UserGroupMembership::getMembershipsForUser

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

Confirmed the patch above works at my local CA instance, hopefully it will work in prod too :).

Change 603618 merged by jenkins-bot:
[mediawiki/extensions/CentralAuth@master] CentralAuthUser: Stop using depracated UserGroupMembership::getMembershipsForUser

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

@Urbanecm this has been resolved and is no longer a train blocker, correct?

Yes @jeena, this should work properly. Thanks for asking!