Class GitHubAccessorFactory
java.lang.Object
com.atlassian.bamboo.plugins.github.accessor.GitHubAccessorFactory
Factory class for creating instances of GitHubAccessor.
- Since:
- 12.0
-
Constructor Summary
ConstructorsConstructorDescriptionGitHubAccessorFactory(GithubAppsService githubAppsService, com.atlassian.plugins.whitelist.OutboundWhitelist outboundWhitelist, CustomVariableContext customVariableContext) -
Method Summary
Modifier and TypeMethodDescriptioncreate(@NotNull GithubAccessCredentials accessCredentials, @NotNull String apiBaseUrl) Creates a GitHubAccessor instance based on the provided access credentials and API base URL.create(@NotNull GithubAccessCredentials accessCredentials, @NotNull String apiBaseUrl, @NotNull String owner, @NotNull String repo) Creates a GitHubAccessor instance based on the provided access credentials, API base URL, repository owner, and repository name.
-
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 credentialsapiBaseUrl- 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 credentialsapiBaseUrl- the base URL of the GitHub APIowner- the owner of the repositoryrepo- 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
-