Class RestCsrfPreventionFilter.ServletFilterHttpInteraction
java.lang.Object
org.apache.hadoop.hbase.rest.filter.RestCsrfPreventionFilter.ServletFilterHttpInteraction
- All Implemented Interfaces:
RestCsrfPreventionFilter.HttpInteraction
- Enclosing class:
- RestCsrfPreventionFilter
private static final class RestCsrfPreventionFilter.ServletFilterHttpInteraction
extends Object
implements RestCsrfPreventionFilter.HttpInteraction
RestCsrfPreventionFilter.HttpInteraction
implementation for use in the servlet filter.-
Field Summary
Modifier and TypeFieldDescriptionprivate final javax.servlet.FilterChain
private final javax.servlet.http.HttpServletRequest
private final javax.servlet.http.HttpServletResponse
-
Constructor Summary
ConstructorDescriptionServletFilterHttpInteraction
(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, javax.servlet.FilterChain chain) Creates a new ServletFilterHttpInteraction. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of a header.Returns the method.void
proceed()
Called by the filter after it decides that the request may proceed.void
Called by the filter after it decides that the request is a potential CSRF attack and therefore must be rejected.
-
Field Details
-
chain
-
httpRequest
-
httpResponse
-
-
Constructor Details
-
ServletFilterHttpInteraction
public ServletFilterHttpInteraction(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, javax.servlet.FilterChain chain) Creates a new ServletFilterHttpInteraction.- Parameters:
httpRequest
- request to processhttpResponse
- response to processchain
- filter chain to forward to if HTTP interaction is allowed
-
-
Method Details
-
getHeader
Description copied from interface:RestCsrfPreventionFilter.HttpInteraction
Returns the value of a header.- Specified by:
getHeader
in interfaceRestCsrfPreventionFilter.HttpInteraction
- Parameters:
header
- name of header- Returns:
- value of header
-
getMethod
Description copied from interface:RestCsrfPreventionFilter.HttpInteraction
Returns the method.- Specified by:
getMethod
in interfaceRestCsrfPreventionFilter.HttpInteraction
-
proceed
Description copied from interface:RestCsrfPreventionFilter.HttpInteraction
Called by the filter after it decides that the request may proceed.- Specified by:
proceed
in interfaceRestCsrfPreventionFilter.HttpInteraction
- 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
Description copied from interface:RestCsrfPreventionFilter.HttpInteraction
Called by the filter after it decides that the request is a potential CSRF attack and therefore must be rejected.- Specified by:
sendError
in interfaceRestCsrfPreventionFilter.HttpInteraction
- Parameters:
code
- status code to sendmessage
- response message- Throws:
IOException
- if there is an I/O error
-