1 package com.atlassian.sal.api.xsrf;
2
3 import javax.servlet.http.HttpServletRequest;
4
5 /**
6 * Verifies that a submitted token is valid.
7 *
8 * @since 2.4.
9 */
10 public interface XsrfTokenValidator
11 {
12 /**
13 * Validate a form encoded token.
14 * Will first read the token from the cookie and then validate
15 *
16 * @param request the request that contains the token.
17 *
18 * @return true if the token in the request matches the one in the cookie
19 */
20 boolean validateFormEncodedToken(HttpServletRequest request);
21
22 /**
23 * Returns the name of the http parameter name that is used to store the xsrf token in the form.
24 *
25 * @return the name of the http parameter name
26 */
27 String getXsrfParameterName();
28
29 }