Class GitHubJWTProvider
java.lang.Object
com.atlassian.bamboo.plugins.github.apps.GitHubJWTProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateJWT(@NotNull String appId, @NotNull String privateKey) Generates a JSON Web Token (JWT) for the specified GitHub App.
-
Constructor Details
-
GitHubJWTProvider
public GitHubJWTProvider()
-
-
Method Details
-
generateJWT
@NotNull public static @NotNull Optional<String> generateJWT(@NotNull @NotNull String appId, @NotNull @NotNull String privateKey) Generates a JSON Web Token (JWT) for the specified GitHub App.This method creates a JWT signed with the GitHub App's private key, which can be used for authenticating with the GitHub API as a GitHub App installation. The token has a validity period of 10 minutes from creation time.
- Parameters:
appId- the GitHub App IDprivateKey- the private key of the GitHub App in PEM format- Returns:
- an Optional containing the generated JWT if successful, otherwise an empty Optional
-