Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 5.4.0] auth: Make username from email deduplication dotcom only #62760

Merged
merged 1 commit into from
May 17, 2024

Conversation

sourcegraph-release-bot
Copy link
Collaborator

#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 #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 #62676

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.
Backport 663a74a from #62747

#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 #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)
@sourcegraph-release-bot sourcegraph-release-bot requested review from eseliger and a team May 17, 2024 12:57
@sourcegraph-release-bot sourcegraph-release-bot added cla-signed backports team/source Tickets under the purview of Source - the one Source to graph it all backport/customer-critical Patch to critical bugs that negatively impact customer happiness team/product-platform backported-to-5.4.0 labels May 17, 2024
@jdpleiness jdpleiness enabled auto-merge (squash) May 17, 2024 13:08
@jdpleiness jdpleiness merged commit 6d7e781 into 5.4.0 May 17, 2024
14 of 18 checks passed
@jdpleiness jdpleiness deleted the backport-62747-to-5.4.0 branch May 17, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/customer-critical Patch to critical bugs that negatively impact customer happiness backported-to-5.4.0 backports cla-signed team/product-platform team/source Tickets under the purview of Source - the one Source to graph it all
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants