server icon indicating copy to clipboard operation
server copied to clipboard

fix(user_ldap): Avoid extra LDAP request when mapping a user for the first time

Open come-nc opened this issue 1 year ago • 1 comments

Summary

Avoids using several LDAP searches to get UUID, display name and internal name, now gets all attributes at the same time. Also avoids extra request to build an unused user object in userExists.

TODO

  • [x] ~~Avoid extra request to fetch the display name by directly caching it. (The display name is fetched by dav to update the calendar entry as soon as the user is mapped).~~ This is too complicated because of internal quirks, keeping an extra request for the display name for now.

Checklist

come-nc avatar Jun 25 '24 15:06 come-nc

Tests are failing indicating problems with attributes case, but I have a hard time understanding how it’s supposed to be.

There is this worrying comment: https://github.com/nextcloud/server/blob/3a97dbf248b3e581b5782a638743958eb6f2a640/apps/user_ldap/lib/Configuration.php#L301-L303

It’s not the only one a few of the attributes are not lower cased by the configuration it seems, but as far as I can see all methods getting record from the LDAP do lower case the keys so I’m not sure how it works.

come-nc avatar Jul 09 '24 16:07 come-nc

/backport to stable30

max-nextcloud avatar Feb 12 '25 12:02 max-nextcloud