Skip to content

Commit 6deb857

Browse files
committed
feat(CERNLDAPSyncPlugin): sync CCID / CERN Person ID to CS
fix: formatting fix (CERNLDAPSyncPlugin): Only add person ID for primary or secondary accounts - not service accounts
1 parent 385b299 commit 6deb857

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/DIRAC/ConfigurationSystem/Client/SyncPlugins/CERNLDAPSyncPlugin.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ def verifyAndUpdateUserInfo(self, username, userDict):
3232
else:
3333
userDict["PrimaryCERNAccount"] = self._findOwnerAccountName(username, attributes)
3434

35+
if cernAccountType in ["Primary", "Secondary"]:
36+
userDict["CERNPersonId"] = attributes.get("employeeId", [None])[0]
37+
3538
def _findOwnerAccountName(self, username, attributes):
3639
"""Find the owner account from a CERN LDAP entry.
3740
@@ -64,7 +67,7 @@ def _getUserInfo(self, commonName):
6467
status, result, response, _ = self._connection.search(
6568
"OU=Users,OU=Organic Units,DC=cern,DC=ch",
6669
f"(CN={commonName})",
67-
attributes=["cernAccountOwner", "cernAccountType"],
70+
attributes=["cernAccountOwner", "cernAccountType", "employeeId"],
6871
)
6972
if not status:
7073
raise ValueError(f"Bad status from LDAP search: {result}")

0 commit comments

Comments
 (0)