View Javadoc
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       * Validate a form encoded token.
13       * Will first read the token from the cookie and then validate
14       *
15       * @param request the request that contains the token.
16       * @return true if the token in the request matches the one in the cookie
17       */
18      boolean validateFormEncodedToken(HttpServletRequest request);
19  
20      /**
21       * Returns the name of the http parameter name that is used to store the xsrf token in the form.
22       *
23       * @return the name of the http parameter name
24       */
25      String getXsrfParameterName();
26  
27  }