Class GithubAccessCredentials

java.lang.Object
com.atlassian.bamboo.plugins.github.accessor.GithubAccessCredentials

public class GithubAccessCredentials extends Object
Class representing GitHub access credentials.
  • 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 authentication
      password - 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 ID
      privateKey - 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

      @Nullable public @Nullable String getUsername()
    • getPassword

      @Nullable public @Nullable String getPassword()
    • getAppId

      @Nullable public @Nullable String getAppId()
    • getPrivateKey

      @Nullable public @Nullable String getPrivateKey()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object