Add sync_name check to Gitlab::Auth::Ldap::Access
What does this MR do and why?
Related to issue #11336 (closed)
After !112427 (merged) merged, I found that it still sync ldap user name even though we set sync_name
to false
.
And after testing I found it still update user's profile in the method update_user_attributes
in ee/lib/ee/gitlab/auth/ldap/access.rb
, so I added the condition there.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
- Change config
Gitlab.ldap.enabled
totrue
. - Created a LDAP user which name is
Tom
. - Login GitLab with use Tom via LDAP login.
- We can see a GitLab user was created, and it's name is
Tom
. - View the GitLab user Tom's profile, and change the full name from
Tom
toTest
. - Logout and Login.
- We can see the GitLab user's full name is still
Tom
. - Add config
Gitlab.ldap.main.sync_name
and make itfalse
. - Repeat steps 3 to 6.
- We can see the Gitlab user's full name has been changed to Test without synchronizing the name from the LDAP service.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Zehua Zhang