Class FSClaimSource

  • All Implemented Interfaces:
    Serializable, org.oa4mp.delegation.server.server.claims.ClaimSource

    public class FSClaimSource
    extends BasicClaimsSourceImpl
    A claim source backed by a file system. The file simply contains a JSON object of userids and attributes associated with that id. These are then returned as claims. Alternately, the JSON itself can just be set and used. This is how QDL utilities do it so they can fetch the JSON from a virtual file system.

    Created by Jeff Gaynor
    on 10/21/19 at 12:49 PM

    See Also:
    Serialized Form
    • Field Detail

      • FILE_PATH_KEY

        public static String FILE_PATH_KEY
        The name of the property in the configuration that specifies where the file is that holds the claims for this source.
      • FILE_CLAIM_KEY

        public static String FILE_CLAIM_KEY
        This is the name of the key in the claims to use. E.g. setting this to "sub" means the sub claim is used. It defaults to the username in the transaction if not set.
      • USE_DEFAULT_KEY

        public static String USE_DEFAULT_KEY
        Boolean-valued claim. If a user is not found, return a default record. This is useful if, e.g., this source contains a set of capabilites that are applied to more or less every user with a few exception.
      • DEFAULT_CLAIM_KEY

        public static String DEFAULT_CLAIM_KEY
        The id in the file that contains the default set of claims. Not that this is ignored unless USE_DEFAULT_KEY is set.
      • DEFAULT_ALL_CLAIMS_KEY

        public static String DEFAULT_ALL_CLAIMS_KEY
        The key if the claims were read from
    • Constructor Detail

      • FSClaimSource

        public FSClaimSource​(org.qdl_lang.variables.QDLStem stem)
      • FSClaimSource

        public FSClaimSource​(org.qdl_lang.variables.QDLStem stem,
                             OA2SE oa2SE)
      • FSClaimSource

        public FSClaimSource​(org.oa4mp.delegation.server.server.claims.ClaimSourceConfiguration config)
    • Method Detail

      • isUseDefaultClaims

        public boolean isUseDefaultClaims()
      • getDefaultClaimName

        public String getDefaultClaimName()
      • realProcessing

        protected net.sf.json.JSONObject realProcessing​(net.sf.json.JSONObject claims,
                                                        javax.servlet.http.HttpServletRequest request,
                                                        org.oa4mp.delegation.server.ServiceTransaction transaction)
                                                 throws org.oa4mp.delegation.server.server.UnsupportedScopeException
        Description copied from class: BasicClaimsSourceImpl
        This is the actual place to put your code that only processes the claim source. The BasicClaimsSourceImpl.process(JSONObject, HttpServletRequest, ServiceTransaction) calls wrap this and invoke the pre/post processor for you. Your code should take whatever metadata is for the user and add it to the claims object.
        Overrides:
        realProcessing in class BasicClaimsSourceImpl
        Returns:
        Throws:
        org.oa4mp.delegation.server.server.UnsupportedScopeException
      • setRawJSON

        public void setRawJSON​(String rawJSON)
      • isRunOnlyAtAuthorization

        public boolean isRunOnlyAtAuthorization()
        Description copied from class: BasicClaimsSourceImpl
        This should usually be false. It is true only for those sources that can ONLY run at authorization, such as HTTPHeaderClaimsSource, where the information is simply not available in later phases.
        Specified by:
        isRunOnlyAtAuthorization in interface org.oa4mp.delegation.server.server.claims.ClaimSource
        Overrides:
        isRunOnlyAtAuthorization in class BasicClaimsSourceImpl
      • fromQDL

        public void fromQDL​(org.qdl_lang.variables.QDLStem stem)
        Specified by:
        fromQDL in interface org.oa4mp.delegation.server.server.claims.ClaimSource
        Overrides:
        fromQDL in class BasicClaimsSourceImpl
      • toQDL

        public org.qdl_lang.variables.QDLStem toQDL()
        Specified by:
        toQDL in interface org.oa4mp.delegation.server.server.claims.ClaimSource
        Overrides:
        toQDL in class BasicClaimsSourceImpl