Class QDLRuntimeEngine
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine
-
- org.oa4mp.server.loader.qdl.scripting.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.ScriptingConstantsCreated by Jeff Gaynor
on 2/12/20 at 9:29 AM
-
-
Field Summary
-
Fields inherited from interface edu.uiuc.ncsa.security.util.scripting.ScriptingConstants
ALL_PHASES, AUTH_PHASE, EXCHANGE_PHASE, POST_PREFIX, PRE_PREFIX, REFRESH_PHASE, SRE_EXEC_INIT, SRE_EXEC_PHASE, SRE_NO_EXEC_PHASE, SRE_PHASES, SRE_POST_ALL, SRE_POST_AT, SRE_POST_AUTH, SRE_POST_EXCHANGE, SRE_POST_REFRESH, SRE_POST_USER_INFO, SRE_PRE_ALL, SRE_PRE_AT, SRE_PRE_AUTH, SRE_PRE_EXCHANGE, SRE_PRE_REFRESH, SRE_PRE_USER_INFO, SRE_REQ_ACCESS_TOKEN, SRE_REQ_AUDIENCE, SRE_REQ_AUTH_HEADERS, SRE_REQ_CLAIM_SOURCES, SRE_REQ_CLAIMS, SRE_REQ_EXTENDED_ATTRIBUTES, SRE_REQ_FLOW_STATES, SRE_REQ_MAIL_CONFIG, SRE_REQ_MAIL_MESSAGE, SRE_REQ_PROXY_CLAIMS, SRE_REQ_REFRESH_TOKEN, SRE_REQ_RESOURCE, SRE_REQ_SCOPES, SRE_TX_REQ_AUDIENCE, SRE_TX_REQ_RESOURCES, SRE_TX_REQ_SCOPES, TOKEN_PHASE, USER_INFO_PHASE
-
-
Constructor Summary
Constructors Constructor Description QDLRuntimeEngine(OA2QDLEnvironment qe, OA2ServiceTransaction transaction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcleanUpState(String[] varNames)protected voidcreateSRRequest(edu.uiuc.ncsa.security.util.scripting.ScriptRunRequest req)This injects the values in the request in to the current state so they are available.protected edu.uiuc.ncsa.security.util.scripting.ScriptRunResponsecreateSRResponse()After QDL has run, convert the response into something Java can understand.protected voiddeserializeJSON2_1(String rawState)voiddeserializeState(String rawState, String version)protected voiddeserializeStateOLDXML(String rawState)protected voiddeserializeStateXML2_0(String rawState)ConfigtoCSgetConfigToCS()protected StringgetGTName(FlowType type)OA2QDLEnvironmentgetQE()protected List<edu.uiuc.ncsa.security.util.scripting.ScriptInterface>getScript(String phase)protected List<edu.uiuc.ncsa.security.util.scripting.ScriptInterface>getServerScript(String phase)OA2StategetState()protected voidinit(OA2ServiceTransaction transaction)The structure of the configuration file (for backwards compatibility) isorg.qdl_lang.variables.QDLStemlistToStem(List<String> scopes)protected edu.uiuc.ncsa.security.util.scripting.ScriptRunResponsenoOpSRR()edu.uiuc.ncsa.security.util.scripting.ScriptRunResponserun(edu.uiuc.ncsa.security.util.scripting.ScriptRunRequest request)StringserializeState()StringserializeState(String version)StringserializeStateOLD()The next would use the version 2.0 serialization into XML.voidsetConfigToCS(ConfigtoCS configToCS)voidsetQE(OA2QDLEnvironment qe)List<String>stemToList(org.qdl_lang.variables.QDLStem arg)FlowStates2toFS(org.qdl_lang.variables.QDLStem stem)protected List<org.oa4mp.delegation.server.server.claims.ClaimSource>toSources(org.qdl_lang.variables.QDLStem QDLStem)org.qdl_lang.variables.QDLStemtoStem(FlowStates2 flowStates)
-
-
-
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
-
MAIL_VAR
public static String MAIL_VAR
-
MAIL_CFG_VAR
public static String MAIL_CFG_VAR
-
MAIL_MESSAGE_VAR
public static String MAIL_MESSAGE_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
-
RESOURCE_VAR
public static String RESOURCE_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
-
AT_ORIGINAL_SCOPES
public static String AT_ORIGINAL_SCOPES
-
AUTH_HEADERS_VAR
public static String AUTH_HEADERS_VAR
-
OA4MP_ERROR_CODE
public static Long OA4MP_ERROR_CODE
-
OA4MP_ERROR_CODE_NAME
public static String OA4MP_ERROR_CODE_NAME
-
configToCS
protected ConfigtoCS configToCS
-
-
Constructor Detail
-
QDLRuntimeEngine
public QDLRuntimeEngine(OA2QDLEnvironment qe, OA2ServiceTransaction transaction)
-
-
Method Detail
-
getState
public OA2State getState()
- Overrides:
getStatein classedu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine
-
getQE
public OA2QDLEnvironment getQE()
-
setQE
public void setQE(OA2QDLEnvironment qe)
-
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(String version)
- Specified by:
serializeStatein classedu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine
-
serializeState
public String serializeState()
- Specified by:
serializeStatein classedu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine
-
serializeStateOLD
public String serializeStateOLD()
The next would use the version 2.0 serialization into XML. That was insufficient for updates to the module system, so is deprecated- Returns:
-
deserializeStateOLDXML
protected void deserializeStateOLDXML(String rawState)
-
deserializeState
public void deserializeState(String rawState, String version)
- Specified by:
deserializeStatein classedu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine
-
deserializeJSON2_1
protected void deserializeJSON2_1(String rawState)
-
deserializeStateXML2_0
protected void deserializeStateXML2_0(String rawState)
-
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:
runin classedu.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
- Parameters:
req-
-
getConfigToCS
public ConfigtoCS getConfigToCS()
-
setConfigToCS
public void setConfigToCS(ConfigtoCS configToCS)
-
toSources
protected List<org.oa4mp.delegation.server.server.claims.ClaimSource> toSources(org.qdl_lang.variables.QDLStem QDLStem)
-
toStem
public org.qdl_lang.variables.QDLStem toStem(FlowStates2 flowStates)
-
toFS
public FlowStates2 toFS(org.qdl_lang.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
OA2Stateobject so that they are not serialized
- Returns:
-
cleanUpState
protected void cleanUpState(String[] varNames)
-
-