Class GithubAppsServiceImpl
java.lang.Object
com.atlassian.bamboo.plugins.github.apps.GithubAppsServiceImpl
- All Implemented Interfaces:
GithubAppsService
Service class for handling GitHub App interactions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAccessToken(@NotNull String appId, @NotNull String privateKey, @NotNull String apiBaseUrl, @NotNull String owner, @NotNull String repo) Retrieves an access token for the specified repository.requestAccessToken(@NotNull String jwt, @NotNull String sanitizedApiBaseUrl, @NotNull String installationId) Requests an access token for the specified installation.
-
Constructor Details
-
GithubAppsServiceImpl
public GithubAppsServiceImpl()
-
-
Method Details
-
getAccessToken
@NotNull public @NotNull Optional<String> getAccessToken(@NotNull @NotNull String appId, @NotNull @NotNull String privateKey, @NotNull @NotNull String apiBaseUrl, @NotNull @NotNull String owner, @NotNull @NotNull String repo) Description copied from interface:GithubAppsServiceRetrieves an access token for the specified repository.- Specified by:
getAccessTokenin interfaceGithubAppsService- Parameters:
appId- the GitHub App IDprivateKey- the private key of the GitHub AppapiBaseUrl- the base URL of the GitHub APIowner- the owner of the repositoryrepo- the name of the repository- Returns:
- an Optional containing the access token if successful, otherwise an empty Optional
-
requestAccessToken
@NotNull public static @NotNull Optional<String> requestAccessToken(@NotNull @NotNull String jwt, @NotNull @NotNull String sanitizedApiBaseUrl, @NotNull @NotNull String installationId) Requests an access token for the specified installation.- Parameters:
jwt- the JWT tokensanitizedApiBaseUrl- the base URL of the GitHub APIinstallationId- the installation ID- Returns:
- an Optional containing the access token if successful, otherwise an empty Optional
-