@Deprecated @InterfaceAudience.Public public final class AuthUtil extends Object
ChoreService choreService = null;
// Presumes HBase configuration files are on the classpath
final Configuration conf = HBaseConfiguration.create();
final ScheduledChore authChore = AuthUtil.getAuthChore(conf);
if (authChore != null) {
choreService = new ChoreService("MY_APPLICATION");
choreService.scheduleChore(authChore);
}
try {
// do application work
} finally {
if (choreService != null) {
choreService.shutdown();
}
}
See the "Running Canary in a Kerberos-enabled Cluster" section of the HBase Reference Guide for
an example of configuring a user of this Auth Chore to run on a secure cluster.
This class will be internal used only from 2.2.0 version, and will transparently work for kerberized applications. For more, please refer Client-side Configuration for Secure Operation
限定符和类型 | 字段和说明 |
---|---|
static String |
HBASE_CLIENT_KERBEROS_PRINCIPAL
已过时。
Client principal
|
static String |
HBASE_CLIENT_KEYTAB_FILE
已过时。
Client keytab file
|
限定符和类型 | 方法和说明 |
---|---|
static ScheduledChore |
getAuthChore(org.apache.hadoop.conf.Configuration conf)
已过时。
Deprecated since 2.2.0, this method will be internal use only after 3.0.0.
|
static ScheduledChore |
getAuthRenewalChore(org.apache.hadoop.security.UserGroupInformation user)
已过时。
Checks if security is enabled and if so, launches chore for refreshing kerberos ticket.
|
static String |
getGroupName(String aclKey)
已过时。
Returns the actual name for a group principal (stripped of the
group prefix).
|
static boolean |
isGroupPrincipal(String name)
已过时。
Returns whether or not the given name should be interpreted as a group
principal.
|
static User |
loginClient(org.apache.hadoop.conf.Configuration conf)
已过时。
For kerberized cluster, return login user (from kinit or from keytab if specified).
|
static String |
toGroupEntry(String name)
已过时。
Returns the group entry with the group prefix for a group principal.
|
public static final String HBASE_CLIENT_KEYTAB_FILE
@InterfaceAudience.Private public static User loginClient(org.apache.hadoop.conf.Configuration conf) throws IOException
conf
- configuartion fileIOException
- login exception@InterfaceAudience.Private public static ScheduledChore getAuthRenewalChore(org.apache.hadoop.security.UserGroupInformation user)
@Deprecated public static ScheduledChore getAuthChore(org.apache.hadoop.conf.Configuration conf) throws IOException
conf
- the hbase service configurationIOException
@InterfaceAudience.Private public static boolean isGroupPrincipal(String name)
@InterfaceAudience.Private public static String getGroupName(String aclKey)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.