Package org.fcrepo.auth.common
Class ContainerRolesPrincipalProvider
- java.lang.Object
-
- org.fcrepo.auth.common.ContainerRolesPrincipalProvider
-
- All Implemented Interfaces:
javax.servlet.Filter
,PrincipalProvider
public class ContainerRolesPrincipalProvider extends Object
Adds principals based on roles that are configured within the container and through a PrincipalProvider bean in the project.- Author:
- Kevin S. Clarke
- See Also:
PrincipalProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ContainerRolesPrincipalProvider.ContainerRolesPrincipal
-
Constructor Summary
Constructors Constructor Description ContainerRolesPrincipalProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
void
doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
Set<Principal>
getPrincipals(javax.servlet.http.HttpServletRequest request)
Extract principals from the provided HttpServletRequest.void
init(javax.servlet.FilterConfig filterConfig)
void
setRoleNames(Set<String> roleNames)
Sets the role names which have been configured in the repo.xml file.
-
-
-
Constructor Detail
-
ContainerRolesPrincipalProvider
public ContainerRolesPrincipalProvider()
-
-
Method Detail
-
setRoleNames
public void setRoleNames(Set<String> roleNames)
Sets the role names which have been configured in the repo.xml file.- Parameters:
roleNames
- The names of container roles that should be recognized as principals
-
getPrincipals
public Set<Principal> getPrincipals(javax.servlet.http.HttpServletRequest request)
Description copied from interface:PrincipalProvider
Extract principals from the provided HttpServletRequest.If no principals can be extracted, implementations of this method should return the empty set rather than null.
- Parameters:
request
- the request- Returns:
- a set of security principals
-
init
public void init(javax.servlet.FilterConfig filterConfig)
- Specified by:
init
in interfacejavax.servlet.Filter
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
- Specified by:
doFilter
in interfacejavax.servlet.Filter
- Throws:
IOException
javax.servlet.ServletException
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.servlet.Filter
-
-