com.caucho.filters
Class CsrfFilter

java.lang.Object
  extended by com.caucho.filters.CsrfFilter
All Implemented Interfaces:
Filter

public class CsrfFilter
extends java.lang.Object
implements Filter

Support for CSRF prevention.


Field Summary
static java.lang.String NONCE_MAP
           
static java.lang.String PARAMETER
           
 
Constructor Summary
CsrfFilter()
           
 
Method Summary
 void addAllow(java.lang.String entry)
          Adds an allowed URL, without the check
 void destroy()
          Any cleanup for the filter.
 void doFilter(ServletRequest request, ServletResponse response, FilterChain nextFilter)
          doFilter performs the actual work of a filter, either modifying the request or the response.
 void init(FilterConfig config)
          Initialize the filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER

public static final java.lang.String PARAMETER
See Also:
Constant Field Values

NONCE_MAP

public static final java.lang.String NONCE_MAP
See Also:
Constant Field Values
Constructor Detail

CsrfFilter

public CsrfFilter()
Method Detail

addAllow

@Configurable
public void addAllow(java.lang.String entry)
Adds an allowed URL, without the check


init

public void init(FilterConfig config)
Description copied from interface: Filter
Initialize the filter.

Specified by:
init in interface Filter

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain nextFilter)
              throws ServletException,
                     java.io.IOException
Description copied from interface: Filter
doFilter performs the actual work of a filter, either modifying the request or the response. It will typically call the chain.doFilter() to invoke the next filter in the chain.

Specified by:
doFilter in interface Filter
Parameters:
request - the servlet request
response - the servlet response
nextFilter - the next filter in the chain
Throws:
ServletException
java.io.IOException

destroy

public void destroy()
Any cleanup for the filter.

Specified by:
destroy in interface Filter