Package org.apache.hadoop.security
Class IngressPortBasedResolver
java.lang.Object
org.apache.hadoop.security.SaslPropertiesResolver
org.apache.hadoop.security.IngressPortBasedResolver
- All Implemented Interfaces:
Configurable
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetServerProperties(InetAddress clientAddress, int ingressPort) Identify the Sasl Properties to be used for a connection with a client.voidsetConf(Configuration conf) Set the configuration to be used by this object.Methods inherited from class org.apache.hadoop.security.SaslPropertiesResolver
getClientProperties, getClientProperties, getConf, getDefaultProperties, getInstance, getServerProperties
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
IngressPortBasedResolver
public IngressPortBasedResolver()
-
-
Method Details
-
setConf
Description copied from interface:ConfigurableSet the configuration to be used by this object.- Specified by:
setConfin interfaceConfigurable- Overrides:
setConfin classSaslPropertiesResolver- 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:
getServerPropertiesin classSaslPropertiesResolver- Parameters:
clientAddress- client's addressingressPort- the port that the client is connecting- Returns:
- the sasl properties to be used for the connection.
-