Page MenuHomePhabricator

Store Wikimedia unified account name (SUL) in LDAP directory
Open, MediumPublic

Description

The mapping between an LDAP account and an SUL account is currently stored in Striker's local mysql database as part of the labsauth_labsuser table. This is convenient for Striker, but not convenient for other LDAP consumers who may want to use the same data.

The WMF corp LDAP schema was recently extended to support a wikimediaPerson object class (rOPUP6386a7a, rOPUP2ce2697). Something similar could be done for the labs/prod LDAP servers to give us a class and attribute for storing the SUL account. Striker would then be updated to add the new object class and attribute to an LDAP account when linking accounts.

Related Objects

StatusSubtypeAssignedTask
ResolvedPRODUCTION ERRORTgr
OpenNone
OpenNone
StalledNone
OpenNone
OpenNone
Opentaavi
ResolvedAndrew
ResolvedAndrew
ResolvedAndrew
ResolvedAndrew
ResolvedMarcoAurelio
ResolvedAndrew
Resolvedtaavi
DeclinedNone
DuplicateNone
OpenNone
ResolvedSLyngshede-WMF
Opentaavi
Opentaavi
ResolvedFeatureSLyngshede-WMF
ResolvedBUG REPORTSLyngshede-WMF
OpenNone
ResolvedMarostegui
ResolvedAndrew
ResolvedMarostegui
ResolvedAndrew
DeclinedAndrew
ResolvedAndrew
ResolvedAndrew
ResolvedLadsgroup
DuplicateNone
Resolved Bstorm
DeclinedNone
Resolvedtaavi
ResolvedJdforrester-WMF
DeclinedNone
Openjijiki
OpenNone
OpenFeatureNone
StalledFeatureNone
OpenFeatureSLyngshede-WMF
OpenNone
OpenNone
Opentaavi

Event Timeline

bd808 triaged this task as Medium priority.Oct 14 2016, 10:42 PM

I think we should use the same wmf-user.schema file across the labs and corp servers, but introduce a separate object class for storing the SUL mapping. This allows us to extend staff-specific attributes independantly and it the corp LDAP needs the SUL mapping at some point we can add the new object class to corp user accounts.

@faidon, @Volans, and I talked about this at the Vienna hackathon. Moving this data from Striker's local DB to LDAP would be a useful step in an as yet undocumented project to create an LDAP management portal to replace the current mix of wikitech, Striker, and cli tools used by SRE.

akosiaris changed the task status from Open to Stalled.Dec 15 2022, 10:13 AM
akosiaris subscribed.

This is open since 2016 with minimal updates, probably inaccurate now (as far as I know the corp LDAP doesn't exist now) and it is unclear, at least to me, what work can be done and by who. Thus, I am setting it as Stalled, feel free to reopen

This is open since 2016 with minimal updates, probably inaccurate now (as far as I know the corp LDAP doesn't exist now) and it is unclear, at least to me, what work can be done and by who. Thus, I am setting it as Stalled, feel free to reopen

We'll actually work on this as part of the Bitu IDM work, either next Q or the subsequent one, depending on progress and forthcoming quarterly planning! I'm adding it as a sub task of the IDM roadmap to keep track.

Change 886799 had a related patch set uploaded (by Slyngshede; author: Slyngshede):

[operations/puppet@production] P:openldap Extend wmf-user schema with SUL account.

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

SLyngshede-WMF changed the task status from Stalled to In Progress.Feb 6 2023, 8:24 AM
SLyngshede-WMF claimed this task.

Mentioned in SAL (#wikimedia-operations) [2023-04-24T09:55:51Z] <slyngs> Update LDAP schema wmf-user: T148048

Change 886799 merged by Slyngshede:

[operations/puppet@production] P:openldap Extend wmf-user schema with global account.

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

SLyngshede-WMF claimed this task.

@SLyngshede-WMF Are you expecting to update Striker to add objectClass: wikimediaPerson and set the wikimediaGlobalAccountId and wikimediaGlobalAccountName attributes on accounts it creates/updates?

@bd808 Wasn't expecting to, but I can do it :-)

@bd808 Wasn't expecting to, but I can do it :-)

I was mostly asking because of your claiming of this task. It will need doing at some point and this task was the tracking task for that need. The task decomposition probably could have been cleaner so that we had a task about the LDAP schema change and then a dependent ("parent" in Phabricator terms) task to track implementing the data storage changes in Striker to use the new schema.

Either way I will try to do a bit of analysis of at least the starting changes that will be needed on the Striker side to take advantage of the LDAP schema you have designed.

I think that broadly the changes needed for Striker now that the new LDAP schema has landed will be:

  • Add the wmf-user schema to the LDAP service in Striker's development environment
  • Update striker.labsauth.models.LabsUser to track the user's numeric SUL/Central Auth id as a new sulid field.
  • Update the Wikimedia OAuth connection process to collect the user's numeric SUL/Central Auth id.
  • Figure out a process to backfill the new LabsUser sulid field for existing users with a sulname value set. (This should be possible via the stored Wikimedia OAuth credentials for these users.)
  • Update striker.labsauth.models.LdapUser to include the wikimediaPerson objectClass.
    • NOTE: I can't remember if the declared object_classes are used as part of lookup queries or not. If they are, we will likely have to script a data migration to add the wikimediaPerson objectClass to all existing Developer accounts to keep everything working as expected.
  • Update striker.labsauth.models.LdapUser to include the new wikimediaGlobalAccountId and wikimediaGlobalAccountName attributes.
  • Update striker.labsauth.views.oauth_callback to set the wikimediaGlobalAccountId and wikimediaGlobalAccountName attributes on both the LabsUser and LdapUser models when an authenticated user is found.
  • Update striker.labsauth.utils.add_ldap_user to set the wikimediaGlobalAccountId and wikimediaGlobalAccountName attributes when creating a new LdapUser.
  • Figure out a process to backfill the new LdapUser wikimediaGlobalAccountId and wikimediaGlobalAccountName attributes for existing LabsUser records with sulname and sulid data.

I have local draft changes which confirm that a migration is needed to add an objectClass: wikimediaPerson attribute to each existing Developer account under the plan outlined in T148048#8802511.

Reopened because Striker needs to be made to work with the new schema and storage.

bd808 added a subscriber: SLyngshede-WMF.

Claiming for the needed changes to Striker described in T148048#8802511

[15:58]  <    taavi> bd808: is the striker work for T148048 still something you plan to do soon or can I take over?
[15:58]  < stashbot> T148048: Store Wikimedia unified account name (SUL) in LDAP directory - https://phabricator.wikimedia.org/T148048

[16:43]  <    bd808> taavi: I have a patch, but it is busted. I could get it up in gerrit for you to look at and take over or rewrite from scratch if you've got big Striker energy (which seems to be the cool case right now)
[16:44]  <    bd808> The bustedness is that the way I have coded it the LDAP directory needs a migration to add a new objectClass to all of the Developer accounts. Specifically the objectClass that holds the new attribute.

Change 1009321 had a related patch set uploaded (by BryanDavis; author: Bryan Davis):

[labs/striker@master] [WIP] Store SUL information in LDAP

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

bd808 removed bd808 as the assignee of this task.Mar 22 2024, 5:32 PM