Fixed user synced attributes metadata after removing current provider
What does this MR do?
Fixes an error 500 after removing LDAP identity and also the LDAP config block from the gitlab configuration file.
Are there points in the code the reviewer needs to double check?
There are several errors associated to this MR:
The first one, the most obvious one, is the one that launches the error. This is raised because once we logged with the LDAP identity the user set his
user_synced_attributes_metadataassociated with that provider. Once we remove the LDAP identity, when we access the profile page it tries to ask the LDAP configuration for some information but, since we have removed the block, it raises an error saying that the setting
serveris not found.
The second one is, because of keeping the LDAP
user_synced_attributes_metadatarecord associated with the user once we remove the identity. It is not needed and it will always block the user from updating their email, name and/or location (depending which attributes are synced). So, now, when we remove an identity, that record is removed.
The third one is related to those users that had done this migration manual (i.e: the reproduction procedure of the issue). We have to somehow clean those records for them because they will be stuck if their current
omniauthconfiguration doesn't sync attributes. For example:
- User logged in using LDAP identity
user_synced_attributes_metadatarecord is created to that user and the LDAP identity
- User configures a new omniauth provider but without syncing any attribute
- We remove the LDAP identity and log out
- We sign in using the new omniauth provider and visit the profile page.
- Although, we have set not to sync any attributes, some of them are read-only because the UI is using the stored
user_synced_attributes_metadatafrom the LDAP identity.
Does this MR meet the acceptance criteria?
- Changelog entry added, if necessary
- Documentation created/updated
- API support added
- Tests added for this feature/bug
- Has been reviewed by UX
- Has been reviewed by Frontend
- Has been reviewed by Backend
- Has been reviewed by Database
- Conform by the merge request performance guides
- Conform by the style guides
- Squashed related commits together
- Internationalization required/considered
End-to-end tests pass (
package-qamanual pipeline job)
What are the relevant issue numbers?
Fixes #37528 (closed)