Skip to content
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
jdpleiness merged 1 commit into
5.4.0from
backport-62747-to-5.4.0
May 17, 2024
Merged

[Backport 5.4.0] auth: Make username from email deduplication dotcom only#62760
jdpleiness merged 1 commit into
5.4.0from
backport-62747-to-5.4.0

Conversation

@sourcegraph-release-bot

Copy link
Copy Markdown
Collaborator

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.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

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)
@sourcegraph-release-bot sourcegraph-release-bot requested review from a team and eseliger 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
@jdpleiness jdpleiness deleted the backport-62747-to-5.4.0 branch May 17, 2024 13:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

3 participants