Class QDLRuntimeEngine

  • All Implemented Interfaces:
    edu.uiuc.ncsa.security.util.scripting.ScriptingConstants

    public class QDLRuntimeEngine
    extends edu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine
    implements edu.uiuc.ncsa.security.util.scripting.ScriptingConstants

    Created by Jeff Gaynor
    on 2/12/20 at 9:29 AM

    • Field Detail

      • CONFIG_TAG

        public static String CONFIG_TAG
      • SCRIPTS_TAG

        public static String SCRIPTS_TAG
      • SYS_ERR_VAR

        public static String SYS_ERR_VAR
      • SYS_ERR_OK

        public static String SYS_ERR_OK
      • SYS_ERR_MESSAGE

        public static String SYS_ERR_MESSAGE
      • SYS_ERR_ERROR_TYPE

        public static String SYS_ERR_ERROR_TYPE
      • SYS_ERR_ERROR_URI

        public static String SYS_ERR_ERROR_URI
      • SYS_ERR_CUSTOM_ERROR_URI

        public static String SYS_ERR_CUSTOM_ERROR_URI
      • SYS_ERR_HTTP_STATUS_CODE

        public static String SYS_ERR_HTTP_STATUS_CODE
      • SYS_ERR_CODE

        public static String SYS_ERR_CODE
      • FLOW_STATE_VAR

        public static String FLOW_STATE_VAR
      • CLAIMS_VAR

        public static String CLAIMS_VAR
      • PROXY_CLAIMS_VAR

        public static String PROXY_CLAIMS_VAR
      • ACCESS_TOKEN_VAR

        public static String ACCESS_TOKEN_VAR
      • REFRESH_TOKEN_VAR

        public static String REFRESH_TOKEN_VAR
      • SCOPES_VAR

        public static String SCOPES_VAR
      • EXTENDED_ATTRIBUTES_VAR

        public static String EXTENDED_ATTRIBUTES_VAR
      • AUDIENCE_VAR

        public static String AUDIENCE_VAR
      • TX_SCOPES_VAR

        public static String TX_SCOPES_VAR
      • TX_AUDIENCE_VAR

        public static String TX_AUDIENCE_VAR
      • TX_RESOURCE_VAR

        public static String TX_RESOURCE_VAR
      • CLAIM_SOURCES_VAR

        public static String CLAIM_SOURCES_VAR
      • ACCESS_CONTROL

        public static String ACCESS_CONTROL
      • OA4MP_ERROR_CODE

        public static Long OA4MP_ERROR_CODE
      • OA4MP_ERROR_CODE_NAME

        public static String OA4MP_ERROR_CODE_NAME
    • Method Detail

      • getState

        public OA2State getState()
        Overrides:
        getState in class edu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine
      • init

        protected void init​(OA2ServiceTransaction transaction)
        The structure of the configuration file (for backwards compatibility) is
             {"config":[comments],
               "qdl" : {"scripts" : [{"script":{...}}, {"script":{...}},...]}
              }
        
         
        The assumption is that this is handed the qdl config object and can start pulling it apart at that level.
      • serializeState

        public String serializeState()
        Specified by:
        serializeState in class edu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine
      • deserializeStateOLD

        protected void deserializeStateOLD​(String rawState)
      • deserializeState

        public void deserializeState​(String rawState)
        Specified by:
        deserializeState in class edu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine
      • getScript

        protected List<edu.uiuc.ncsa.security.util.scripting.ScriptInterface> getScript​(String phase)
      • getServerScript

        protected List<edu.uiuc.ncsa.security.util.scripting.ScriptInterface> getServerScript​(String phase)
      • run

        public edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse run​(edu.uiuc.ncsa.security.util.scripting.ScriptRunRequest request)
        Specified by:
        run in class edu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine
      • createSRRequest

        protected void createSRRequest​(edu.uiuc.ncsa.security.util.scripting.ScriptRunRequest req)
        This injects the values in the request in to the current state so they are available.

        What this does

        • Converts Java to QDL and injects into the OA2State.
        • This converts everything, claims, sources, access tokens, refresg token, TX objects, etc. (if present)
        • All objects are present in the resulting OA2State even if they are empty or trivial.
        Parameters:
        req -
      • listToStem

        public edu.uiuc.ncsa.qdl.variables.QDLStem listToStem​(List<String> scopes)
      • stemToList

        public List<String> stemToList​(edu.uiuc.ncsa.qdl.variables.QDLStem arg)
      • getConfigToCS

        public ConfigtoCS getConfigToCS()
      • setConfigToCS

        public void setConfigToCS​(ConfigtoCS configToCS)
      • toSources

        protected List<ClaimSource> toSources​(edu.uiuc.ncsa.qdl.variables.QDLStem QDLStem)
      • toStem

        public edu.uiuc.ncsa.qdl.variables.QDLStem toStem​(FlowStates2 flowStates)
      • toFS

        public FlowStates2 toFS​(edu.uiuc.ncsa.qdl.variables.QDLStem stem)
      • noOpSRR

        protected edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse noOpSRR()
      • createSRResponse

        protected edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse createSRResponse()
        After QDL has run, convert the response into something Java can understand.

        What this does

        • Checks for exceptions thrown in QDL and propagates them
        • Converts stems to Java and puts in the respone map of the ScriptRunResponse
        • Removes various things from the OA2State object so that they are not serialized
        Returns:
      • cleanUpState

        protected void cleanUpState​(String[] varNames)