Class AbstractHBaseSaslRpcClient

java.lang.Object
org.apache.hadoop.hbase.security.AbstractHBaseSaslRpcClient
Direct Known Subclasses:
HBaseSaslRpcClient, NettyHBaseSaslRpcClient

@Private public abstract class AbstractHBaseSaslRpcClient extends Object
A utility class that encapsulates SASL logic for RPC client. Copied from org.apache.hadoop.security
Since:
2.0.0
  • Field Details

  • 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 object
      provider - the authentication provider
      token - token to use if needed by the authentication method
      serverAddr - the address of the hbase service
      servicePrincipal - the service principal to use if needed by the authentication method
      fallbackAllowed - 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 object
      provider - the authentication provider
      token - token to use if needed by the authentication method
      serverAddr - the address of the hbase service
      servicePrincipal - the service principal to use if needed by the authentication method
      fallbackAllowed - does the client allow fallback to simple authentication
      rpcProtection - the protection level ("authentication", "integrity" or "privacy")
      Throws:
      IOException
  • Method Details

    • getInitialResponse

      public byte[] getInitialResponse() throws SaslException
      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

      public boolean isComplete()
    • evaluateChallenge

      public byte[] evaluateChallenge(byte[] challenge) throws SaslException
      Throws:
      SaslException
    • dispose

      public void dispose()
      Release resources used by wrapped saslClient