Class SaslClientAuthenticationProviders
java.lang.Object
org.apache.hadoop.hbase.security.provider.SaslClientAuthenticationProviders
@LimitedPrivate("Authentication")
@Evolving
public final class SaslClientAuthenticationProviders
extends Object
Accessor for all SaslAuthenticationProvider instances.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
private static final org.slf4j.Logger
private final Collection<SaslClientAuthenticationProvider>
private static final AtomicReference<SaslClientAuthenticationProviders>
private final AuthenticationProviderSelector
static final String
-
Constructor Summary
ModifierConstructorDescriptionprivate
SaslClientAuthenticationProviders
(Collection<SaslClientAuthenticationProvider> providers, AuthenticationProviderSelector selector) -
Method Summary
Modifier and TypeMethodDescription(package private) static void
addExplicitProviders
(org.apache.hadoop.conf.Configuration conf, HashMap<Byte, SaslClientAuthenticationProvider> providers) Extracts and instantiates authentication providers from the configuration.(package private) static void
addProviderIfNotExists
(SaslClientAuthenticationProvider provider, HashMap<Byte, SaslClientAuthenticationProvider> providers) Adds the givenprovider
to the set, only if an equivalent provider does not already exist in the set.getInstance
(org.apache.hadoop.conf.Configuration conf) Returns a singleton instance ofSaslClientAuthenticationProviders
.int
Returns the number of providers that have been registered.Pair<SaslClientAuthenticationProvider,
org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier>> Returns the provider and token pair for SIMPLE authentication.(package private) static SaslClientAuthenticationProviders
instantiate
(org.apache.hadoop.conf.Configuration conf) Instantiates all client authentication providers and returns an instance ofSaslClientAuthenticationProviders
.(package private) static AuthenticationProviderSelector
instantiateSelector
(org.apache.hadoop.conf.Configuration conf, Collection<SaslClientAuthenticationProvider> providers) Instantiates the ProviderSelector implementation from the provided configuration.static void
reset()
Removes the cached singleton instance ofSaslClientAuthenticationProviders
.Pair<SaslClientAuthenticationProvider,
org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier>> selectProvider
(String clusterId, User clientUser) Chooses the best authentication provider and corresponding token given the HBase cluster identifier and the user.toString()
-
Field Details
-
LOG
-
SELECTOR_KEY
- See Also:
-
EXTRA_PROVIDERS_KEY
- See Also:
-
providersRef
-
providers
-
selector
-
-
Constructor Details
-
SaslClientAuthenticationProviders
private SaslClientAuthenticationProviders(Collection<SaslClientAuthenticationProvider> providers, AuthenticationProviderSelector selector)
-
-
Method Details
-
getNumRegisteredProviders
Returns the number of providers that have been registered. -
getInstance
public static SaslClientAuthenticationProviders getInstance(org.apache.hadoop.conf.Configuration conf) Returns a singleton instance ofSaslClientAuthenticationProviders
. -
reset
Removes the cached singleton instance ofSaslClientAuthenticationProviders
. -
addProviderIfNotExists
static void addProviderIfNotExists(SaslClientAuthenticationProvider provider, HashMap<Byte, SaslClientAuthenticationProvider> providers) Adds the givenprovider
to the set, only if an equivalent provider does not already exist in the set. -
instantiateSelector
static AuthenticationProviderSelector instantiateSelector(org.apache.hadoop.conf.Configuration conf, Collection<SaslClientAuthenticationProvider> providers) Instantiates the ProviderSelector implementation from the provided configuration. -
addExplicitProviders
static void addExplicitProviders(org.apache.hadoop.conf.Configuration conf, HashMap<Byte, SaslClientAuthenticationProvider> providers) Extracts and instantiates authentication providers from the configuration. -
instantiate
Instantiates all client authentication providers and returns an instance ofSaslClientAuthenticationProviders
. -
getSimpleProvider
public Pair<SaslClientAuthenticationProvider,org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier>> getSimpleProvider()Returns the provider and token pair for SIMPLE authentication. This method is a "hack" while SIMPLE authentication for HBase does not flow through the SASL codepath. -
selectProvider
public Pair<SaslClientAuthenticationProvider,org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier>> selectProvider(String clusterId, User clientUser) Chooses the best authentication provider and corresponding token given the HBase cluster identifier and the user. -
toString
-