Module org.kohsuke.github.api
Package org.kohsuke.github.authorization
Class ImmutableAuthorizationProvider
java.lang.Object
org.kohsuke.github.authorization.ImmutableAuthorizationProvider
- All Implemented Interfaces:
AuthorizationProvider
An
AuthorizationProvider that always returns the same credentials.-
Field Summary
Fields inherited from interface org.kohsuke.github.authorization.AuthorizationProvider
ANONYMOUS -
Constructor Summary
ConstructorsConstructorDescriptionImmutableAuthorizationProvider(String authorization) ImmutableAuthorizationProvider constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthorizationProviderfromAppInstallationToken(String appInstallationToken) Builds and returns aAuthorizationProviderfrom a given App Installation Tokenstatic AuthorizationProviderfromJwtToken(String jwtToken) Builds and returns aAuthorizationProviderfrom a given jwtTokenstatic AuthorizationProviderfromOauthToken(String oauthAccessToken) Builds and returns aAuthorizationProviderfrom a given oauthAccessTokenstatic AuthorizationProviderfromOauthToken(String oauthAccessToken, String login) Builds and returns aAuthorizationProviderfrom a given oauthAccessTokenReturns the credentials to be used with a given request.
-
Constructor Details
-
ImmutableAuthorizationProvider
ImmutableAuthorizationProvider constructor- Parameters:
authorization- the authorization string
-
-
Method Details
-
fromAppInstallationToken
Builds and returns aAuthorizationProviderfrom a given App Installation Token- Parameters:
appInstallationToken- A string containing the GitHub App installation token- Returns:
- the configured Builder from given GitHub App installation token.
-
fromJwtToken
Builds and returns aAuthorizationProviderfrom a given jwtToken- Parameters:
jwtToken- The JWT token- Returns:
- a correctly configured
AuthorizationProviderthat will always return the same provided jwtToken
-
fromOauthToken
Builds and returns aAuthorizationProviderfrom a given oauthAccessToken- Parameters:
oauthAccessToken- The token- Returns:
- a correctly configured
AuthorizationProviderthat will always return the same provided oauthAccessToken
-
fromOauthToken
Builds and returns aAuthorizationProviderfrom a given oauthAccessToken- Parameters:
oauthAccessToken- The tokenlogin- The login for this token- Returns:
- a correctly configured
AuthorizationProviderthat will always return the same provided oauthAccessToken
-
getEncodedAuthorization
Description copied from interface:AuthorizationProviderReturns the credentials to be used with a given request. As an example, a authorization provider for a bearer token will return something like:@Override public String getEncodedAuthorization() { return "Bearer myBearerToken"; }- Specified by:
getEncodedAuthorizationin interfaceAuthorizationProvider- Returns:
- encoded authorization string, can be null
-