Class RoleQueryHelper


  • public class RoleQueryHelper
    extends java.lang.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 Detail

      • cipher

        protected org.codelibs.core.crypto.CachedCipher cipher
      • valueSeparator

        protected java.lang.String valueSeparator
      • roleSeparator

        protected java.lang.String roleSeparator
      • parameterKey

        protected java.lang.String parameterKey
      • encryptedParameterValue

        protected boolean encryptedParameterValue
      • headerKey

        protected java.lang.String headerKey
      • encryptedHeaderValue

        protected boolean encryptedHeaderValue
      • cookieKey

        protected java.lang.String cookieKey
      • encryptedCookieValue

        protected boolean encryptedCookieValue
      • cookieNameMap

        protected java.util.Map<java.lang.String,​java.lang.String> cookieNameMap
      • defaultRoleList

        protected final java.util.List<java.lang.String> defaultRoleList
    • Constructor Detail

      • RoleQueryHelper

        public RoleQueryHelper()
    • Method Detail

      • init

        @PostConstruct
        public void init()
      • processAccessToken

        protected boolean processAccessToken​(javax.servlet.http.HttpServletRequest request,
                                             java.util.Set<java.lang.String> roleSet,
                                             boolean isApiRequest)
      • processParameter

        protected void processParameter​(javax.servlet.http.HttpServletRequest request,
                                        java.util.Set<java.lang.String> roleSet)
      • processHeader

        protected void processHeader​(javax.servlet.http.HttpServletRequest request,
                                     java.util.Set<java.lang.String> roleSet)
      • processCookie

        protected void processCookie​(javax.servlet.http.HttpServletRequest request,
                                     java.util.Set<java.lang.String> roleSet)
      • buildByCookieNameMapping

        protected void buildByCookieNameMapping​(javax.servlet.http.HttpServletRequest request,
                                                java.util.Set<java.lang.String> roleSet)
      • addRoleFromCookieMapping

        protected void addRoleFromCookieMapping​(java.util.Set<java.lang.String> roleNameList,
                                                javax.servlet.http.Cookie cookie)
      • parseRoleSet

        protected void parseRoleSet​(java.lang.String value,
                                    boolean encrypted,
                                    java.util.Set<java.lang.String> roleSet)
      • addCookieNameMapping

        public void addCookieNameMapping​(java.lang.String cookieName,
                                         java.lang.String roleName)
      • setCipher

        public void setCipher​(org.codelibs.core.crypto.CachedCipher cipher)
      • setValueSeparator

        public void setValueSeparator​(java.lang.String valueSeparator)
      • setRoleSeparator

        public void setRoleSeparator​(java.lang.String roleSeparator)
      • setParameterKey

        public void setParameterKey​(java.lang.String parameterKey)
      • setEncryptedParameterValue

        public void setEncryptedParameterValue​(boolean encryptedParameterValue)
      • setHeaderKey

        public void setHeaderKey​(java.lang.String headerKey)
      • setEncryptedHeaderValue

        public void setEncryptedHeaderValue​(boolean encryptedHeaderValue)
      • setCookieKey

        public void setCookieKey​(java.lang.String cookieKey)
      • setEncryptedCookieValue

        public void setEncryptedCookieValue​(boolean encryptedCookieValue)