public class ScriptedTrustedNamesFunction extends Object implements com.google.common.base.Function<org.opensaml.core.xml.XMLObject,Set<String>>
Function
which can be injected into
SignatureValidationFilter.setDynamicTrustedNamesStrategy(Function)
.Modifier and Type | Field and Description |
---|---|
private Object |
customObject
The custom object we can get inject into all scripts.
|
static String |
DEFAULT_ENGINE
The default language is JavaScript.
|
private org.slf4j.Logger |
log
Class logger.
|
private String |
logPrefix
Debugging info.
|
private net.shibboleth.utilities.java.support.scripting.EvaluableScript |
script
The script we care about.
|
Modifier | Constructor and Description |
---|---|
protected |
ScriptedTrustedNamesFunction(net.shibboleth.utilities.java.support.scripting.EvaluableScript theScript)
Constructor.
|
protected |
ScriptedTrustedNamesFunction(net.shibboleth.utilities.java.support.scripting.EvaluableScript theScript,
String extraInfo)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Set<String> |
apply(org.opensaml.core.xml.XMLObject context) |
Object |
getCustomObject()
Return the custom (externally provided) object.
|
(package private) static ScriptedTrustedNamesFunction |
inlineScript(String scriptSource)
Factory to create
ScriptedTrustedNamesFunction for SignatureValidationFilter s from inline data. |
(package private) static ScriptedTrustedNamesFunction |
inlineScript(String engineName,
String scriptSource)
Factory to create
ScriptedTrustedNamesFunction for SignatureValidationFilter s from inline data. |
(package private) static ScriptedTrustedNamesFunction |
resourceScript(net.shibboleth.utilities.java.support.resource.Resource resource)
Factory to create
ScriptedTrustedNamesFunction from a Resource . |
(package private) static ScriptedTrustedNamesFunction |
resourceScript(String engineName,
net.shibboleth.utilities.java.support.resource.Resource resource)
|
void |
setCustomObject(Object object)
Set the custom (externally provided) object.
|
@Nonnull @NotEmpty public static final String DEFAULT_ENGINE
@Nonnull private final org.slf4j.Logger log
@Nonnull private final net.shibboleth.utilities.java.support.scripting.EvaluableScript script
@Nullable private Object customObject
protected ScriptedTrustedNamesFunction(@Nonnull net.shibboleth.utilities.java.support.scripting.EvaluableScript theScript, @Nullable String extraInfo)
theScript
- the script we will evaluate.extraInfo
- debugging information.protected ScriptedTrustedNamesFunction(@Nonnull net.shibboleth.utilities.java.support.scripting.EvaluableScript theScript)
theScript
- the script we will evaluate.@Nullable public Object getCustomObject()
@Nullable public void setCustomObject(Object object)
object
- the custom object@Nonnull static ScriptedTrustedNamesFunction resourceScript(@Nonnull @NotEmpty String engineName, @Nonnull net.shibboleth.utilities.java.support.resource.Resource resource) throws ScriptException, IOException
engineName
- the languageresource
- the resource to look atScriptException
- if the compile failsIOException
- if the file doesn't exist.@Nonnull static ScriptedTrustedNamesFunction resourceScript(@Nonnull net.shibboleth.utilities.java.support.resource.Resource resource) throws ScriptException, IOException
ScriptedTrustedNamesFunction
from a Resource
.resource
- the resource to look atScriptException
- if the compile failsIOException
- if the file doesn't exist.@Nonnull static ScriptedTrustedNamesFunction inlineScript(@Nonnull @NotEmpty String engineName, @Nonnull @NotEmpty String scriptSource) throws ScriptException
ScriptedTrustedNamesFunction
for SignatureValidationFilter
s from inline data.scriptSource
- the script, as a stringengineName
- the languageScriptException
- if the compile fails@Nonnull static ScriptedTrustedNamesFunction inlineScript(@Nonnull @NotEmpty String scriptSource) throws ScriptException
ScriptedTrustedNamesFunction
for SignatureValidationFilter
s from inline data.scriptSource
- the script, as a stringScriptException
- if the compile failsCopyright © 1999–2020 Shibboleth Consortium. All rights reserved.