Package org.apache.arrow.flight.auth2
Class GeneratedBearerTokenAuthenticator
java.lang.Object
org.apache.arrow.flight.auth2.BearerTokenAuthenticator
org.apache.arrow.flight.auth2.GeneratedBearerTokenAuthenticator
- All Implemented Interfaces:
CallHeaderAuthenticator
Generates and caches bearer tokens from user credentials.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.arrow.flight.auth2.CallHeaderAuthenticator
CallHeaderAuthenticator.AuthResult
-
Field Summary
Fields inherited from interface org.apache.arrow.flight.auth2.CallHeaderAuthenticator
NO_OP
-
Constructor Summary
ConstructorDescriptionGeneratedBearerTokenAuthenticator
(CallHeaderAuthenticator authenticator) Generate bearer tokens for the given basic call authenticator.GeneratedBearerTokenAuthenticator
(CallHeaderAuthenticator authenticator, int timeoutMinutes) Generate bearer tokens for the given basic call authenticator.GeneratedBearerTokenAuthenticator
(CallHeaderAuthenticator authenticator, com.google.common.cache.CacheBuilder<Object, Object> cacheBuilder) Generate bearer tokens for the given basic call authenticator. -
Method Summary
Modifier and TypeMethodDescriptionprotected CallHeaderAuthenticator.AuthResult
Callback to run when the initial authenticator succeeds.protected CallHeaderAuthenticator.AuthResult
validateBearer
(String bearerToken) Validate the bearer token.Methods inherited from class org.apache.arrow.flight.auth2.BearerTokenAuthenticator
authenticate
-
Constructor Details
-
GeneratedBearerTokenAuthenticator
Generate bearer tokens for the given basic call authenticator.- Parameters:
authenticator
- The authenticator to initial validate inputs with.
-
GeneratedBearerTokenAuthenticator
Generate bearer tokens for the given basic call authenticator.- Parameters:
authenticator
- The authenticator to initial validate inputs with.timeoutMinutes
- The time before tokens expire after being accessed.
-
GeneratedBearerTokenAuthenticator
public GeneratedBearerTokenAuthenticator(CallHeaderAuthenticator authenticator, com.google.common.cache.CacheBuilder<Object, Object> cacheBuilder) Generate bearer tokens for the given basic call authenticator.- Parameters:
authenticator
- The authenticator to initial validate inputs with.cacheBuilder
- The configuration of the cache of bearer tokens.
-
-
Method Details
-
validateBearer
Description copied from class:BearerTokenAuthenticator
Validate the bearer token.- Specified by:
validateBearer
in classBearerTokenAuthenticator
- Parameters:
bearerToken
- The bearer token to validate.- Returns:
- A successful AuthResult if validation succeeded.
-
getAuthResultWithBearerToken
protected CallHeaderAuthenticator.AuthResult getAuthResultWithBearerToken(CallHeaderAuthenticator.AuthResult authResult) Description copied from class:BearerTokenAuthenticator
Callback to run when the initial authenticator succeeds.- Specified by:
getAuthResultWithBearerToken
in classBearerTokenAuthenticator
- Parameters:
authResult
- A successful initial authentication result.- Returns:
- an alternate AuthResult based on the original AuthResult that will write a bearer token to output headers.
-