Class CSRFHandler
java.lang.Object
com.emc.documentum.rest.security.csrf.CSRFHandler
The CSRF token handler as a Spring bean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delaySetCSRFToken
(ClientToken ct, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Delay set CSRF token and parameter names to the client token.Get CSRF header name setting from runtime properties.Get CSRF query name setting from runtime properties.void
handleCSRFException
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Exception e) Handle CSRF exceptions.Check whether CSRF is enabled.void
setCSRFResponse
(ClientToken ct, jakarta.servlet.http.HttpServletResponse response) Set CSRF response headers from the client token.void
validateCSRFRequest
(ClientToken ct, jakarta.servlet.http.HttpServletRequest request) Validate CSRF token for the request by comparing to the client token.
-
Constructor Details
-
CSRFHandler
public CSRFHandler()
-
-
Method Details
-
getCSRFHeaderName
Get CSRF header name setting from runtime properties.- Returns:
- CSRF header name
-
getCSRFQueryName
Get CSRF query name setting from runtime properties.- Returns:
- CSRF query name
-
isCSRFProtectionEnabled
Check whether CSRF is enabled.- Returns:
- true if CSRF is enabled; false for otherwise
-
setCSRFResponse
Set CSRF response headers from the client token.- Parameters:
ct
- client tokenresponse
- servlet response
-
validateCSRFRequest
Validate CSRF token for the request by comparing to the client token.- Parameters:
ct
- client tokenrequest
- servlet request
-
delaySetCSRFToken
public void delaySetCSRFToken(ClientToken ct, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Delay set CSRF token and parameter names to the client token.- Parameters:
ct
- client tokenrequest
- servlet requestresponse
- servlet response
-
handleCSRFException
public void handleCSRFException(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Exception e) Handle CSRF exceptions.- Parameters:
request
- servlet requestresponse
- servlet responsee
- CSRF exception
-