Interface RestCsrfPreventionFilter.HttpInteraction

All Known Implementing Classes:
RestCsrfPreventionFilter.ServletFilterHttpInteraction
Enclosing class:
RestCsrfPreventionFilter

Defines the minimal API requirements for the filter to execute its filtering logic. This interface exists to facilitate integration in components that do not run within a servlet container and therefore cannot rely on a servlet container to dispatch to the RestCsrfPreventionFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) method. Applications that do run inside a servlet container will not need to write code that uses this interface. Instead, they can use typical servlet container configuration mechanisms to insert the filter.
  • Method Summary

    Modifier and Type
    Method
    Description
    getHeader(String header)
    Returns the value of a header.
    Returns the method.
    void
    Called by the filter after it decides that the request may proceed.
    void
    sendError(int code, String message)
    Called by the filter after it decides that the request is a potential CSRF attack and therefore must be rejected.
  • Method Details

    • getHeader

      Returns the value of a header.
      Parameters:
      header - name of header
      Returns:
      value of header
    • getMethod

      Returns the method.
    • proceed

      void proceed() throws IOException, javax.servlet.ServletException
      Called by the filter after it decides that the request may proceed.
      Throws:
      IOException - if there is an I/O error
      javax.servlet.ServletException - if the implementation relies on the servlet API and a servlet API call has failed
    • sendError

      void sendError(int code, String message) throws IOException
      Called by the filter after it decides that the request is a potential CSRF attack and therefore must be rejected.
      Parameters:
      code - status code to send
      message - response message
      Throws:
      IOException - if there is an I/O error