public class ScriptableFilter extends AbstractScriptableHeapObject implements Filter
globals
- the Map of global variables which persist across
successive invocations of the script
context
- the associated request context
request
- the HTTP request
http
- an HTTP client which may be used for
performing outbound HTTP requests
ldap
- an OpenIG LDAP client which may be used for
performing LDAP requests such as LDAP authentication
logger
- the OpenIG logger
next
- the next handler in the filter chain.
Contains also easy access to attributes
from the AttributesContext
,
e.g: attributes.user = "jackson"
, instead of contexts.attributes.attributes.user = "jackson"
.
In the same way, it gives access to session
from the SessionContext
,
for example, you can use: session.put(...)
, instead of contexts.session.session.put(...)
.
NOTE: at the moment only Groovy is supported.
NOTE: As of OpenIG 4.0, exchange.request
and exchange.response
are not set anymore.
Modifier and Type | Class and Description |
---|---|
static class |
ScriptableFilter.Heaplet
Creates and initializes a scriptable filter in a heap environment.
|
AbstractScriptableHeapObject.AbstractScriptableHeaplet
logger, storage
Modifier and Type | Method and Description |
---|---|
Promise<Response,NeverThrowsException> |
filter(Context context,
Request request,
Handler next)
Filters the request and/or response of an exchange.
|
runScript, setArgs, setClientHandler
getLogger, getStorage, setLogger, setStorage
public Promise<Response,NeverThrowsException> filter(Context context, Request request, Handler next)
Filter
next.handle(context, request)
.
This method may elect not to pass the request to the next filter or
handler, and instead handle the request itself. It can achieve this by
merely avoiding a call to next.handle(context, request)
and creating its own response object. The filter is also at liberty to
replace a response with another of its own by intercepting the response
returned by the next handler.
Copyright 2011-2015 ForgeRock AS.