{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/comments/77931535","id":77931535,"diff_hunk":"@@ -52,20 +59,37 @@ public Object getTarget() {\n \n         StaplerRequest request = Stapler.getCurrentRequest();\n \n-        if(enableJWT && request.getOriginalRestOfPath().startsWith(\"/rest/\")) {\n-            Authentication tokenAuthentication = JwtAuthenticationToken.create(request);\n+        if(request.getOriginalRestOfPath().startsWith(\"/rest/\")) {\n+            if(enableJWT) {\n+                Authentication tokenAuthentication = JwtAuthenticationToken.create(request);\n+\n+                //create a new context and set it to holder to not clobber existing context\n+                SecurityContext securityContext = new SecurityContextImpl();\n+                securityContext.setAuthentication(tokenAuthentication);\n+                SecurityContextHolder.setContext(securityContext);\n+\n+                //TODO: implement this as filter, see PluginServletFilter to clear the context\n+            } else {\n+                // Add X-Blueocean-Refresher to response, so that we can detect when the user changes. Wont be needed with JWT\n+                MessageDigest md = null;\n+                try {\n+                    md = MessageDigest.getInstance(\"SHA-1\");","path":"blueocean-rest-impl/src/main/java/io/jenkins/blueocean/service/embedded/BlueOceanRootAction.java","position":47,"original_position":47,"commit_id":"da9477f2e9b1fdb12bdea1346325d2ea63b64782","original_commit_id":"da9477f2e9b1fdb12bdea1346325d2ea63b64782","user":{"login":"michaelneale","id":14976,"avatar_url":"https://avatars.githubusercontent.com/u/14976?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelneale","html_url":"https://github.com/michaelneale","followers_url":"https://api.github.com/users/michaelneale/followers","following_url":"https://api.github.com/users/michaelneale/following{/other_user}","gists_url":"https://api.github.com/users/michaelneale/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelneale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelneale/subscriptions","organizations_url":"https://api.github.com/users/michaelneale/orgs","repos_url":"https://api.github.com/users/michaelneale/repos","events_url":"https://api.github.com/users/michaelneale/events{/privacy}","received_events_url":"https://api.github.com/users/michaelneale/received_events","type":"User","site_admin":false},"body":"yeah this is a bit absurd isn't it, is there no way to statically pick one that is known to be installed? \r\n\r\ncc @i386 is there a standard jenkins way of hashing (I heard you mentioned)","created_at":"2016-09-08T00:59:17Z","updated_at":"2016-09-08T00:59:17Z","html_url":"https://github.com/jenkinsci/blueocean-plugin/pull/480#discussion_r77931535","pull_request_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/480","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/comments/77931535"},"html":{"href":"https://github.com/jenkinsci/blueocean-plugin/pull/480#discussion_r77931535"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/480"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/480","id":84394859,"html_url":"https://github.com/jenkinsci/blueocean-plugin/pull/480","diff_url":"https://github.com/jenkinsci/blueocean-plugin/pull/480.diff","patch_url":"https://github.com/jenkinsci/blueocean-plugin/pull/480.patch","issue_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/480","number":480,"state":"open","locked":false,"title":"[JENKINS-36906 & JENKINS-37832] Login related things","user":{"login":"imeredith","id":140492,"avatar_url":"https://avatars.githubusercontent.com/u/140492?v=3","gravatar_id":"","url":"https://api.github.com/users/imeredith","html_url":"https://github.com/imeredith","followers_url":"https://api.github.com/users/imeredith/followers","following_url":"https://api.github.com/users/imeredith/following{/other_user}","gists_url":"https://api.github.com/users/imeredith/gists{/gist_id}","starred_url":"https://api.github.com/users/imeredith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imeredith/subscriptions","organizations_url":"https://api.github.com/users/imeredith/orgs","repos_url":"https://api.github.com/users/imeredith/repos","events_url":"https://api.github.com/users/imeredith/events{/privacy}","received_events_url":"https://api.github.com/users/imeredith/received_events","type":"User","site_admin":false},"body":"# Description\r\n\r\nThis PR covers 2 tickets. It adds login/logout buttons. It also detects if Jenkins has been restarted  or if the user has changed and reloads the page.\r\n\r\nSee [JENKINS-36906](https://issues.jenkins-ci.org/browse/JENKINS-36906).\r\nSee [JENKINS-37832](https://issues.jenkins-ci.org/browse/JENKINS-37832).\r\n\r\n# Submitter checklist\r\n- [ ] Link to JIRA ticket in description, if appropriate.\r\n- [ ] Change is code complete and matches issue description\r\n- [ ] Appropriate unit or acceptance tests or explanation to why this change has no tests\r\n- [ ] Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.\r\n- [ ] Ran Acceptance Test Harness against PR changes.\r\n\r\n# Reviewer checklist\r\n- [ ] Run the changes and verified the change matches the issue description\r\n- [ ] Reviewed the code\r\n- [ ] Verified that the appropriate tests have been written or valid explanation given\r\n\r\n@jenkinsci/code-reviewers @reviewbybees \r\n","created_at":"2016-09-08T00:08:22Z","updated_at":"2016-09-08T00:59:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d4ac4b3d86c55bceb7187b6ff5859cd9bb3b9bc4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/480/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/480/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/480/comments","statuses_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/statuses/da9477f2e9b1fdb12bdea1346325d2ea63b64782","head":{"label":"jenkinsci:feature/JENKINS-36906-login-button","ref":"feature/JENKINS-36906-login-button","sha":"da9477f2e9b1fdb12bdea1346325d2ea63b64782","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":50250915,"name":"blueocean-plugin","full_name":"jenkinsci/blueocean-plugin","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/blueocean-plugin","description":"Blue Ocean is a reboot of the Jenkins CI/CD User Experience","fork":false,"url":"https://api.github.com/repos/jenkinsci/blueocean-plugin","forks_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/deployments","created_at":"2016-01-23T18:02:45Z","updated_at":"2016-09-07T22:03:23Z","pushed_at":"2016-09-08T00:53:49Z","git_url":"git://github.com/jenkinsci/blueocean-plugin.git","ssh_url":"git@github.com:jenkinsci/blueocean-plugin.git","clone_url":"https://github.com/jenkinsci/blueocean-plugin.git","svn_url":"https://github.com/jenkinsci/blueocean-plugin","homepage":"https://jenkins.io/projects/blueocean/","size":10028,"stargazers_count":1228,"watchers_count":1228,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":100,"mirror_url":null,"open_issues_count":14,"forks":100,"open_issues":14,"watchers":1228,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"16f2da9d2200f8d3ddf64c9ed7e12c079b1aee9a","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":50250915,"name":"blueocean-plugin","full_name":"jenkinsci/blueocean-plugin","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/blueocean-plugin","description":"Blue Ocean is a reboot of the Jenkins CI/CD User Experience","fork":false,"url":"https://api.github.com/repos/jenkinsci/blueocean-plugin","forks_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/blueocean-plugin/deployments","created_at":"2016-01-23T18:02:45Z","updated_at":"2016-09-07T22:03:23Z","pushed_at":"2016-09-08T00:53:49Z","git_url":"git://github.com/jenkinsci/blueocean-plugin.git","ssh_url":"git@github.com:jenkinsci/blueocean-plugin.git","clone_url":"https://github.com/jenkinsci/blueocean-plugin.git","svn_url":"https://github.com/jenkinsci/blueocean-plugin","homepage":"https://jenkins.io/projects/blueocean/","size":10028,"stargazers_count":1228,"watchers_count":1228,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":100,"mirror_url":null,"open_issues_count":14,"forks":100,"open_issues":14,"watchers":1228,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/480"},"html":{"href":"https://github.com/jenkinsci/blueocean-plugin/pull/480"},"issue":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/480"},"comments":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/issues/480/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/480/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/pulls/480/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/blueocean-plugin/statuses/da9477f2e9b1fdb12bdea1346325d2ea63b64782"}}}}
{"actor":{"display_login":"michaelneale"}}