Skip to content

Commit

Permalink
Merge pull request #259 from mjcheetham/fix-ghes-modes
Browse files Browse the repository at this point in the history
Ensure the PAT option is always offered for GHES instances
  • Loading branch information
mjcheetham committed Jan 6, 2021
2 parents c7a7719 + 556c635 commit 8f96623
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit 8f96623

Please sign in to comment.