Module org.kohsuke.github.api
Package org.kohsuke.github.authorization
Interface AuthorizationProvider
- All Known Subinterfaces:
UserAuthorizationProvider
- All Known Implementing Classes:
AnonymousAuthorizationProvider,AppInstallationAuthorizationProvider,GitHub.DependentAuthorizationProvider,ImmutableAuthorizationProvider,JWTTokenProvider,OrgAppInstallationAuthorizationProvider
public interface AuthorizationProvider
Provides a functional interface that returns a valid encodedAuthorization.
This interface support the creation of providers based on immutable credentials or dynamic credentials which change
of time. Each
GitHubConnectorRequest will call
getEncodedAuthorization() on the provider.- Author:
- Liam Newman
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AuthorizationProviderA static instance for an ANONYMOUS authorization provider -
Method Summary
Modifier and TypeMethodDescriptionReturns the credentials to be used with a given request.
-
Field Details
-
ANONYMOUS
A static instance for an ANONYMOUS authorization provider
-
-
Method Details
-
getEncodedAuthorization
Returns 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"; }- Returns:
- encoded authorization string, can be null
- Throws:
IOException- on any error that prevents the provider from returning a valid authorization
-