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

    Fields
    Modifier and Type
    Field
    Description
    A static instance for an ANONYMOUS authorization provider
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the credentials to be used with a given request.
  • Field Details

    • ANONYMOUS

      static final AuthorizationProvider ANONYMOUS
      A static instance for an ANONYMOUS authorization provider
  • Method Details

    • 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