@InterfaceAudience.LimitedPrivate(value={"HDFS","MapReduce"})
@InterfaceStability.Evolving
public class LdapGroupsMapping
extends Object
implements org.apache.hadoop.security.GroupMappingServiceProvider, org.apache.hadoop.conf.Configurable
GroupMappingServiceProvider which
connects directly to an LDAP server for determining group membership.
This provider should be used only if it is necessary to map users to
groups that reside exclusively in an Active Directory or LDAP installation.
The common case for a Hadoop installation will be that LDAP users and groups
materialized on the Unix servers, and for an installation like that,
ShellBasedUnixGroupsMapping is preferred. However, in cases where
those users and groups aren't materialized in Unix, but need to be used for
access control, this class may be used to communicate directly with the LDAP
server.
It is important to note that resolving group mappings will incur network
traffic, and may cause degraded performance, although user-group mappings
will be cached via the infrastructure provided by Groups.
This implementation does not support configurable search limits. If a filter
is used for searching users or groups which returns more results than are
allowed by the server, an exception will be thrown.
The implementation attempts to resolve group hierarchies,
to a configurable limit.
If the limit is 0, in order to be considered a member of a group,
the user must be an explicit member in LDAP. Otherwise, it will traverse the
group hierarchy n levels up.| Constructor and Description |
|---|
LdapGroupsMapping() |
| Modifier and Type | Method and Description |
|---|---|
void |
cacheGroupsAdd(List<String> groups)
Adds groups to cache, no need to do that for this provider
|
void |
cacheGroupsRefresh()
Caches groups, no need to do that for this provider
|
org.apache.hadoop.conf.Configuration |
getConf() |
List<String> |
getGroups(String user)
Returns list of groups for a user.
|
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
public static final String LDAP_CONFIG_PREFIX
public static final String LDAP_URL_KEY
public static final String LDAP_URL_DEFAULT
public static final String LDAP_USE_SSL_KEY
public static final Boolean LDAP_USE_SSL_DEFAULT
public static final String LDAP_KEYSTORE_KEY
public static final String LDAP_KEYSTORE_DEFAULT
public static final String LDAP_KEYSTORE_PASSWORD_KEY
public static final String LDAP_KEYSTORE_PASSWORD_DEFAULT
public static final String LDAP_KEYSTORE_PASSWORD_FILE_KEY
public static final String LDAP_KEYSTORE_PASSWORD_FILE_DEFAULT
public static final String LDAP_TRUSTSTORE_KEY
public static final String LDAP_TRUSTSTORE_PASSWORD_KEY
public static final String LDAP_TRUSTSTORE_PASSWORD_FILE_KEY
public static final String BIND_USER_KEY
public static final String BIND_USER_DEFAULT
public static final String BIND_PASSWORD_KEY
public static final String BIND_PASSWORD_DEFAULT
public static final String BIND_PASSWORD_FILE_KEY
public static final String BIND_PASSWORD_FILE_DEFAULT
public static final String BASE_DN_KEY
public static final String BASE_DN_DEFAULT
public static final String USER_BASE_DN_KEY
public static final String GROUP_BASE_DN_KEY
public static final String USER_SEARCH_FILTER_KEY
public static final String USER_SEARCH_FILTER_DEFAULT
public static final String GROUP_SEARCH_FILTER_KEY
public static final String GROUP_SEARCH_FILTER_DEFAULT
public static final String MEMBEROF_ATTR_KEY
public static final String MEMBEROF_ATTR_DEFAULT
public static final String GROUP_MEMBERSHIP_ATTR_KEY
public static final String GROUP_MEMBERSHIP_ATTR_DEFAULT
public static final String GROUP_NAME_ATTR_KEY
public static final String GROUP_NAME_ATTR_DEFAULT
public static final String GROUP_HIERARCHY_LEVELS_KEY
public static final int GROUP_HIERARCHY_LEVELS_DEFAULT
public static final String POSIX_UID_ATTR_KEY
public static final String POSIX_UID_ATTR_DEFAULT
public static final String POSIX_GID_ATTR_KEY
public static final String POSIX_GID_ATTR_DEFAULT
public static final String POSIX_GROUP
public static final String POSIX_ACCOUNT
public static final String DIRECTORY_SEARCH_TIMEOUT
public static final int DIRECTORY_SEARCH_TIMEOUT_DEFAULT
public static final String CONNECTION_TIMEOUT
public static final int CONNECTION_TIMEOUT_DEFAULT
public static final String READ_TIMEOUT
public static final int READ_TIMEOUT_DEFAULT
public static final int RECONNECT_RETRY_COUNT
public List<String> getGroups(String user)
getGroups in interface org.apache.hadoop.security.GroupMappingServiceProvideruser - get groups for this userpublic void cacheGroupsRefresh()
throws IOException
cacheGroupsRefresh in interface org.apache.hadoop.security.GroupMappingServiceProviderIOExceptionpublic void cacheGroupsAdd(List<String> groups) throws IOException
cacheGroupsAdd in interface org.apache.hadoop.security.GroupMappingServiceProvidergroups - unusedIOExceptionpublic org.apache.hadoop.conf.Configuration getConf()
getConf in interface org.apache.hadoop.conf.Configurablepublic void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.ConfigurableCopyright © 2013–2022. All rights reserved.