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

    Fields
    Modifier and Type
    Field
    Description
    protected final org.elasticsearch.xpack.core.security.authc.RealmConfig
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DnRoleMapper(org.elasticsearch.xpack.core.security.authc.RealmConfig config, org.elasticsearch.watcher.ResourceWatcherService watcherService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    parseFile(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.
    void
    refreshRealmOnChange(org.elasticsearch.xpack.core.security.authc.support.CachingRealm realm)
     
    static Path
    resolveFile(org.elasticsearch.xpack.core.security.authc.RealmConfig realmConfig)
     
    resolveRoles(String userDnString, Collection<String> groupDns)
    This will map the groupDN's to ES Roles
    void
    resolveRoles(org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper.UserData user, org.elasticsearch.action.ActionListener<Set<String>> listener)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      refreshRealmOnChange in interface org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper
    • resolveFile

      public static Path resolveFile(org.elasticsearch.xpack.core.security.authc.RealmConfig realmConfig)
    • 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

      public static Map<String,List<String>> parseFile(Path path, org.apache.logging.log4j.Logger logger, String realmType, String realmName, boolean strict)
    • resolveRoles

      public void resolveRoles(org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper.UserData user, org.elasticsearch.action.ActionListener<Set<String>> listener)
      Specified by:
      resolveRoles in interface org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper
    • resolveRoles

      public Set<String> resolveRoles(String userDnString, Collection<String> groupDns)
      This will map the groupDN's to ES Roles
    • notifyRefresh

      public void notifyRefresh()