Treat gist as generic for credential helper #19009
Merged
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.
Closes #19008
Description
Prior to 3.4.2 and use of Git Credential Helper, authentication for gists in the normal flow failed and would fall back on generic auth handling. This meant users were prompted to provide a username and password and if they provided their github username and a PAT they were able push to them. Now, when normal authentication fails we only provide a generic auth error.. additionally with some modifications to endpoint detection we were detecting Gists as "enterprise" endpoints.
This PR looks for
gist.github.com
and goes ahead and pushes it through the generic auth flow. Thus, the user is prompted for a password on push, if they provide a PAT, it will succeed. (A similar flow to before, but now we provide the Github user name for them). For a better experience, a user can also got to Settings > Advanced, and check "User Git Credential Manager". Upon trying to push, Git Credential Manager will prompt you to sign into GitHub and then will succeed using that for gists.Screenshots
This video first shows not using Git Credential Manager (the default settings for now). This means a user must still provide a PAT by default. Then, it shows enabling Git Credential Manager which shows using an auth flow with GitHub. No longer needing a PAT.
CleanShot.2024-07-23.at.16.03.25.mp4
Release notes
Notes: [Fixed] Allow pushing to gists.