Class GithubAccessCredentials
java.lang.Object
com.atlassian.bamboo.plugins.github.accessor.GithubAccessCredentials
Class representing GitHub access credentials.
-
Method Summary
Modifier and TypeMethodDescriptionboolean@Nullable StringgetAppId()@Nullable String@Nullable String@Nullable StringbooleanChecks if both the username and password for basic authentication are configured.inthashCode()booleanChecks if basic authentication is configured.booleanChecks if token authentication is configured.booleanChecks if the credentials for pushing to the repository are missing.static GithubAccessCredentialswithBasicAuth(@Nullable String username, @Nullable String password) Creates an instance of GithubAccessCredentials with basic authentication.static GithubAccessCredentialswithTokenAuth(@Nullable String appId, @Nullable String privateKey) Creates an instance of GithubAccessCredentials with token authentication.
-
Method Details
-
withBasicAuth
public static GithubAccessCredentials withBasicAuth(@Nullable @Nullable String username, @Nullable @Nullable String password) Creates an instance of GithubAccessCredentials with basic authentication.- Parameters:
username- the username for basic authenticationpassword- the password for basic authentication- Returns:
- a new instance of GithubAccessCredentials configured for basic authentication
-
withTokenAuth
public static GithubAccessCredentials withTokenAuth(@Nullable @Nullable String appId, @Nullable @Nullable String privateKey) Creates an instance of GithubAccessCredentials with token authentication.- Parameters:
appId- the GitHub App IDprivateKey- the private key of the GitHub App- Returns:
- a new instance of GithubAccessCredentials configured for token authentication
-
isBasicAuthConfigured
public boolean isBasicAuthConfigured()Checks if basic authentication is configured.- Returns:
- true if basic authentication is configured, false otherwise
-
isTokenAuthConfigured
public boolean isTokenAuthConfigured()Checks if token authentication is configured.- Returns:
- true if token authentication is configured, false otherwise
-
hasBasicAuthPasswordConfigured
public boolean hasBasicAuthPasswordConfigured()Checks if both the username and password for basic authentication are configured.- Returns:
- true if both the username and password are configured, false otherwise
-
missesPushCredentials
public boolean missesPushCredentials()Checks if the credentials for pushing to the repository are missing. This method returns true if either the username and password for basic authentication or the app ID and private key for token authentication are not fully configured.- Returns:
- true if the push credentials are missing, false otherwise
-
getUsername
-
getPassword
-
getAppId
-
getPrivateKey
-
equals
-
hashCode
public int hashCode()
-