All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.security.PrincipalRoleMapper Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.security;

import java.security.Principal;
import java.util.Set;

import org.infinispan.factories.scopes.Scope;
import org.infinispan.factories.scopes.Scopes;

/**
 * PrincipalRoleMapper.
 *
 * @author Tristan Tarrant
 * @since 7.0
 */
@Scope(Scopes.GLOBAL)
public 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.
    *
    * @param principal
    * @return list of roles the principal belongs to
    */
   Set principalToRoles(Principal principal);

   /**
    * Sets the context for this {@link PrincipalRoleMapper}
    *
    * @param context
    */
   default void setContext(PrincipalRoleMapperContext context) {}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy