org.apache.hadoop.security.http

## Interface RestCsrfPreventionFilter.HttpInteraction

- Enclosing class:
    RestCsrfPreventionFilter

      public static interface RestCsrfPreventionFilter.HttpInteraction

  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

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getHeader(String header)` Returns the value of a header.
    `String` | `getMethod()` Returns the method.
    `void` | `proceed()` 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 Detail

    - #### getHeader

          String getHeader(String header)

      Returns the value of a header.
      Parameters:
        `header` - name of header
      Returns:
        value of header

    - #### getMethod

          String getMethod()

      Returns the method.
      Returns:
        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

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.