Package org.apache.hadoop.hbase.security
Class AbstractHBaseSaslRpcClient
java.lang.Object
org.apache.hadoop.hbase.security.AbstractHBaseSaslRpcClient
- Direct Known Subclasses:
HBaseSaslRpcClient
,NettyHBaseSaslRpcClient
A utility class that encapsulates SASL logic for RPC client. Copied from
org.apache.hadoop.security
- Since:
- 2.0.0
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final byte[]
protected final boolean
protected final SaslClient
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractHBaseSaslRpcClient
(org.apache.hadoop.conf.Configuration conf, SaslClientAuthenticationProvider provider, org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token, InetAddress serverAddr, String servicePrincipal, boolean fallbackAllowed) Create a HBaseSaslRpcClient for an authentication methodprotected
AbstractHBaseSaslRpcClient
(org.apache.hadoop.conf.Configuration conf, SaslClientAuthenticationProvider provider, org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token, InetAddress serverAddr, String servicePrincipal, boolean fallbackAllowed, String rpcProtection) Create a HBaseSaslRpcClient for an authentication method -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Release resources used by wrapped saslClientbyte[]
evaluateChallenge
(byte[] challenge) byte[]
Computes the initial response a client sends to a server to begin the SASL challenge/response handshake.boolean
-
Field Details
-
EMPTY_TOKEN
-
saslClient
-
fallbackAllowed
-
saslProps
-
-
Constructor Details
-
AbstractHBaseSaslRpcClient
protected AbstractHBaseSaslRpcClient(org.apache.hadoop.conf.Configuration conf, SaslClientAuthenticationProvider provider, org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token, InetAddress serverAddr, String servicePrincipal, boolean fallbackAllowed) throws IOException Create a HBaseSaslRpcClient for an authentication method- Parameters:
conf
- the configuration objectprovider
- the authentication providertoken
- token to use if needed by the authentication methodserverAddr
- the address of the hbase serviceservicePrincipal
- the service principal to use if needed by the authentication methodfallbackAllowed
- does the client allow fallback to simple authentication- Throws:
IOException
-
AbstractHBaseSaslRpcClient
protected AbstractHBaseSaslRpcClient(org.apache.hadoop.conf.Configuration conf, SaslClientAuthenticationProvider provider, org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token, InetAddress serverAddr, String servicePrincipal, boolean fallbackAllowed, String rpcProtection) throws IOException Create a HBaseSaslRpcClient for an authentication method- Parameters:
conf
- configuration objectprovider
- the authentication providertoken
- token to use if needed by the authentication methodserverAddr
- the address of the hbase serviceservicePrincipal
- the service principal to use if needed by the authentication methodfallbackAllowed
- does the client allow fallback to simple authenticationrpcProtection
- the protection level ("authentication", "integrity" or "privacy")- Throws:
IOException
-
-
Method Details
-
getInitialResponse
Computes the initial response a client sends to a server to begin the SASL challenge/response handshake. If the client's SASL mechanism does not have an initial response, an empty token will be returned without querying the evaluateChallenge method, as an authentication processing must be started by client.- Returns:
- The client's initial response to send the server (which may be empty).
- Throws:
SaslException
-
isComplete
-
evaluateChallenge
- Throws:
SaslException
-
dispose
Release resources used by wrapped saslClient
-