public class AuthToLocalBuilder extends Object implements Cloneable
| Modifier and Type | Class and Description |
|---|---|
static class |
AuthToLocalBuilder.ConcatenationType
ConcatenationType is an enumeration of auth-to-local rule concatenation types.
|
| Modifier and Type | Field and Description |
|---|---|
static AuthToLocalBuilder.ConcatenationType |
DEFAULT_CONCATENATION_TYPE |
| Constructor and Description |
|---|
AuthToLocalBuilder(String defaultRealm,
Collection<String> additionalRealms,
boolean caseInsensitiveUserSupport)
Constructs a new AuthToLocalBuilder.
|
AuthToLocalBuilder(String defaultRealm,
String additionalRealms,
boolean caseInsensitiveUserSupport)
Constructs a new AuthToLocalBuilder.
|
| Modifier and Type | Method and Description |
|---|---|
AuthToLocalBuilder |
addRule(String principal,
String localUsername)
Adds a rule for the given principal and local user.
|
AuthToLocalBuilder |
addRules(String authToLocalRules)
Add existing rules from the given authToLocal configuration property.
|
Object |
clone() |
String |
generate()
Generates the auth_to_local rules used by configuration settings such as core-site/auth_to_local.
|
String |
generate(AuthToLocalBuilder.ConcatenationType concatenationType)
Generates the auth_to_local rules used by configuration settings such as core-site/auth_to_local.
|
public static final AuthToLocalBuilder.ConcatenationType DEFAULT_CONCATENATION_TYPE
public AuthToLocalBuilder(String defaultRealm, String additionalRealms, boolean caseInsensitiveUserSupport)
defaultRealm - a String declaring the default realmadditionalRealms - a String containing a comma-delimited list of realm names
to incorporate into the generated rule setcaseInsensitiveUserSupport - true indicating that case-insensitivity should be enabled;
false otherwisepublic AuthToLocalBuilder(String defaultRealm, Collection<String> additionalRealms, boolean caseInsensitiveUserSupport)
defaultRealm - a String declaring the default realmadditionalRealms - a collection of Strings declaring the set of realm names to
incorporate into the generated rule setcaseInsensitiveUserSupport - true indicating that case-insensitivity should be enabled;
false otherwisepublic Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic AuthToLocalBuilder addRules(String authToLocalRules)
authToLocalRules - config property value containing the existing rulespublic AuthToLocalBuilder addRule(String principal, String localUsername)
principal - a string containing the full principallocalUsername - a string declaring that local username to map the principal toIllegalArgumentException - if the provided principal doesn't contain a realm elementpublic String generate()
generate(ConcatenationType) with DEFAULT_CONCATENATION_TYPEpublic String generate(AuthToLocalBuilder.ConcatenationType concatenationType)
AuthToLocalBuilder.ConcatenationType.
If the concatenation type is null, the default concatenation type is assumed -
see DEFAULT_CONCATENATION_TYPE.concatenationType - the concatenation type to use to generate the rule set stringCopyright © 2022 Apache Software Foundation. All rights reserved.