This repository was archived by the owner on Sep 30, 2024. It is now read-only.
[Backport 5.4.0] auth: Make username from email deduplication dotcom only#62760
Merged
Conversation
https://github.com/sourcegraph/sourcegraph/pull/60339 introduced a new behavior that would always add a random suffix to usernames that are derived from email addresses. The reason behind it seems to be that on dotcom, emails are from various domains and there are a lot of duplicates usually, and a lot of names that trigger our suspiciousness detection, like me@sourcegraph.com or me@sgdev.org. For customer instances, this is not a real risk, and because of historic reasons, we depend on the username to be exactly what was given by the auth provider, so that bitbucket server permission syncing can work. So this change for customer instances caused https://github.com/sourcegraph/sourcegraph/issues/62676. To simplify the fix for this and make sure it can land in the next patch release, I opted for making this dotcom specific for now, as that's the least invasive change we can make. Test plan: Created a new SAML application in Okta dev and lined that to my local instance. A new user for `erik@sourcegraph.com` on main was called `erik-acbdef` after signup. On this branch, with everything reset to fresh, a new user for `erik@sourcegraph.com` is called `erik`. This should fix the bitbucket perms syncing issue. (cherry picked from commit 663a74a)
eseliger
approved these changes
May 17, 2024
jdpleiness
approved these changes
May 17, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://github.com/sourcegraph/sourcegraph/pull/60339 introduced a new behavior that would always add a random suffix to usernames that are derived from email addresses.
The reason behind it seems to be that on dotcom, emails are from various domains and there are a lot of duplicates usually, and a lot of names that trigger our suspiciousness detection, like me@sourcegraph.com or me@sgdev.org.
For customer instances, this is not a real risk, and because of historic reasons, we depend on the username to be exactly what was given by the auth provider, so that bitbucket server permission syncing can work.
So this change for customer instances caused https://github.com/sourcegraph/sourcegraph/issues/62676.
To simplify the fix for this and make sure it can land in the next patch release, I opted for making this dotcom specific for now, as that's the least invasive change we can make.
Closes https://github.com/sourcegraph/sourcegraph/issues/62676
Test plan:
Created a new SAML application in Okta dev and lined that to my local instance.
A new user for
erik@sourcegraph.comon main was callederik-acbdefafter signup.On this branch, with everything reset to fresh, a new user for
erik@sourcegraph.comis callederik.This should fix the bitbucket perms syncing issue.
Backport 663a74a from #62747