Class CommonNameRoleMapper

java.lang.Object
org.infinispan.security.mappers.CommonNameRoleMapper
All Implemented Interfaces:
PrincipalRoleMapper
Direct Known Subclasses:
CommonNameRoleMapper

public class CommonNameRoleMapper extends Object implements PrincipalRoleMapper
CommonNameRoleMapper. A simple mapper which extracts the Common Name (CN) from an LDAP-style Distinguished Name (DN) and returns it as the role.
Since:
7.0
Author:
Tristan Tarrant
Public API
  • Constructor Details

    • CommonNameRoleMapper

      public CommonNameRoleMapper()
  • Method Details

    • principalToRoles

      public Set<String> principalToRoles(Principal principal)
      Description copied from interface: PrincipalRoleMapper
      Maps a principal name to a set of role names. The principal name depends on the source of the principal itself. For example, in LDAP a Principal might use the Distinguished Name format (DN). The mapper should return null if it does not recognize the principal.
      Specified by:
      principalToRoles in interface PrincipalRoleMapper
      Returns:
      list of roles the principal belongs to
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object