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
Fields Modifier and Type Field Description protected Hashtable<String,GrantedAuthority[]>
authContext
-
Constructor Summary
Constructors Constructor Description DefaultReverseProxyAuthoritiesPopulator(Hashtable<String,GrantedAuthority[]> authContext)
Constructor for group search scenarios.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<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).GrantedAuthority[]
getGrantedAuthorities(ReverseProxyUserDetails userDetails)
Obtains the authorities for the user who's directory entry is represented by the supplied LdapUserDetails object.Set<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 Detail
-
authContext
@CheckForNull protected Hashtable<String,GrantedAuthority[]> authContext
-
-
Constructor Detail
-
DefaultReverseProxyAuthoritiesPopulator
public DefaultReverseProxyAuthoritiesPopulator(@CheckForNull Hashtable<String,GrantedAuthority[]> authContext)
Constructor for group search scenarios.userRoleAttributes
may still be set as a property.- Parameters:
authContext
- Authentication context. May benull
-
-
Method Detail
-
getAdditionalRoles
protected Set<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 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
public Set<GrantedAuthority> getGroupMembershipRoles(String username)
-
setConvertToUpperCase
public void setConvertToUpperCase(boolean convertToUpperCase)
-
setDefaultRole
public void setDefaultRole(String defaultRole)
The default role which will be assigned to all users.- Parameters:
defaultRole
- the role name, including any desired prefix.
-
setRolePrefix
public void setRolePrefix(String rolePrefix)
-
-