@InterfaceStability.Unstable @InterfaceAudience.Public public class DefaultImpersonationProvider extends Object implements ImpersonationProvider
Constructor and Description |
---|
DefaultImpersonationProvider() |
Modifier and Type | Method and Description |
---|---|
void |
authorize(UserGroupInformation user,
InetAddress remoteAddress)
Authorize the superuser which is doing doAs.
|
Configuration |
getConf()
Return the configuration used by this object.
|
Map<String,Collection<String>> |
getProxyGroups() |
Map<String,Collection<String>> |
getProxyHosts() |
String |
getProxySuperuserGroupConfKey(String userName)
Returns configuration key for effective groups allowed for a superuser
|
String |
getProxySuperuserIpConfKey(String userName)
Return configuration key for superuser ip addresses
|
String |
getProxySuperuserUserConfKey(String userName)
Returns configuration key for effective usergroups allowed for a superuser
|
static DefaultImpersonationProvider |
getTestProvider() |
void |
init(String configurationPrefix)
Specifies the configuration prefix for the proxy user properties and
initializes the provider.
|
void |
setConf(Configuration conf)
Set the configuration to be used by this object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
authorize
public static DefaultImpersonationProvider getTestProvider()
public void setConf(Configuration conf)
Configurable
setConf
in interface Configurable
conf
- configuration to be usedpublic void init(String configurationPrefix)
ImpersonationProvider
init
in interface ImpersonationProvider
configurationPrefix
- the configuration prefix for the proxy user
propertiespublic Configuration getConf()
Configurable
getConf
in interface Configurable
public void authorize(UserGroupInformation user, InetAddress remoteAddress) throws AuthorizationException
ImpersonationProvider
authorize
in interface ImpersonationProvider
user
- ugi of the effective or proxy user which contains a real userremoteAddress
- the ip address of clientAuthorizationException
- Authorization Exception.public String getProxySuperuserUserConfKey(String userName)
userName
- name of the superuserpublic String getProxySuperuserGroupConfKey(String userName)
userName
- name of the superuserpublic String getProxySuperuserIpConfKey(String userName)
userName
- name of the superuser@VisibleForTesting public Map<String,Collection<String>> getProxyGroups()
@VisibleForTesting public Map<String,Collection<String>> getProxyHosts()
Copyright © 2024 Apache Software Foundation. All rights reserved.