Class DnRoleMapper
java.lang.Object
org.elasticsearch.xpack.security.authc.support.DnRoleMapper
- All Implemented Interfaces:
org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper
public class DnRoleMapper
extends Object
implements org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper
This class loads and monitors the file defining the mappings of DNs to internal ES Roles.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper
org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper.DistinguishedNamePredicate, org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper.UserData -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.elasticsearch.xpack.core.security.authc.RealmConfig -
Constructor Summary
ConstructorsConstructorDescriptionDnRoleMapper(org.elasticsearch.xpack.core.security.authc.RealmConfig config, org.elasticsearch.watcher.ResourceWatcherService watcherService) -
Method Summary
Modifier and TypeMethodDescriptionvoidparseFile(Path path, org.apache.logging.log4j.Logger logger, String realmType, String realmName, boolean strict) parseFileLenient(Path path, org.apache.logging.log4j.Logger logger, String realmType, String realmName) Internally in this class, we try to load the file, but if for some reason we can't, we're being more lenient by logging the error and skipping/removing all mappings.voidrefreshRealmOnChange(org.elasticsearch.xpack.core.security.authc.support.CachingRealm realm) static PathresolveFile(org.elasticsearch.xpack.core.security.authc.RealmConfig realmConfig) resolveRoles(String userDnString, Collection<String> groupDns) This will map the groupDN's to ES RolesvoidresolveRoles(org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper.UserData user, org.elasticsearch.action.ActionListener<Set<String>> listener)
-
Field Details
-
config
protected final org.elasticsearch.xpack.core.security.authc.RealmConfig config
-
-
Constructor Details
-
DnRoleMapper
public DnRoleMapper(org.elasticsearch.xpack.core.security.authc.RealmConfig config, org.elasticsearch.watcher.ResourceWatcherService watcherService)
-
-
Method Details
-
refreshRealmOnChange
public void refreshRealmOnChange(org.elasticsearch.xpack.core.security.authc.support.CachingRealm realm) - Specified by:
refreshRealmOnChangein interfaceorg.elasticsearch.xpack.core.security.authc.support.UserRoleMapper
-
resolveFile
-
parseFileLenient
public static Map<String,List<String>> parseFileLenient(Path path, org.apache.logging.log4j.Logger logger, String realmType, String realmName) Internally in this class, we try to load the file, but if for some reason we can't, we're being more lenient by logging the error and skipping/removing all mappings. This is aligned with how we handle other auto-loaded files in security. -
parseFile
-
resolveRoles
public void resolveRoles(org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper.UserData user, org.elasticsearch.action.ActionListener<Set<String>> listener) - Specified by:
resolveRolesin interfaceorg.elasticsearch.xpack.core.security.authc.support.UserRoleMapper
-
resolveRoles
This will map the groupDN's to ES Roles -
notifyRefresh
public void notifyRefresh()
-