Interface NessieAuthenticationProvider
-
- All Known Implementing Classes:
AwsAuthenticationProvider,BasicAuthenticationProvider,NoneAuthenticationProvider
public interface NessieAuthenticationProviderBase interface for different authentication methods like "basic" (username + plain password), bearer token, etc.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description NessieAuthenticationbuild(Function<String,String> configSupplier)Build the implementation that provides authentication credentials using the given parameters.static NessieAuthenticationfromConfig(Function<String,String> configuration)Configure aNessieAuthenticationinstance using the configuration supplied byconfiguration.StringgetAuthTypeValue()The authentication type discriminator.
-
-
-
Method Detail
-
fromConfig
static NessieAuthentication fromConfig(Function<String,String> configuration)
Configure aNessieAuthenticationinstance using the configuration supplied byconfiguration.Checks all instances returned by Java's
ServiceLoaderfor theNessieAuthenticationProviderinterface.Uses the config option
NessieConfigConstants.CONF_NESSIE_AUTH_TYPEto determine the authentication type by comparing the config value with the value returned by implementations'getAuthTypeValue(). IfNessieConfigConstants.CONF_NESSIE_AUTH_TYPEis not configured,nullwill be returned. If no implementation could be found, anIllegalArgumentExceptionis thrown.If a
NessieAuthenticationProviderinstance was found, the implementation's builderbuild(Function)will be called.
-
getAuthTypeValue
String getAuthTypeValue()
The authentication type discriminator. If authentication is configured via properties, likeNessieClientBuilder.fromConfig(Function)/NessieClientBuilder.withAuthenticationFromConfig(Function), set the aNessieAuthenticationProviderinstance is used, ifNessieConfigConstants.CONF_NESSIE_AUTH_TYPEequals the value returned by this method.
-
build
NessieAuthentication build(Function<String,String> configSupplier)
Build the implementation that provides authentication credentials using the given parameters.The implementation must throw appropriate exceptions, like
NullPointerExceptionorIllegalArgumentExceptionwith proper and readable explanations, if mandatory configuration options are missing or have wrong/incompatible/invalid values.
-
-