fixup! Add provider name annotation to PAT secret

pull/670/head
ivinokur 2024-03-19 14:25:14 +02:00
parent d9ccbfba32
commit c9825a9f99
2 changed files with 11 additions and 1 deletions

View File

@ -142,7 +142,9 @@ public abstract class AbstractGithubPersonalAccessTokenFetcher
isValid(
new PersonalAccessTokenParams(
scmServerUrl,
OAUTH_PROVIDER_NAME,
providerName.equals(OAUTH_PROVIDER_NAME)
? OAUTH_PROVIDER_NAME
: OAUTH_PROVIDER_NAME + "-second",
tokenName,
tokenId,
oAuthToken.getToken(),

View File

@ -39,6 +39,14 @@ public class PersonalAccessTokenParams {
return scmProviderUrl;
}
/**
* This method returns the provider name if the token is a Personal Access Token, and the token
* name in format oauth2-<random string from 5 chars> if the token is an oauth token. Deprecated:
* We need to add a new method to distinguish oauth tokens from personal access tokens.
*
* @return token name
*/
@Deprecated
public String getScmTokenName() {
return scmTokenName;
}