Class ServerQDLScriptHandler
- java.lang.Object
-
- org.oa4mp.server.loader.oauth2.claims.ServerQDLScriptHandler
-
- All Implemented Interfaces:
Serializable,org.oa4mp.delegation.server.jwt.PayloadHandler
public class ServerQDLScriptHandler extends Object implements org.oa4mp.delegation.server.jwt.PayloadHandler
This is a handler for all scripts that the user may set in the configuration. These scripts are run before any that the client defines so this is the first handler if present. Mostly this is vessel for conveying the scripts.Created by Jeff Gaynor
on 4/30/22 at 5:52 AM- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ServerQDLScriptHandler(ServerQDLScriptHandlerConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRequestState(edu.uiuc.ncsa.security.util.scripting.ScriptRunRequest req)For the server script, request everything.voidcheckClaims()net.sf.json.JSONObjectexecute(org.oa4mp.delegation.server.server.claims.ClaimSource source, net.sf.json.JSONObject claims)voidfinish(String execPhase)net.sf.json.JSONObjectgetAtData()net.sf.json.JSONObjectgetExtendedAttributes()Gets the extended attributes from the current transaction.net.sf.json.JSONObjectgetPayload()ServerQDLScriptHandlerConfiggetPhCfg()intgetResponseCode()net.sf.json.JSONObjectgetRTData()TokenImplgetSignedPayload(edu.uiuc.ncsa.security.util.jwk.JSONWebKey key)TokenImplgetSignedPayload(edu.uiuc.ncsa.security.util.jwk.JSONWebKey key, String headerType)List<org.oa4mp.delegation.server.server.claims.ClaimSource>getSources()Must be empty since there are no sourcesnet.sf.json.JSONObjectgetUserMetaData()voidhandleResponse(edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse resp)booleanhasScript()voidinit()voidrefresh()voidrefreshAccountingInformation()voidsaveState(String execPhase)voidsetAccountingInformation()voidsetAtData(net.sf.json.JSONObject atData)voidsetClaims(net.sf.json.JSONObject claims)voidsetExtendedAttributes(net.sf.json.JSONObject extendedAttributes)voidsetPayload(net.sf.json.JSONObject payload)voidsetPhCfg(org.oa4mp.delegation.server.jwt.PayloadHandlerConfig phCfg)voidsetResponseCode(int responseCode)voidsetRTData(net.sf.json.JSONObject rtData)
-
-
-
Constructor Detail
-
ServerQDLScriptHandler
public ServerQDLScriptHandler(ServerQDLScriptHandlerConfig config)
-
-
Method Detail
-
init
public void init() throws Throwable- Specified by:
initin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Throws:
Throwable
-
refresh
public void refresh() throws Throwable- Specified by:
refreshin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Throws:
Throwable
-
addRequestState
public void addRequestState(edu.uiuc.ncsa.security.util.scripting.ScriptRunRequest req) throws ThrowableFor the server script, request everything. This allows for complete access as needed, so if a script, e.g., wants to set up all values in the pre_auth stage, it can do it once and be done, rather than require it to set it in increments.- Specified by:
addRequestStatein interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Parameters:
req-- Throws:
Throwable
-
getRTData
public net.sf.json.JSONObject getRTData()
-
setRTData
public void setRTData(net.sf.json.JSONObject rtData)
-
checkClaims
public void checkClaims() throws Throwable- Specified by:
checkClaimsin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Throws:
Throwable
-
getSources
public List<org.oa4mp.delegation.server.server.claims.ClaimSource> getSources() throws Throwable
Must be empty since there are no sources- Specified by:
getSourcesin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Returns:
- Throws:
Throwable
-
execute
public net.sf.json.JSONObject execute(org.oa4mp.delegation.server.server.claims.ClaimSource source, net.sf.json.JSONObject claims) throws Throwable- Specified by:
executein interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Throws:
Throwable
-
finish
public void finish(String execPhase) throws Throwable
- Specified by:
finishin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Throws:
Throwable
-
saveState
public void saveState(String execPhase) throws Throwable
- Specified by:
saveStatein interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Throws:
Throwable
-
getUserMetaData
public net.sf.json.JSONObject getUserMetaData()
-
setClaims
public void setClaims(net.sf.json.JSONObject claims)
-
getExtendedAttributes
public net.sf.json.JSONObject getExtendedAttributes()
Gets the extended attributes from the current transaction. SeeOA2ServiceTransaction.getExtendedAttributes()for more.- Specified by:
getExtendedAttributesin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Returns:
-
setExtendedAttributes
public void setExtendedAttributes(net.sf.json.JSONObject extendedAttributes)
-
setAccountingInformation
public void setAccountingInformation()
- Specified by:
setAccountingInformationin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
refreshAccountingInformation
public void refreshAccountingInformation()
- Specified by:
refreshAccountingInformationin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
getPhCfg
public ServerQDLScriptHandlerConfig getPhCfg()
- Specified by:
getPhCfgin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
setPhCfg
public void setPhCfg(org.oa4mp.delegation.server.jwt.PayloadHandlerConfig phCfg)
- Specified by:
setPhCfgin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
hasScript
public boolean hasScript()
- Specified by:
hasScriptin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
setResponseCode
public void setResponseCode(int responseCode)
- Specified by:
setResponseCodein interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
getResponseCode
public int getResponseCode()
- Specified by:
getResponseCodein interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
getAtData
public net.sf.json.JSONObject getAtData()
-
setAtData
public void setAtData(net.sf.json.JSONObject atData)
-
handleResponse
public void handleResponse(edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse resp) throws Throwable- Specified by:
handleResponsein interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler- Throws:
Throwable
-
getPayload
public net.sf.json.JSONObject getPayload()
- Specified by:
getPayloadin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
setPayload
public void setPayload(net.sf.json.JSONObject payload)
- Specified by:
setPayloadin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
getSignedPayload
public TokenImpl getSignedPayload(edu.uiuc.ncsa.security.util.jwk.JSONWebKey key)
- Specified by:
getSignedPayloadin interfaceorg.oa4mp.delegation.server.jwt.PayloadHandler
-
-