File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\hudson\security\csrf\CrumbExclusion.java.html

1 /**
2 * Copyright (c) 2011 CloudBees, Inc.
3 * All rights reserved.
4 * The copyrights to the contents of this file are licensed under the MIT License (http://www.opensource.org/licenses/mit-license.php)
5 */
6 package hudson.security.csrf;
7
8 import hudson.ExtensionList;
9 import hudson.ExtensionPoint;
10 import jenkins.model.Jenkins;
11
12 import javax.servlet.FilterChain;
13 import javax.servlet.ServletException;
14 import javax.servlet.http.HttpServletRequest;
15 import javax.servlet.http.HttpServletResponse;
16 import java.io.IOException;
17
18 /**
19 * Allows plugins to define exceptions to the CSRF protection filter.
20 *
21 * @author Kohsuke Kawaguchi
22 * @since 1.446
23 */
24 public abstract class CrumbExclusion implements ExtensionPoint {
25 /**
26 * This method is called for every incoming POST request.
27 *
28 * @return
29 * true to indicate that the callee had processed this request
30 * (for example by reporting an error, or by executing the rest of the chain.)
31 */
32 public abstract boolean process(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException;
33
34 public static ExtensionList<CrumbExclusion> all() {
35 return Jenkins.getInstance().getExtensionList(CrumbExclusion.class);
36 }
37 }
38