Class GithubAppsServiceImpl

java.lang.Object
com.atlassian.bamboo.plugins.github.apps.GithubAppsServiceImpl
All Implemented Interfaces:
GithubAppsService

@Component public class GithubAppsServiceImpl extends Object implements GithubAppsService
Service class for handling GitHub App interactions.
  • 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: GithubAppsService
      Retrieves an access token for the specified repository.
      Specified by:
      getAccessToken in interface GithubAppsService
      Parameters:
      appId - the GitHub App ID
      privateKey - the private key of the GitHub App
      apiBaseUrl - the base URL of the GitHub API
      owner - the owner of the repository
      repo - 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 token
      sanitizedApiBaseUrl - the base URL of the GitHub API
      installationId - the installation ID
      Returns:
      an Optional containing the access token if successful, otherwise an empty Optional