public abstract class CsrfPreventionFilterBase extends FilterBase
sm| Constructor and Description |
|---|
CsrfPreventionFilterBase() |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
generateNonce()
Deprecated.
Use
generateNonce(HttpServletRequest) instead. This method will be removed in Apache Tomcat
10.1.x onwards. |
protected java.lang.String |
generateNonce(HttpServletRequest request)
Generate a once time token (nonce) for authenticating subsequent requests.
|
int |
getDenyStatus() |
protected Log |
getLogger() |
protected java.lang.String |
getRequestedPath(HttpServletRequest request) |
void |
init(FilterConfig filterConfig)
Iterates over the configuration parameters and either logs a warning, or throws an exception for any parameter
that does not have a matching setter in this filter.
|
protected boolean |
isConfigProblemFatal()
Determines if an exception when calling a setter or an unknown configuration attribute triggers the failure of
the this filter which in turn will prevent the web application from starting.
|
void |
setDenyStatus(int denyStatus)
Set response status code that is used to reject denied request.
|
void |
setRandomClass(java.lang.String randomClass)
Specify the class to use to generate the nonces.
|
protected Log getLogger()
getLogger in class FilterBasepublic int getDenyStatus()
public void setDenyStatus(int denyStatus)
denyStatus - HTTP status codepublic void setRandomClass(java.lang.String randomClass)
Random.randomClass - The name of the class to usepublic void init(FilterConfig filterConfig) throws ServletException
FilterBaseinit in interface Filterinit in class FilterBasefilterConfig - The configuration information associated with the filter instance being initialisedServletException - if FilterBase.isConfigProblemFatal() returns true and a configured parameter does
not have a matching setterprotected boolean isConfigProblemFatal()
FilterBaseisConfigProblemFatal in class FilterBasetrue if a problem should trigger the failure of this filter, else falseprotected java.lang.String generateNonce(HttpServletRequest request)
request - The request. Unused in this method but present for the the benefit of sub-classes.@Deprecated protected java.lang.String generateNonce()
generateNonce(HttpServletRequest) instead. This method will be removed in Apache Tomcat
10.1.x onwards.protected java.lang.String getRequestedPath(HttpServletRequest request)
Copyright © 2000-2024 Apache Software Foundation.
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo are either registered trademarks or trademarks of the Apache Software Foundation.