Class GitHubAccessorFactory

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

public class GitHubAccessorFactory extends Object
Factory class for creating instances of GitHubAccessor.
Since:
12.0
  • Constructor Details

    • GitHubAccessorFactory

      @Inject public GitHubAccessorFactory(GithubAppsService githubAppsService, com.atlassian.plugins.whitelist.OutboundWhitelist outboundWhitelist, CustomVariableContext customVariableContext)
  • Method Details

    • create

      public GitHubAccessor create(@NotNull @NotNull GithubAccessCredentials accessCredentials, @NotNull @NotNull String apiBaseUrl) throws GitHubException
      Creates a GitHubAccessor instance based on the provided access credentials and API base URL. If creating token based GitHubAccessor, the used token is JWT, because there is no repo context so installation access token could not be created.
      Parameters:
      accessCredentials - the GitHub access credentials
      apiBaseUrl - the base URL of the GitHub API
      Returns:
      a GitHubAccessor instance configured for the specified credentials and API base URL
      Throws:
      GitHubException - if there is an error obtaining the JWT token
    • create

      public GitHubAccessor create(@NotNull @NotNull GithubAccessCredentials accessCredentials, @NotNull @NotNull String apiBaseUrl, @NotNull @NotNull String owner, @NotNull @NotNull String repo) throws GitHubException
      Creates a GitHubAccessor instance based on the provided access credentials, API base URL, repository owner, and repository name. If creating token based GitHubAccessor, the installation access token is used.
      Parameters:
      accessCredentials - the GitHub access credentials
      apiBaseUrl - the base URL of the GitHub API
      owner - the owner of the repository
      repo - the name of the repository
      Returns:
      a GitHubAccessor instance configured for the specified credentials, API base URL, owner, and repository
      Throws:
      GitHubException - if there is an error obtaining the installation access token