fixup! Add support for PATs in GitHub Enterprise server
parent
d8bdd3b906
commit
ebefa6928b
|
|
@ -207,6 +207,7 @@ public abstract class AbstractGithubPersonalAccessTokenFetcher
|
|||
public Optional<Pair<Boolean, String>> isValid(PersonalAccessTokenParams params) {
|
||||
GithubApiClient apiClient;
|
||||
if (githubApiClient.isConnected(params.getScmProviderUrl())) {
|
||||
// The url from the token has the same url as the api client, no need to create a new one.
|
||||
apiClient = githubApiClient;
|
||||
} else {
|
||||
if ("github".equals(params.getScmTokenName())) {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,10 @@ public abstract class AbstractGithubURLParser {
|
|||
String trimmedUrl = trimEnd(url, '/');
|
||||
return githubPattern.matcher(trimmedUrl).matches()
|
||||
|| githubSSHPattern.matcher(trimmedUrl).matches()
|
||||
// If the GitHub URL is not configured, try to find it in a manually added user namespace
|
||||
// token.
|
||||
|| isUserTokenPresent(trimmedUrl)
|
||||
// Try to call an API request to see if the URL matches GitHub.
|
||||
|| isApiRequestRelevant(trimmedUrl);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -232,8 +232,4 @@ public class GitlabOAuthTokenFetcher implements PersonalAccessTokenFetcher {
|
|||
? new GitlabApiClient(scmServerUrl)
|
||||
: null;
|
||||
}
|
||||
|
||||
public String getProviderName() {
|
||||
return OAUTH_PROVIDER_NAME;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue