Class DefaultReverseProxyAuthoritiesPopulator
java.lang.Object
org.jenkinsci.plugins.reverse_proxy_auth.auth.DefaultReverseProxyAuthoritiesPopulator
- All Implemented Interfaces:
ReverseProxyAuthoritiesPopulator
- Direct Known Subclasses:
ReverseProxyAuthoritiesPopulatorImpl
public class DefaultReverseProxyAuthoritiesPopulator
extends Object
implements ReverseProxyAuthoritiesPopulator
- Author:
- Wilder rodrigues (wrodrigues@schuberphilis.com)
-
Field Summary
Modifier and TypeFieldDescriptionprotected Hashtable<String,
Collection<? extends org.springframework.security.core.GrantedAuthority>> -
Constructor Summary
ConstructorDescriptionDefaultReverseProxyAuthoritiesPopulator
(Hashtable<String, Collection<? extends org.springframework.security.core.GrantedAuthority>> authContext) Constructor for group search scenarios. -
Method Summary
Modifier and TypeMethodDescriptionprotected Set<org.springframework.security.core.GrantedAuthority>
getAdditionalRoles
(ReverseProxyUserDetails reverseProxyUser) This method should be overridden if required to obtain any additional roles for the given user (on top of those obtained from the standard search implemented by this class).final Collection<? extends org.springframework.security.core.GrantedAuthority>
getGrantedAuthorities
(ReverseProxyUserDetails userDetails) Obtains the authorities for the user who's directory entry is represented by the supplied LdapUserDetails object.Set<org.springframework.security.core.GrantedAuthority>
getGroupMembershipRoles
(String username) void
setConvertToUpperCase
(boolean convertToUpperCase) void
setDefaultRole
(String defaultRole) The default role which will be assigned to all users.void
setRolePrefix
(String rolePrefix)
-
Field Details
-
authContext
@CheckForNull protected Hashtable<String,Collection<? extends org.springframework.security.core.GrantedAuthority>> authContext
-
-
Constructor Details
-
DefaultReverseProxyAuthoritiesPopulator
public DefaultReverseProxyAuthoritiesPopulator(@CheckForNull Hashtable<String, Collection<? extends org.springframework.security.core.GrantedAuthority>> authContext) Constructor for group search scenarios.userRoleAttributes
may still be set as a property.- Parameters:
authContext
- Authentication context. May benull
-
-
Method Details
-
getAdditionalRoles
protected Set<org.springframework.security.core.GrantedAuthority> getAdditionalRoles(ReverseProxyUserDetails reverseProxyUser) This method should be overridden if required to obtain any additional roles for the given user (on top of those obtained from the standard search implemented by this class).- Parameters:
reverseProxyUser
- the user who's roles are required- Returns:
- the extra roles which will be merged with those returned by the group search
-
getGrantedAuthorities
public final Collection<? extends org.springframework.security.core.GrantedAuthority> getGrantedAuthorities(ReverseProxyUserDetails userDetails) Obtains the authorities for the user who's directory entry is represented by the supplied LdapUserDetails object.- Specified by:
getGrantedAuthorities
in interfaceReverseProxyAuthoritiesPopulator
- Parameters:
userDetails
- the user who's authorities are required- Returns:
- the set of roles granted to the user.
-
getGroupMembershipRoles
-
setConvertToUpperCase
public void setConvertToUpperCase(boolean convertToUpperCase) -
setDefaultRole
The default role which will be assigned to all users.- Parameters:
defaultRole
- the role name, including any desired prefix.
-
setRolePrefix
-