{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/80051371","id":80051371,"diff_hunk":"@@ -0,0 +1,52 @@\n+/*\n+ * The MIT License\n+ *\n+ * Copyright (c) 2016 CloudBees, Inc.\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy\n+ * of this software and associated documentation files (the \"Software\"), to deal\n+ * in the Software without restriction, including without limitation the rights\n+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+ * copies of the Software, and to permit persons to whom the Software is\n+ * furnished to do so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included in\n+ * all copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+ * THE SOFTWARE.\n+ */\n+package hudson.cli;\n+\n+import hudson.Extension;\n+import hudson.security.csrf.CrumbExclusion;\n+import org.kohsuke.accmod.Restricted;\n+import org.kohsuke.accmod.restrictions.DoNotUse;\n+\n+import javax.servlet.FilterChain;\n+import javax.servlet.ServletException;\n+import javax.servlet.http.HttpServletRequest;\n+import javax.servlet.http.HttpServletResponse;\n+import java.io.IOException;\n+\n+/**\n+ * Makes CLI HTTP fallback work with CSRF protection enabled (JENKINS-18114).\n+ */\n+@Extension\n+@Restricted(DoNotUse.class)\n+public class CliCrumbExclusion extends CrumbExclusion {\n+    @Override\n+    public boolean process(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException {\n+        String pathInfo = request.getPathInfo();","path":"core/src/main/java/hudson/cli/CliCrumbExclusion.java","position":45,"original_position":45,"commit_id":"dcf6ad48be31da89630efa5a5eaf79c64618c820","original_commit_id":"dcf6ad48be31da89630efa5a5eaf79c64618c820","user":{"login":"jglick","id":154109,"avatar_url":"https://avatars.githubusercontent.com/u/154109?v=3","gravatar_id":"","url":"https://api.github.com/users/jglick","html_url":"https://github.com/jglick","followers_url":"https://api.github.com/users/jglick/followers","following_url":"https://api.github.com/users/jglick/following{/other_user}","gists_url":"https://api.github.com/users/jglick/gists{/gist_id}","starred_url":"https://api.github.com/users/jglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jglick/subscriptions","organizations_url":"https://api.github.com/users/jglick/orgs","repos_url":"https://api.github.com/users/jglick/repos","events_url":"https://api.github.com/users/jglick/events{/privacy}","received_events_url":"https://api.github.com/users/jglick/received_events","type":"User","site_admin":false},"body":"Basically every `CrumbExclusion` looks the same (though most go through a couple iterations of forgetting to distinguish `/something` vs. `/something/more` vs. `/somethingunrelated`); perhaps we should have a `@CrumbExcluded` annotation you could put on a Stapler-bound getter or `do*` method?","created_at":"2016-09-22T14:21:39Z","updated_at":"2016-09-22T14:21:55Z","html_url":"https://github.com/jenkinsci/jenkins/pull/2315#discussion_r80051371","pull_request_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2315","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments/80051371"},"html":{"href":"https://github.com/jenkinsci/jenkins/pull/2315#discussion_r80051371"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2315"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2315","id":69055935,"html_url":"https://github.com/jenkinsci/jenkins/pull/2315","diff_url":"https://github.com/jenkinsci/jenkins/pull/2315.diff","patch_url":"https://github.com/jenkinsci/jenkins/pull/2315.patch","issue_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/2315","number":2315,"state":"open","locked":false,"title":"[FIX JENKINS-18114] Exclude /cli URL from crumb requirement","user":{"login":"daniel-beck","id":1831569,"avatar_url":"https://avatars.githubusercontent.com/u/1831569?v=3","gravatar_id":"","url":"https://api.github.com/users/daniel-beck","html_url":"https://github.com/daniel-beck","followers_url":"https://api.github.com/users/daniel-beck/followers","following_url":"https://api.github.com/users/daniel-beck/following{/other_user}","gists_url":"https://api.github.com/users/daniel-beck/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-beck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-beck/subscriptions","organizations_url":"https://api.github.com/users/daniel-beck/orgs","repos_url":"https://api.github.com/users/daniel-beck/repos","events_url":"https://api.github.com/users/daniel-beck/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-beck/received_events","type":"User","site_admin":false},"body":"[JENKINS-18114](https://issues.jenkins-ci.org/browse/JENKINS-18114)\r\n\r\nAdvice on how to test this welcome.","created_at":"2016-05-05T19:21:47Z","updated_at":"2016-09-22T14:21:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"683562d44ad04630064b1d26b1e81667f7e5b78e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2315/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2315/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/2315/comments","statuses_url":"https://api.github.com/repos/jenkinsci/jenkins/statuses/dcf6ad48be31da89630efa5a5eaf79c64618c820","head":{"label":"daniel-beck:JENKINS-18114","ref":"JENKINS-18114","sha":"dcf6ad48be31da89630efa5a5eaf79c64618c820","user":{"login":"daniel-beck","id":1831569,"avatar_url":"https://avatars.githubusercontent.com/u/1831569?v=3","gravatar_id":"","url":"https://api.github.com/users/daniel-beck","html_url":"https://github.com/daniel-beck","followers_url":"https://api.github.com/users/daniel-beck/followers","following_url":"https://api.github.com/users/daniel-beck/following{/other_user}","gists_url":"https://api.github.com/users/daniel-beck/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-beck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-beck/subscriptions","organizations_url":"https://api.github.com/users/daniel-beck/orgs","repos_url":"https://api.github.com/users/daniel-beck/repos","events_url":"https://api.github.com/users/daniel-beck/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-beck/received_events","type":"User","site_admin":false},"repo":{"id":11509651,"name":"jenkins","full_name":"daniel-beck/jenkins","owner":{"login":"daniel-beck","id":1831569,"avatar_url":"https://avatars.githubusercontent.com/u/1831569?v=3","gravatar_id":"","url":"https://api.github.com/users/daniel-beck","html_url":"https://github.com/daniel-beck","followers_url":"https://api.github.com/users/daniel-beck/followers","following_url":"https://api.github.com/users/daniel-beck/following{/other_user}","gists_url":"https://api.github.com/users/daniel-beck/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-beck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-beck/subscriptions","organizations_url":"https://api.github.com/users/daniel-beck/orgs","repos_url":"https://api.github.com/users/daniel-beck/repos","events_url":"https://api.github.com/users/daniel-beck/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-beck/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/daniel-beck/jenkins","description":"Jenkins Continuous Integration Server","fork":true,"url":"https://api.github.com/repos/daniel-beck/jenkins","forks_url":"https://api.github.com/repos/daniel-beck/jenkins/forks","keys_url":"https://api.github.com/repos/daniel-beck/jenkins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/daniel-beck/jenkins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/daniel-beck/jenkins/teams","hooks_url":"https://api.github.com/repos/daniel-beck/jenkins/hooks","issue_events_url":"https://api.github.com/repos/daniel-beck/jenkins/issues/events{/number}","events_url":"https://api.github.com/repos/daniel-beck/jenkins/events","assignees_url":"https://api.github.com/repos/daniel-beck/jenkins/assignees{/user}","branches_url":"https://api.github.com/repos/daniel-beck/jenkins/branches{/branch}","tags_url":"https://api.github.com/repos/daniel-beck/jenkins/tags","blobs_url":"https://api.github.com/repos/daniel-beck/jenkins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/daniel-beck/jenkins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/daniel-beck/jenkins/git/refs{/sha}","trees_url":"https://api.github.com/repos/daniel-beck/jenkins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/daniel-beck/jenkins/statuses/{sha}","languages_url":"https://api.github.com/repos/daniel-beck/jenkins/languages","stargazers_url":"https://api.github.com/repos/daniel-beck/jenkins/stargazers","contributors_url":"https://api.github.com/repos/daniel-beck/jenkins/contributors","subscribers_url":"https://api.github.com/repos/daniel-beck/jenkins/subscribers","subscription_url":"https://api.github.com/repos/daniel-beck/jenkins/subscription","commits_url":"https://api.github.com/repos/daniel-beck/jenkins/commits{/sha}","git_commits_url":"https://api.github.com/repos/daniel-beck/jenkins/git/commits{/sha}","comments_url":"https://api.github.com/repos/daniel-beck/jenkins/comments{/number}","issue_comment_url":"https://api.github.com/repos/daniel-beck/jenkins/issues/comments{/number}","contents_url":"https://api.github.com/repos/daniel-beck/jenkins/contents/{+path}","compare_url":"https://api.github.com/repos/daniel-beck/jenkins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/daniel-beck/jenkins/merges","archive_url":"https://api.github.com/repos/daniel-beck/jenkins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/daniel-beck/jenkins/downloads","issues_url":"https://api.github.com/repos/daniel-beck/jenkins/issues{/number}","pulls_url":"https://api.github.com/repos/daniel-beck/jenkins/pulls{/number}","milestones_url":"https://api.github.com/repos/daniel-beck/jenkins/milestones{/number}","notifications_url":"https://api.github.com/repos/daniel-beck/jenkins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/daniel-beck/jenkins/labels{/name}","releases_url":"https://api.github.com/repos/daniel-beck/jenkins/releases{/id}","deployments_url":"https://api.github.com/repos/daniel-beck/jenkins/deployments","created_at":"2013-07-18T17:52:48Z","updated_at":"2016-09-08T19:41:36Z","pushed_at":"2016-09-21T20:41:49Z","git_url":"git://github.com/daniel-beck/jenkins.git","ssh_url":"git@github.com:daniel-beck/jenkins.git","clone_url":"https://github.com/daniel-beck/jenkins.git","svn_url":"https://github.com/daniel-beck/jenkins","homepage":"http://jenkins-ci.org/","size":104258,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"4acaafdad17c425e29464730dfb0e6c1ab2ff5d7","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":1103607,"name":"jenkins","full_name":"jenkinsci/jenkins","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/jenkins","description":"Jenkins Continuous Integration Server","fork":true,"url":"https://api.github.com/repos/jenkinsci/jenkins","forks_url":"https://api.github.com/repos/jenkinsci/jenkins/forks","keys_url":"https://api.github.com/repos/jenkinsci/jenkins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/jenkins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/jenkins/teams","hooks_url":"https://api.github.com/repos/jenkinsci/jenkins/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/jenkins/events","assignees_url":"https://api.github.com/repos/jenkinsci/jenkins/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/jenkins/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/jenkins/tags","blobs_url":"https://api.github.com/repos/jenkinsci/jenkins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/jenkins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/jenkins/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/jenkins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/jenkins/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/jenkins/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/jenkins/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/jenkins/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/jenkins/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/jenkins/subscription","commits_url":"https://api.github.com/repos/jenkinsci/jenkins/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/jenkins/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/jenkins/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/jenkins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/jenkins/merges","archive_url":"https://api.github.com/repos/jenkinsci/jenkins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/jenkins/downloads","issues_url":"https://api.github.com/repos/jenkinsci/jenkins/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/jenkins/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/jenkins/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/jenkins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/jenkins/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/jenkins/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/jenkins/deployments","created_at":"2010-11-22T21:21:23Z","updated_at":"2016-09-22T13:27:25Z","pushed_at":"2016-09-22T07:13:31Z","git_url":"git://github.com/jenkinsci/jenkins.git","ssh_url":"git@github.com:jenkinsci/jenkins.git","clone_url":"https://github.com/jenkinsci/jenkins.git","svn_url":"https://github.com/jenkinsci/jenkins","homepage":"https://jenkins.io/","size":139850,"stargazers_count":6723,"watchers_count":6723,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2847,"mirror_url":null,"open_issues_count":121,"forks":2847,"open_issues":121,"watchers":6723,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2315"},"html":{"href":"https://github.com/jenkinsci/jenkins/pull/2315"},"issue":{"href":"https://api.github.com/repos/jenkinsci/jenkins/issues/2315"},"comments":{"href":"https://api.github.com/repos/jenkinsci/jenkins/issues/2315/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2315/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/jenkins/pulls/2315/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/jenkins/statuses/dcf6ad48be31da89630efa5a5eaf79c64618c820"}}}}
{"actor":{"display_login":"jglick"}}