Package org.kohsuke.github.authorization
Interface AuthorizationProvider
-
- All Known Subinterfaces:
UserAuthorizationProvider
- All Known Implementing Classes:
AnonymousAuthorizationProvider
,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. EachGitHubConnectorRequest
will callgetEncodedAuthorization()
on the provider.- Author:
- Liam Newman
-
-
Field Summary
Fields Modifier and Type Field Description static AuthorizationProvider
ANONYMOUS
A static instance for an ANONYMOUS authorization provider
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getEncodedAuthorization()
Returns the credentials to be used with a given request.
-
-
-
Field Detail
-
ANONYMOUS
static final AuthorizationProvider ANONYMOUS
A static instance for an ANONYMOUS authorization provider
-
-
Method Detail
-
getEncodedAuthorization
String getEncodedAuthorization() throws IOException
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
-
-