Package 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
Modifier and TypeMethodDescriptionReturns the value of a header.Returns the method.voidproceed()Called by the filter after it decides that the request may proceed.voidCalled 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
String getMethod()Returns the method.- Returns:
- method
-
proceed
Called by the filter after it decides that the request may proceed.- Throws:
IOException- if there is an I/O errorjavax.servlet.ServletException- if the implementation relies on the servlet API and a servlet API call has failed
-
sendError
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 sendmessage- response message- Throws:
IOException- if there is an I/O error
-