Class IngressPortBasedResolver

java.lang.Object
org.apache.hadoop.security.SaslPropertiesResolver
org.apache.hadoop.security.IngressPortBasedResolver
All Implemented Interfaces:
Configurable

public class IngressPortBasedResolver extends SaslPropertiesResolver
An implementation of SaslPropertiesResolver. Used on server side, returns SASL properties based on the port the client is connecting to. This should be used along with server side enabling multiple ports TODO: when NN multiple listener is enabled, automatically use this resolver without having to set in config. For configuration, for example if server runs on two ports 9000 and 9001, and we want to specify 9000 to use auth-conf and 9001 to use auth. We need to set the following configuration properties: ingress.port.sasl.configured.ports=9000,9001 ingress.port.sasl.prop.9000=privacy ingress.port.sasl.prop.9001=authentication One note is that, if there is misconfiguration that a port, say, 9002 is given in ingress.port.sasl.configured.ports, but it's sasl prop is not set, a default of QOP of privacy (auth-conf) will be used. In addition, if a port is not given even in ingress.port.sasl.configured.ports, but is being checked in getServerProperties(), the default SASL prop will be returned. Both of these two cases are considered misconfiguration.
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
  • Constructor Details

    • IngressPortBasedResolver

      public IngressPortBasedResolver()
  • Method Details

    • setConf

      public void setConf(Configuration conf)
      Description copied from interface: Configurable
      Set the configuration to be used by this object.
      Specified by:
      setConf in interface Configurable
      Overrides:
      setConf in class SaslPropertiesResolver
      Parameters:
      conf - configuration to be used
    • getServerProperties

      @VisibleForTesting public Map<String,String> getServerProperties(InetAddress clientAddress, int ingressPort)
      Identify the Sasl Properties to be used for a connection with a client.
      Overrides:
      getServerProperties in class SaslPropertiesResolver
      Parameters:
      clientAddress - client's address
      ingressPort - the port that the client is connecting
      Returns:
      the sasl properties to be used for the connection.