Package com.atlassian.jira.security.xsrf
Class DefaultXsrfInvocationChecker
java.lang.Object
com.atlassian.jira.security.ActionInvocationCheckerBase
com.atlassian.jira.security.xsrf.DefaultXsrfInvocationChecker
- All Implemented Interfaces:
XsrfInvocationChecker
public class DefaultXsrfInvocationChecker
extends ActionInvocationCheckerBase
implements XsrfInvocationChecker
This class will check that a web-request (either WebWork action or HttpServlet) has been invoked with the correct
XSRF token.
- Since:
- v4.1
-
Field Summary
Fields inherited from interface com.atlassian.jira.security.xsrf.XsrfInvocationChecker
REQUIRE_SECURITY_TOKEN, X_ATLASSIAN_TOKEN
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckActionInvocation
(webwork.action.Action action, Map<String, ?> parameters) Checks that the action about to be executed has been invoked with the correct XSRF parameters.checkWebRequestInvocation
(javax.servlet.http.HttpServletRequest httpServletRequest) Checks that the web request contains the correct XSRF parameters.Methods inherited from class com.atlassian.jira.security.ActionInvocationCheckerBase
getMethod, getMethodName
-
Constructor Details
-
DefaultXsrfInvocationChecker
-
-
Method Details
-
checkActionInvocation
@Nonnull public XsrfCheckResult checkActionInvocation(@Nonnull webwork.action.Action action, @Nonnull Map<String, ?> parameters) Checks that the action about to be executed has been invoked with the correct XSRF parameters. This method will skip the check if the action class or action command's method is annotated withDoesNotRequireXsrfCheck
or if the HTTP method in use is safe (aka non-mutative, i.e. GET, HEAD, OPTIONS, TRACE). It will however still perform the check if the action class or action command's method is annotated withRequiresXsrfCheck
whether the HTTP method is safe or not.- Specified by:
checkActionInvocation
in interfaceXsrfInvocationChecker
- Parameters:
action
- theAction
in play. Cannot be null.parameters
- the parameters this has been called with. Cannot be null.- Returns:
XsrfCheckResult
object. Not null.
-
checkWebRequestInvocation
@Nonnull public XsrfCheckResult checkWebRequestInvocation(@Nonnull javax.servlet.http.HttpServletRequest httpServletRequest) Checks that the web request contains the correct XSRF parameters.- Specified by:
checkWebRequestInvocation
in interfaceXsrfInvocationChecker
- Parameters:
httpServletRequest
- theHttpServletRequest
in play. Can't be null.- Returns:
XsrfCheckResult
object. Not null.
-