Class QDLRuntimeEngine
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine
-
- org.oa4mp.server.loader.oauth2.scripting.qdl.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 Summary
Fields Modifier and Type Field Description static String
ACCESS_CONTROL
static String
ACCESS_TOKEN_VAR
static String
AUDIENCE_VAR
static String
CLAIM_SOURCES_VAR
static String
CLAIMS_VAR
static String
CONFIG_TAG
protected ConfigtoCS
configToCS
static String
EXTENDED_ATTRIBUTES_VAR
static String
FLOW_STATE_VAR
static Long
OA4MP_ERROR_CODE
static String
OA4MP_ERROR_CODE_NAME
static String
PROXY_CLAIMS_VAR
static String
REFRESH_TOKEN_VAR
static String
SCOPES_VAR
static String
SCRIPTS_TAG
static String
SYS_ERR_CODE
static String
SYS_ERR_CUSTOM_ERROR_URI
static String
SYS_ERR_ERROR_TYPE
static String
SYS_ERR_ERROR_URI
static String
SYS_ERR_HTTP_STATUS_CODE
static String
SYS_ERR_MESSAGE
static String
SYS_ERR_OK
static String
SYS_ERR_VAR
static String
TX_AUDIENCE_VAR
static String
TX_RESOURCE_VAR
static String
TX_SCOPES_VAR
-
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_CLAIM_SOURCES, SRE_REQ_CLAIMS, SRE_REQ_EXTENDED_ATTRIBUTES, SRE_REQ_FLOW_STATES, 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 void
cleanUpState(String[] varNames)
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.protected edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse
createSRResponse()
After QDL has run, convert the response into something Java can understand.void
deserializeState(String rawState)
protected void
deserializeStateOLD(String rawState)
ConfigtoCS
getConfigToCS()
protected String
getGTName(FlowType type)
OA2QDLEnvironment
getQE()
protected List<edu.uiuc.ncsa.security.util.scripting.ScriptInterface>
getScript(String phase)
protected List<edu.uiuc.ncsa.security.util.scripting.ScriptInterface>
getServerScript(String phase)
OA2State
getState()
protected void
init(OA2ServiceTransaction transaction)
The structure of the configuration file (for backwards compatibility) isedu.uiuc.ncsa.qdl.variables.QDLStem
listToStem(List<String> scopes)
protected edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse
noOpSRR()
edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse
run(edu.uiuc.ncsa.security.util.scripting.ScriptRunRequest request)
String
serializeState()
void
setConfigToCS(ConfigtoCS configToCS)
void
setQE(OA2QDLEnvironment qe)
List<String>
stemToList(edu.uiuc.ncsa.qdl.variables.QDLStem arg)
FlowStates2
toFS(edu.uiuc.ncsa.qdl.variables.QDLStem stem)
protected List<ClaimSource>
toSources(edu.uiuc.ncsa.qdl.variables.QDLStem QDLStem)
edu.uiuc.ncsa.qdl.variables.QDLStem
toStem(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
-
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
-
configToCS
protected ConfigtoCS configToCS
-
-
Constructor Detail
-
QDLRuntimeEngine
public QDLRuntimeEngine(OA2QDLEnvironment qe, OA2ServiceTransaction transaction)
-
-
Method Detail
-
getState
public OA2State getState()
- Overrides:
getState
in 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()
- Specified by:
serializeState
in classedu.uiuc.ncsa.security.util.scripting.ScriptRuntimeEngine
-
deserializeStateOLD
protected void deserializeStateOLD(String rawState)
-
deserializeState
public void deserializeState(String rawState)
- Specified by:
deserializeState
in classedu.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 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<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)
-
-