Class DefaultXsrfTokenValidationManager
java.lang.Object
com.atlassian.confluence.impl.xsrf.DefaultXsrfTokenValidationManager
- All Implemented Interfaces:
XsrfTokenValidationManager
Defines global XSRF token validation rules. Currently only applies to Struts Actions but should be unified with other
XSRF validation logic and extended to support all requests.
Struts Actions can be configured for XSRF protection as following (in order of precedence):
- Annotating the Action method with
XsrfProtectionRequired
- Annotating the Action method with
XsrfProtectionExcluded
- Configuring the Action param
RequireSecurityToken
instruts.xml
oratlassian-plugin.xml
- Annotating the Action method with
RequireSecurityToken
StrutsXSRFConfig
.- See Also:
-
ServletModuleContainerServlet.requestRequiresProtection(HttpServletRequest)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isRequestExempt
(MappedAction mappedAction, javax.servlet.http.HttpServletRequest request) Check if XSRF token protection checks should be exempt for the given action and request.boolean
isRequestValid
(MappedAction mappedAction, javax.servlet.http.HttpServletRequest request) Check if this request passes XSRF token checks.
-
Field Details
-
SRC_MAIL_RECIPIENT
- See Also:
-
REQUIRE_TOKEN_PARAM_NAME
- See Also:
-
-
Constructor Details
-
DefaultXsrfTokenValidationManager
-
-
Method Details
-
isRequestExempt
public boolean isRequestExempt(MappedAction mappedAction, javax.servlet.http.HttpServletRequest request) Description copied from interface:XsrfTokenValidationManager
Check if XSRF token protection checks should be exempt for the given action and request.- Specified by:
isRequestExempt
in interfaceXsrfTokenValidationManager
- Parameters:
mappedAction
- the mapped Struts action if one exists, else nullrequest
- the currentHttpServletRequest
- Returns:
- true if the request should be exempt from xsrf check, false otherwise.
-
isRequestValid
public boolean isRequestValid(MappedAction mappedAction, javax.servlet.http.HttpServletRequest request) Description copied from interface:XsrfTokenValidationManager
Check if this request passes XSRF token checks.- Specified by:
isRequestValid
in interfaceXsrfTokenValidationManager
- Parameters:
mappedAction
- the mapped Struts action if one exists, else nullrequest
- the currentHttpServletRequest
- Returns:
- true if the request passes XSRF token validations, false otherwise.
-