-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
auth: Make username from email deduplication dotcom only #62747
auth: Make username from email deduplication dotcom only #62747
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
a62aefd
to
12fb2ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test cases LGTM
Is this the case for any of the other permissions sources? Should we document the dependency in the docstring of (Security team has an alert set up on changes to code attached to |
12fb2ad
to
1a8feb6
Compare
I think so, bitbucket server is the only one I'm aware of that has this restriction. They didn't have oauth support in the past, but they added it 1.5y ago - it's somewhere on our roadmap to finally switch to that and get rid of this hack with matching usernames. If this is security worthy: Maybe? I can add a quick sentence about bitbucket but not sure if this should trigger an alert for the security team. |
Added that comment |
4a1f219
to
22830f2
Compare
#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.
22830f2
to
73af069
Compare
I will merge this to make sure we get it in for Mondays patch release in time, but happy to follow up on further comments. |
#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)
…only (#62760) auth: Make username from email deduplication dotcom only (#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) Co-authored-by: Erik Seliger <erikseliger@me.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
#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 callederik-acbdef
after signup.On this branch, with everything reset to fresh, a new user for
erik@sourcegraph.com
is callederik
.This should fix the bitbucket perms syncing issue.