Class DefaultImpersonationProvider

java.lang.Object
org.apache.hadoop.security.authorize.DefaultImpersonationProvider
All Implemented Interfaces:
Configurable, ImpersonationProvider

@Unstable @Public public class DefaultImpersonationProvider extends Object implements ImpersonationProvider
  • Constructor Details

    • DefaultImpersonationProvider

      public DefaultImpersonationProvider()
  • Method Details

    • getTestProvider

      public static DefaultImpersonationProvider getTestProvider()
    • 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
      Parameters:
      conf - configuration to be used
    • init

      public void init(String configurationPrefix)
      Description copied from interface: ImpersonationProvider
      Specifies the configuration prefix for the proxy user properties and initializes the provider.
      Specified by:
      init in interface ImpersonationProvider
      Parameters:
      configurationPrefix - the configuration prefix for the proxy user properties
    • getConf

      public Configuration getConf()
      Description copied from interface: Configurable
      Return the configuration used by this object.
      Specified by:
      getConf in interface Configurable
      Returns:
      Configuration
    • authorize

      public void authorize(UserGroupInformation user, InetAddress remoteAddress) throws AuthorizationException
      Description copied from interface: ImpersonationProvider
      Authorize the superuser which is doing doAs.
      Specified by:
      authorize in interface ImpersonationProvider
      Parameters:
      user - ugi of the effective or proxy user which contains a real user
      remoteAddress - the ip address of client
      Throws:
      AuthorizationException - Authorization Exception.
    • getProxySuperuserUserConfKey

      public String getProxySuperuserUserConfKey(String userName)
      Returns configuration key for effective usergroups allowed for a superuser
      Parameters:
      userName - name of the superuser
      Returns:
      configuration key for superuser usergroups
    • getProxySuperuserGroupConfKey

      public String getProxySuperuserGroupConfKey(String userName)
      Returns configuration key for effective groups allowed for a superuser
      Parameters:
      userName - name of the superuser
      Returns:
      configuration key for superuser groups
    • getProxySuperuserIpConfKey

      public String getProxySuperuserIpConfKey(String userName)
      Return configuration key for superuser ip addresses
      Parameters:
      userName - name of the superuser
      Returns:
      configuration key for superuser ip-addresses
    • getProxyGroups

      @VisibleForTesting public Map<String,Collection<String>> getProxyGroups()
    • getProxyHosts

      @VisibleForTesting public Map<String,Collection<String>> getProxyHosts()