Class VaultUserAuthenticator
java.lang.Object
org.apache.drill.exec.rpc.user.security.VaultUserAuthenticator
- All Implemented Interfaces:
Closeable,AutoCloseable,UserAuthenticator
Implement
UserAuthenticator
based on HashiCorp Vault. Configure the Vault client using the Drill BOOT
options that appear below.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidauthenticate(String user, String password) Attempts to authenticate a Drill user with the provided password and the configured Vault auth method.voidclose()Close the authenticator.booleaninthashCode()voidsetup(DrillConfig config) Reads Drill BOOT options and uses them to set up a Vault client.
-
Field Details
-
VAULT_ADDRESS
- See Also:
-
VAULT_AUTH_METHOD
- See Also:
-
-
Constructor Details
-
VaultUserAuthenticator
public VaultUserAuthenticator()
-
-
Method Details
-
setup
Reads Drill BOOT options and uses them to set up a Vault client.- Specified by:
setupin interfaceUserAuthenticator- Parameters:
config- object providing Drill config settings for Vault- Throws:
DrillbitStartupException- if the provided Vault configuration is invalid
-
authenticate
Attempts to authenticate a Drill user with the provided password and the configured Vault auth method. Only auth methods that have a natural mapping to PLAIN authentication's user and password strings are supported.- Specified by:
authenticatein interfaceUserAuthenticator- Parameters:
user- usernamepassword- password- Throws:
UserAuthenticationException- if the authentication attempt fails
-
close
Description copied from interface:UserAuthenticatorClose the authenticator. Used to release resources. Ex. LDAP authenticator opens connections to LDAP server, such connections resources are released in a safe manner as part of close.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceUserAuthenticator- Throws:
IOException
-
equals
-
hashCode
public int hashCode()
-