|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.BaseConfigurable
org.apache.hadoop.hbase.security.UserProvider
@InterfaceAudience.Private public class UserProvider
Provide an instance of a user. Allows custom User
creation.
Constructor Summary | |
---|---|
UserProvider()
|
Method Summary | |
---|---|
User |
create(org.apache.hadoop.security.UserGroupInformation ugi)
Wraps an underlying UserGroupInformation instance. |
User |
getCurrent()
|
String |
getCurrentUserName()
|
static UserProvider |
instantiate(org.apache.hadoop.conf.Configuration conf)
Instantiate the UserProvider specified in the configuration and set the passed
configuration via BaseConfigurable.setConf(Configuration) |
boolean |
isHadoopSecurityEnabled()
|
boolean |
isHBaseSecurityEnabled()
|
void |
login(String fileConfKey,
String principalConfKey,
String localhost)
Log in the current process using the given configuration keys for the credential file and login principal. |
static void |
setUserProviderForTesting(org.apache.hadoop.conf.Configuration conf,
Class<? extends UserProvider> provider)
Set the UserProvider in the given configuration that should be instantiated |
Methods inherited from class org.apache.hadoop.hbase.BaseConfigurable |
---|
getConf, setConf |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UserProvider()
Method Detail |
---|
public static UserProvider instantiate(org.apache.hadoop.conf.Configuration conf)
UserProvider
specified in the configuration and set the passed
configuration via BaseConfigurable.setConf(Configuration)
conf
- to read and set on the created UserProvider
UserProvider
ready for use.public static void setUserProviderForTesting(org.apache.hadoop.conf.Configuration conf, Class<? extends UserProvider> provider)
UserProvider
in the given configuration that should be instantiated
conf
- to updateprovider
- class of the provider to setpublic String getCurrentUserName() throws IOException
IOException
- if the underlying user cannot be obtainedpublic boolean isHBaseSecurityEnabled()
public boolean isHadoopSecurityEnabled()
false
. For secure Hadoop, it will return the value
from UserGroupInformation.isSecurityEnabled()
.public User getCurrent() throws IOException
IOException
- if the user cannot be loadedpublic User create(org.apache.hadoop.security.UserGroupInformation ugi)
UserGroupInformation
instance.
ugi
- The base Hadoop user
public void login(String fileConfKey, String principalConfKey, String localhost) throws IOException
This is only applicable when running on secure Hadoop -- see org.apache.hadoop.security.SecurityUtil#login(Configuration,String,String,String). On regular Hadoop (without security features), this will safely be ignored.
fileConfKey
- Property key used to configure path to the credential fileprincipalConfKey
- Property key used to configure login principallocalhost
- Current hostname to use in any credentials
IOException
- underlying exception from SecurityUtil.login() call
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |