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

Ensure the PAT option is always offered for GHES instances #259

Merged
merged 1 commit into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/shared/GitHub.Tests/GitHubHostProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ public async Task GitHubHostProvider_GetSupportedAuthenticationModes(string uriS


[Theory]
[InlineData("https://example.com", null, "0.1", false, AuthenticationModes.None)]
[InlineData("https://example.com", null, "0.1", true, AuthenticationModes.Basic)]
[InlineData("https://example.com", null, "100.0", false, AuthenticationModes.OAuth)]
[InlineData("https://example.com", null, "100.0", true, AuthenticationModes.Basic | AuthenticationModes.OAuth)]
[InlineData("https://example.com", null, "0.1", false, AuthenticationModes.Pat)]
[InlineData("https://example.com", null, "0.1", true, AuthenticationModes.Basic | AuthenticationModes.Pat)]
[InlineData("https://example.com", null, "100.0", false, AuthenticationModes.OAuth | AuthenticationModes.Pat)]
[InlineData("https://example.com", null, "100.0", true, AuthenticationModes.All)]
public async Task GitHubHostProvider_GetSupportedAuthenticationModes_WithMetadata(string uriString, string gitHubAuthModes,
string installedVersion, bool verifiablePasswordAuthentication, AuthenticationModes expectedModes)
{
Expand Down
2 changes: 1 addition & 1 deletion src/shared/GitHub/GitHubHostProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ internal async Task<AuthenticationModes> GetSupportedAuthenticationModesAsync(Ur
{
GitHubMetaInfo metaInfo = await _gitHubApi.GetMetaInfoAsync(targetUri);

var modes = AuthenticationModes.None;
var modes = AuthenticationModes.Pat;
if (metaInfo.VerifiablePasswordAuthentication)
{
modes |= AuthenticationModes.Basic;
Expand Down