|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.accumulo.core.conf.CredentialProviderFactoryShim
public class CredentialProviderFactoryShim
Shim around Hadoop: tries to use the CredentialProviderFactory provided by hadoop-common, falling back to a copy inside accumulo-core.
The CredentialProvider classes only exist in 2.6.0, so, to use them, we have to do a bunch of reflection. This will also help us to continue to support [2.2.0,2.6.0) when 2.6.0 is officially released.
Constructor Summary | |
---|---|
CredentialProviderFactoryShim()
|
Method Summary | |
---|---|
static void |
createEntry(org.apache.hadoop.conf.Configuration conf,
String name,
char[] credential)
Create a CredentialEntry using the configured Providers. |
static void |
createEntryInProvider(Object credentialProvider,
String name,
char[] credential)
Create a CredentialEntry with the give name and credential in the credentialProvider. |
protected static List<String> |
getAliasesFromHadoopCredentialProvider(org.apache.hadoop.conf.Configuration conf)
|
static org.apache.hadoop.conf.Configuration |
getConfiguration(org.apache.hadoop.conf.Configuration conf,
String credentialProviders)
Adds the Credential Provider configuration elements to the provided Configuration . |
static org.apache.hadoop.conf.Configuration |
getConfiguration(String credentialProviders)
Create a Hadoop Configuration with the appropriate members to access CredentialProviders |
protected static List<Object> |
getCredentialProviders(org.apache.hadoop.conf.Configuration conf)
Wrapper to fetch the configured List<CredentialProvider> s. |
protected static char[] |
getFromHadoopCredentialProvider(org.apache.hadoop.conf.Configuration conf,
String alias)
|
static List<String> |
getKeys(org.apache.hadoop.conf.Configuration conf)
Attempt to extract all aliases from any configured CredentialsProviders. |
static char[] |
getValueFromCredentialProvider(org.apache.hadoop.conf.Configuration conf,
String alias)
Attempt to extract the password from any configured CredentialsProviders for the given alias. |
static boolean |
isHadoopCredentialProviderAvailable()
Determine if we can load the necessary CredentialProvider classes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String HADOOP_CRED_PROVIDER_FACTORY_CLASS_NAME
public static final String HADOOP_CRED_PROVIDER_FACTORY_GET_PROVIDERS_METHOD_NAME
public static final String HADOOP_CRED_PROVIDER_CLASS_NAME
public static final String HADOOP_CRED_PROVIDER_GET_CREDENTIAL_ENTRY_METHOD_NAME
public static final String HADOOP_CRED_PROVIDER_GET_ALIASES_METHOD_NAME
public static final String HADOOP_CRED_PROVIDER_CREATE_CREDENTIAL_ENTRY_METHOD_NAME
public static final String HADOOP_CRED_PROVIDER_FLUSH_METHOD_NAME
public static final String HADOOP_CRED_ENTRY_CLASS_NAME
public static final String HADOOP_CRED_ENTRY_GET_CREDENTIAL_METHOD_NAME
public static final String CREDENTIAL_PROVIDER_PATH
Constructor Detail |
---|
public CredentialProviderFactoryShim()
Method Detail |
---|
public static boolean isHadoopCredentialProviderAvailable()
protected static List<Object> getCredentialProviders(org.apache.hadoop.conf.Configuration conf)
List<CredentialProvider>
s.
conf
- Configuration with Property#GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS defined
protected static char[] getFromHadoopCredentialProvider(org.apache.hadoop.conf.Configuration conf, String alias)
protected static List<String> getAliasesFromHadoopCredentialProvider(org.apache.hadoop.conf.Configuration conf)
public static org.apache.hadoop.conf.Configuration getConfiguration(String credentialProviders)
Configuration
with the appropriate members to access CredentialProviders
credentialProviders
- Comma-separated list of CredentialProvider URLs
public static org.apache.hadoop.conf.Configuration getConfiguration(org.apache.hadoop.conf.Configuration conf, String credentialProviders)
Configuration
.
conf
- Existing Hadoop ConfigurationcredentialProviders
- Comma-separated list of CredentialProvider URLspublic static char[] getValueFromCredentialProvider(org.apache.hadoop.conf.Configuration conf, String alias) throws IOException
conf
- Configuration for CredentialProvideralias
- Name of CredentialEntry key
IOException
- On errors reading a CredentialProviderpublic static List<String> getKeys(org.apache.hadoop.conf.Configuration conf) throws IOException
conf
- Configuration for the CredentialProvider
IOException
- On errors reading a CredentialProviderpublic static void createEntry(org.apache.hadoop.conf.Configuration conf, String name, char[] credential) throws IOException
conf
- Configuration for the CredentialProvidername
- CredentialEntry name (alias)credential
- The credential
IOException
public static void createEntryInProvider(Object credentialProvider, String name, char[] credential) throws IOException
credentialProvider
- Instance of CredentialProvidername
- CredentialEntry name (alias)credential
- The credential to store
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |