-
Notifications
You must be signed in to change notification settings - Fork 9.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
Support multiple accounts for remote urls that differ in path #18651
Conversation
Co-Authored-By: Sergio Padrino <1083228+sergiou87@users.noreply.github.com>
We don't want to accidentally reference it Co-Authored-By: Sergio Padrino <1083228+sergiou87@users.noreply.github.com>
Co-Authored-By: Sergio Padrino <1083228+sergiou87@users.noreply.github.com>
Co-Authored-By: Sergio Padrino <1083228+sergiou87@users.noreply.github.com>
Co-Authored-By: Sergio Padrino <1083228+sergiou87@users.noreply.github.com>
Co-Authored-By: Sergio Padrino <1083228+sergiou87@users.noreply.github.com>
Co-Authored-By: Sergio Padrino <1083228+sergiou87@users.noreply.github.com>
I was thinking we had a scenario like |
The short answer is yes, the provided username before the @ is correct since that's what Git will use. That doesn't mean the other won't work, that's an implementation detail we know nothing about but we're aligning with Git's behavior here |
app/src/models/git-account.ts
Outdated
@@ -7,4 +7,7 @@ export interface IGitAccount { | |||
|
|||
/** The endpoint with which the user is authenticating. */ | |||
readonly endpoint: string | |||
|
|||
/** The */ |
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.
:P The
sounds kind of ominous all by itself.
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.
💖 Thanks for all the work on this issue.
…ialog Add alert semantics to generic git auth dialog
Ref #18667, this will be the fix, might be handy to update the docs on https://github.com/desktop/desktop/blob/development/docs/integrations/azure-devops.md to clarify that it is org, not username that is being used as the first path segment. (which in the case of a personal project is the username) It would be also possible to check the first part of the URL https://@dev.azure.com instead of the first segment of the path. in case this still causes regression bugs |
ref #18586
based on #18627
Description
Changes our account lookup logic to use the entire remote url (if we get it by Git, i.e. the
useHttpPath
config option must be turned on for the host).Prior to 3.3.15 a long lived regex mistake in the
parseRemote
function caused the hostname for Azure Devops urls to include the first two segments of the path. When we calledgetGenericHostname
on a remote url likehttps://dev.azure.com/org/repo/_git/repo
the hostname would get parsed asdev.azure.com/org/repo
thus creating a unique key for storing a token for a specific repository.When we resolved that flaw all we had access to was the hostname which broke the credential storage for users having multiple repositories across multiple orgs on Azure Devops.
This change will have Desktop honor the full remote url when Git is configured to provide it. We intend to make a change to https://github.com/desktop/dugite to set
useHttpPath
for dev.azure.com just like Git for Windows doesIn this work we've also had to contend with URLs containing usernames such as
https://USERNAME@dev.azure.com/username/repo/_git/repo
. For these remote urls we've disabled the username input in our password prompt and respect the username from the url.Release notes
Notes: