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
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
authenticate
(String user, String password) Attempts to authenticate a Drill user with the provided password and the configured Vault auth method.void
close()
Close the authenticator.boolean
int
hashCode()
void
setup
(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:
setup
in 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:
authenticate
in interfaceUserAuthenticator
- Parameters:
user
- usernamepassword
- password- Throws:
UserAuthenticationException
- if the authentication attempt fails
-
close
Description copied from interface:UserAuthenticator
Close 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceUserAuthenticator
- Throws:
IOException
-
equals
-
hashCode
public int hashCode()
-