Skip to content

Commit 556c635

Browse files
committed
github: ensure PAT is offered for GHES instances
Ensure the Personal Access Token authentication mode is always offered for GitHub Enterprise Server instances.
1 parent c7a7719 commit 556c635

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/shared/GitHub.Tests/GitHubHostProviderTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ public async Task GitHubHostProvider_GetSupportedAuthenticationModes(string uriS
121121

122122

123123
[Theory]
124-
[InlineData("https://example.com", null, "0.1", false, AuthenticationModes.None)]
125-
[InlineData("https://example.com", null, "0.1", true, AuthenticationModes.Basic)]
126-
[InlineData("https://example.com", null, "100.0", false, AuthenticationModes.OAuth)]
127-
[InlineData("https://example.com", null, "100.0", true, AuthenticationModes.Basic | AuthenticationModes.OAuth)]
124+
[InlineData("https://example.com", null, "0.1", false, AuthenticationModes.Pat)]
125+
[InlineData("https://example.com", null, "0.1", true, AuthenticationModes.Basic | AuthenticationModes.Pat)]
126+
[InlineData("https://example.com", null, "100.0", false, AuthenticationModes.OAuth | AuthenticationModes.Pat)]
127+
[InlineData("https://example.com", null, "100.0", true, AuthenticationModes.All)]
128128
public async Task GitHubHostProvider_GetSupportedAuthenticationModes_WithMetadata(string uriString, string gitHubAuthModes,
129129
string installedVersion, bool verifiablePasswordAuthentication, AuthenticationModes expectedModes)
130130
{

src/shared/GitHub/GitHubHostProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ internal async Task<AuthenticationModes> GetSupportedAuthenticationModesAsync(Ur
243243
{
244244
GitHubMetaInfo metaInfo = await _gitHubApi.GetMetaInfoAsync(targetUri);
245245

246-
var modes = AuthenticationModes.None;
246+
var modes = AuthenticationModes.Pat;
247247
if (metaInfo.VerifiablePasswordAuthentication)
248248
{
249249
modes |= AuthenticationModes.Basic;

0 commit comments

Comments
 (0)