Class OgnlParameterAllowlister
java.lang.Object
org.apache.struts2.interceptor.parameter.OgnlParameterAllowlister
- All Implemented Interfaces:
ParameterAllowlister
Default
ParameterAllowlister. Registers the root property's class (and generic type args for depth >= 2)
into the OGNL ThreadAllowlist so OGNL may introspect and traverse a nested path on the value stack. Logic is
extracted verbatim from ParametersInterceptor.performOgnlAllowlisting so the OGNL parameter and cookie
channels share a single implementation.
No-ops when:
paramDepth == 0— shallow setter; OGNL does not need to traverse- the root property has no
@StrutsParameterannotation reachable viaPropertyDescriptoror as a public field (e.g. aModelDrivenmodel whose properties are not individually annotated). ALOG.debugsurfaces this case so the gap between authorization and OGNL traversal is observable.
- Since:
- 7.2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprimeAllowlistForPath(String parameterName, Object target) Primes the channel-specific allowlist for an authorized parameter path.voidsetOgnlUtil(OgnlUtil ognlUtil) voidsetProxyService(ProxyService proxyService) voidsetThreadAllowlist(ThreadAllowlist threadAllowlist)
-
Constructor Details
-
OgnlParameterAllowlister
public OgnlParameterAllowlister()
-
-
Method Details
-
setOgnlUtil
-
setProxyService
-
setThreadAllowlist
-
primeAllowlistForPath
Description copied from interface:ParameterAllowlisterPrimes the channel-specific allowlist for an authorized parameter path. Side-effect-only; no return value because a no-op is a valid outcome (see class-level javadoc).- Specified by:
primeAllowlistForPathin interfaceParameterAllowlister- Parameters:
parameterName- the parameter name (e.g."user.role","items[0].name")target- the object receiving the parameter value (the action, or the model for ModelDriven actions)
-