Package org.codelibs.fess.helper
Class RoleQueryHelper
- java.lang.Object
-
- org.codelibs.fess.helper.RoleQueryHelper
-
public class RoleQueryHelper extends Object
This class returns a list of a role from a request parameter, a request header and a cookie. The format of the default value is "[\d]+\nrole1,role2,role3", which you can encrypt.- Author:
- shinsuke
-
-
Field Summary
Fields Modifier and Type Field Description protected org.codelibs.core.crypto.CachedCiphercipherprotected StringcookieKeyprotected Map<String,String>cookieNameMapprotected List<String>defaultRoleListprotected booleanencryptedCookieValueprotected booleanencryptedHeaderValueprotected booleanencryptedParameterValueprotected StringheaderKeyprotected longmaxAgeprotected StringparameterKeyprotected StringroleSeparatorprotected static StringUSER_ROLESprotected StringvalueSeparator
-
Constructor Summary
Constructors Constructor Description RoleQueryHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCookieNameMapping(String cookieName, String roleName)protected voidaddRoleFromCookieMapping(Set<String> roleNameList, javax.servlet.http.Cookie cookie)Set<String>build(SearchRequestParams.SearchRequestType searchRequestType)protected voidbuildByCookieNameMapping(javax.servlet.http.HttpServletRequest request, Set<String> roleSet)protected longgetCurrentTime()voidinit()protected voidparseRoleSet(String value, boolean encrypted, Set<String> roleSet)protected booleanprocessAccessToken(javax.servlet.http.HttpServletRequest request, Set<String> roleSet, boolean isApiRequest)protected voidprocessCookie(javax.servlet.http.HttpServletRequest request, Set<String> roleSet)protected voidprocessHeader(javax.servlet.http.HttpServletRequest request, Set<String> roleSet)protected voidprocessParameter(javax.servlet.http.HttpServletRequest request, Set<String> roleSet)voidsetCipher(org.codelibs.core.crypto.CachedCipher cipher)voidsetCookieKey(String cookieKey)voidsetEncryptedCookieValue(boolean encryptedCookieValue)voidsetEncryptedHeaderValue(boolean encryptedHeaderValue)voidsetEncryptedParameterValue(boolean encryptedParameterValue)voidsetHeaderKey(String headerKey)voidsetMaxAge(long maxAge)voidsetParameterKey(String parameterKey)voidsetRoleSeparator(String roleSeparator)voidsetValueSeparator(String valueSeparator)
-
-
-
Field Detail
-
USER_ROLES
protected static final String USER_ROLES
- See Also:
- Constant Field Values
-
cipher
protected org.codelibs.core.crypto.CachedCipher cipher
-
valueSeparator
protected String valueSeparator
-
roleSeparator
protected String roleSeparator
-
parameterKey
protected String parameterKey
-
encryptedParameterValue
protected boolean encryptedParameterValue
-
headerKey
protected String headerKey
-
encryptedHeaderValue
protected boolean encryptedHeaderValue
-
cookieKey
protected String cookieKey
-
encryptedCookieValue
protected boolean encryptedCookieValue
-
maxAge
protected long maxAge
-
-
Method Detail
-
init
@PostConstruct public void init()
-
build
public Set<String> build(SearchRequestParams.SearchRequestType searchRequestType)
-
processAccessToken
protected boolean processAccessToken(javax.servlet.http.HttpServletRequest request, Set<String> roleSet, boolean isApiRequest)
-
processParameter
protected void processParameter(javax.servlet.http.HttpServletRequest request, Set<String> roleSet)
-
processHeader
protected void processHeader(javax.servlet.http.HttpServletRequest request, Set<String> roleSet)
-
processCookie
protected void processCookie(javax.servlet.http.HttpServletRequest request, Set<String> roleSet)
-
buildByCookieNameMapping
protected void buildByCookieNameMapping(javax.servlet.http.HttpServletRequest request, Set<String> roleSet)
-
addRoleFromCookieMapping
protected void addRoleFromCookieMapping(Set<String> roleNameList, javax.servlet.http.Cookie cookie)
-
getCurrentTime
protected long getCurrentTime()
-
setCipher
public void setCipher(org.codelibs.core.crypto.CachedCipher cipher)
-
setValueSeparator
public void setValueSeparator(String valueSeparator)
-
setRoleSeparator
public void setRoleSeparator(String roleSeparator)
-
setParameterKey
public void setParameterKey(String parameterKey)
-
setEncryptedParameterValue
public void setEncryptedParameterValue(boolean encryptedParameterValue)
-
setHeaderKey
public void setHeaderKey(String headerKey)
-
setEncryptedHeaderValue
public void setEncryptedHeaderValue(boolean encryptedHeaderValue)
-
setCookieKey
public void setCookieKey(String cookieKey)
-
setEncryptedCookieValue
public void setEncryptedCookieValue(boolean encryptedCookieValue)
-
setMaxAge
public void setMaxAge(long maxAge)
-
-