{"action":"created","comment":{"url":"https://api.github.com/repos/wildfly/wildfly/pulls/comments/209663828","pull_request_review_id":145720283,"id":209663828,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTY2MzgyOA==","diff_hunk":"@@ -91,8 +93,18 @@ public void runAs(Callable<Void> action) throws Exception {\n         }\n     }\n     @Override\n-    public void pushSubjectContext(Subject arg0, Principal arg1, Object arg2) {\n-\n+    public void pushSubjectContext(Subject subject, Principal pincipal, Object credential) {\n+        AccessController.doPrivileged(new PrivilegedAction<Void>() {\n+            public Void run() {\n+                if (credential != null) {\n+                    subject.getPrivateCredentials().add(credential);\n+                }\n+                SecurityIdentity securityIdentity = SubjectUtil.convertToSecurityIdentity(subject, pincipal, securityDomain,\n+                        \"ejb\");\n+                currentIdentity.set(securityIdentity);","path":"webservices/server-integration/src/main/java/org/jboss/as/webservices/security/ElytronSecurityDomainContextImpl.java","position":32,"original_position":24,"commit_id":"4d4c7705d955b8ff7f2f9e7af50bf6784a944b0d","original_commit_id":"85d121b86043c75d145635641a5549f5eda0c13d","user":{"login":"darranl","id":481922,"node_id":"MDQ6VXNlcjQ4MTkyMg==","avatar_url":"https://avatars3.githubusercontent.com/u/481922?v=4","gravatar_id":"","url":"https://api.github.com/users/darranl","html_url":"https://github.com/darranl","followers_url":"https://api.github.com/users/darranl/followers","following_url":"https://api.github.com/users/darranl/following{/other_user}","gists_url":"https://api.github.com/users/darranl/gists{/gist_id}","starred_url":"https://api.github.com/users/darranl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darranl/subscriptions","organizations_url":"https://api.github.com/users/darranl/orgs","repos_url":"https://api.github.com/users/darranl/repos","events_url":"https://api.github.com/users/darranl/events{/privacy}","received_events_url":"https://api.github.com/users/darranl/received_events","type":"User","site_admin":false},"body":"Reading the code my interpretation is either isValid() OR pushSubjectContext() can be called - runAs() is subsequently called which will clear any previously associated identity on the ThreadLocal.\r\n\r\nBut looking at this we do need to be 100% that nothing would prevent runAs() being called after isValid() or pushSubjectContext() has returned.\r\n\r\nAdditionally if we are relying on the runAd method popping the identity ci.runAs probably needs wrapping in a try / finally.","created_at":"2018-08-13T15:55:53Z","updated_at":"2018-08-13T15:55:53Z","html_url":"https://github.com/wildfly/wildfly/pull/11497#discussion_r209663828","pull_request_url":"https://api.github.com/repos/wildfly/wildfly/pulls/11497","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/wildfly/wildfly/pulls/comments/209663828"},"html":{"href":"https://github.com/wildfly/wildfly/pull/11497#discussion_r209663828"},"pull_request":{"href":"https://api.github.com/repos/wildfly/wildfly/pulls/11497"}},"in_reply_to_id":208813668},"pull_request":{"url":"https://api.github.com/repos/wildfly/wildfly/pulls/11497","id":206943674,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2OTQzNjc0","html_url":"https://github.com/wildfly/wildfly/pull/11497","diff_url":"https://github.com/wildfly/wildfly/pull/11497.diff","patch_url":"https://github.com/wildfly/wildfly/pull/11497.patch","issue_url":"https://api.github.com/repos/wildfly/wildfly/issues/11497","number":11497,"state":"open","locked":false,"title":"[WFLY-10480]:ElytronSecurityDomainContextImpl does not propagate authenticated subject","user":{"login":"jimma","id":91742,"node_id":"MDQ6VXNlcjkxNzQy","avatar_url":"https://avatars3.githubusercontent.com/u/91742?v=4","gravatar_id":"","url":"https://api.github.com/users/jimma","html_url":"https://github.com/jimma","followers_url":"https://api.github.com/users/jimma/followers","following_url":"https://api.github.com/users/jimma/following{/other_user}","gists_url":"https://api.github.com/users/jimma/gists{/gist_id}","starred_url":"https://api.github.com/users/jimma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimma/subscriptions","organizations_url":"https://api.github.com/users/jimma/orgs","repos_url":"https://api.github.com/users/jimma/repos","events_url":"https://api.github.com/users/jimma/events{/privacy}","received_events_url":"https://api.github.com/users/jimma/received_events","type":"User","site_admin":false},"body":"https://issues.jboss.org/browse/WFLY-10480\r\nThis PR includes:\r\n- Fix to propagate authenticated subject to elytron security domain context \r\n- Tests for this issue \r\n- Community doc","created_at":"2018-08-08T09:22:33Z","updated_at":"2018-08-13T15:55:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a92525a85e067d7b0adc3579902cac0e6d84a19e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":772547152,"node_id":"MDU6TGFiZWw3NzI1NDcxNTI=","url":"https://api.github.com/repos/wildfly/wildfly/labels/Feature","name":"Feature","color":"e8436f","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/wildfly/wildfly/pulls/11497/commits","review_comments_url":"https://api.github.com/repos/wildfly/wildfly/pulls/11497/comments","review_comment_url":"https://api.github.com/repos/wildfly/wildfly/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wildfly/wildfly/issues/11497/comments","statuses_url":"https://api.github.com/repos/wildfly/wildfly/statuses/4d4c7705d955b8ff7f2f9e7af50bf6784a944b0d","head":{"label":"jimma:WFLY-10480","ref":"WFLY-10480","sha":"4d4c7705d955b8ff7f2f9e7af50bf6784a944b0d","user":{"login":"jimma","id":91742,"node_id":"MDQ6VXNlcjkxNzQy","avatar_url":"https://avatars3.githubusercontent.com/u/91742?v=4","gravatar_id":"","url":"https://api.github.com/users/jimma","html_url":"https://github.com/jimma","followers_url":"https://api.github.com/users/jimma/followers","following_url":"https://api.github.com/users/jimma/following{/other_user}","gists_url":"https://api.github.com/users/jimma/gists{/gist_id}","starred_url":"https://api.github.com/users/jimma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimma/subscriptions","organizations_url":"https://api.github.com/users/jimma/orgs","repos_url":"https://api.github.com/users/jimma/repos","events_url":"https://api.github.com/users/jimma/events{/privacy}","received_events_url":"https://api.github.com/users/jimma/received_events","type":"User","site_admin":false},"repo":{"id":9808749,"node_id":"MDEwOlJlcG9zaXRvcnk5ODA4NzQ5","name":"wildfly","full_name":"jimma/wildfly","owner":{"login":"jimma","id":91742,"node_id":"MDQ6VXNlcjkxNzQy","avatar_url":"https://avatars3.githubusercontent.com/u/91742?v=4","gravatar_id":"","url":"https://api.github.com/users/jimma","html_url":"https://github.com/jimma","followers_url":"https://api.github.com/users/jimma/followers","following_url":"https://api.github.com/users/jimma/following{/other_user}","gists_url":"https://api.github.com/users/jimma/gists{/gist_id}","starred_url":"https://api.github.com/users/jimma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimma/subscriptions","organizations_url":"https://api.github.com/users/jimma/orgs","repos_url":"https://api.github.com/users/jimma/repos","events_url":"https://api.github.com/users/jimma/events{/privacy}","received_events_url":"https://api.github.com/users/jimma/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jimma/wildfly","description":"WildFly Application Server","fork":true,"url":"https://api.github.com/repos/jimma/wildfly","forks_url":"https://api.github.com/repos/jimma/wildfly/forks","keys_url":"https://api.github.com/repos/jimma/wildfly/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jimma/wildfly/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jimma/wildfly/teams","hooks_url":"https://api.github.com/repos/jimma/wildfly/hooks","issue_events_url":"https://api.github.com/repos/jimma/wildfly/issues/events{/number}","events_url":"https://api.github.com/repos/jimma/wildfly/events","assignees_url":"https://api.github.com/repos/jimma/wildfly/assignees{/user}","branches_url":"https://api.github.com/repos/jimma/wildfly/branches{/branch}","tags_url":"https://api.github.com/repos/jimma/wildfly/tags","blobs_url":"https://api.github.com/repos/jimma/wildfly/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jimma/wildfly/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jimma/wildfly/git/refs{/sha}","trees_url":"https://api.github.com/repos/jimma/wildfly/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jimma/wildfly/statuses/{sha}","languages_url":"https://api.github.com/repos/jimma/wildfly/languages","stargazers_url":"https://api.github.com/repos/jimma/wildfly/stargazers","contributors_url":"https://api.github.com/repos/jimma/wildfly/contributors","subscribers_url":"https://api.github.com/repos/jimma/wildfly/subscribers","subscription_url":"https://api.github.com/repos/jimma/wildfly/subscription","commits_url":"https://api.github.com/repos/jimma/wildfly/commits{/sha}","git_commits_url":"https://api.github.com/repos/jimma/wildfly/git/commits{/sha}","comments_url":"https://api.github.com/repos/jimma/wildfly/comments{/number}","issue_comment_url":"https://api.github.com/repos/jimma/wildfly/issues/comments{/number}","contents_url":"https://api.github.com/repos/jimma/wildfly/contents/{+path}","compare_url":"https://api.github.com/repos/jimma/wildfly/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jimma/wildfly/merges","archive_url":"https://api.github.com/repos/jimma/wildfly/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jimma/wildfly/downloads","issues_url":"https://api.github.com/repos/jimma/wildfly/issues{/number}","pulls_url":"https://api.github.com/repos/jimma/wildfly/pulls{/number}","milestones_url":"https://api.github.com/repos/jimma/wildfly/milestones{/number}","notifications_url":"https://api.github.com/repos/jimma/wildfly/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jimma/wildfly/labels{/name}","releases_url":"https://api.github.com/repos/jimma/wildfly/releases{/id}","deployments_url":"https://api.github.com/repos/jimma/wildfly/deployments","created_at":"2013-05-02T08:19:09Z","updated_at":"2015-01-14T09:06:09Z","pushed_at":"2018-08-13T03:53:14Z","git_url":"git://github.com/jimma/wildfly.git","ssh_url":"git@github.com:jimma/wildfly.git","clone_url":"https://github.com/jimma/wildfly.git","svn_url":"https://github.com/jimma/wildfly","homepage":"http://wildfly.org","size":185349,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wildfly:master","ref":"master","sha":"5938bdf2cde8a34f33d175c40749ffc08dfb2ae4","user":{"login":"wildfly","id":3066274,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwNjYyNzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/3066274?v=4","gravatar_id":"","url":"https://api.github.com/users/wildfly","html_url":"https://github.com/wildfly","followers_url":"https://api.github.com/users/wildfly/followers","following_url":"https://api.github.com/users/wildfly/following{/other_user}","gists_url":"https://api.github.com/users/wildfly/gists{/gist_id}","starred_url":"https://api.github.com/users/wildfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wildfly/subscriptions","organizations_url":"https://api.github.com/users/wildfly/orgs","repos_url":"https://api.github.com/users/wildfly/repos","events_url":"https://api.github.com/users/wildfly/events{/privacy}","received_events_url":"https://api.github.com/users/wildfly/received_events","type":"Organization","site_admin":false},"repo":{"id":764708,"node_id":"MDEwOlJlcG9zaXRvcnk3NjQ3MDg=","name":"wildfly","full_name":"wildfly/wildfly","owner":{"login":"wildfly","id":3066274,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwNjYyNzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/3066274?v=4","gravatar_id":"","url":"https://api.github.com/users/wildfly","html_url":"https://github.com/wildfly","followers_url":"https://api.github.com/users/wildfly/followers","following_url":"https://api.github.com/users/wildfly/following{/other_user}","gists_url":"https://api.github.com/users/wildfly/gists{/gist_id}","starred_url":"https://api.github.com/users/wildfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wildfly/subscriptions","organizations_url":"https://api.github.com/users/wildfly/orgs","repos_url":"https://api.github.com/users/wildfly/repos","events_url":"https://api.github.com/users/wildfly/events{/privacy}","received_events_url":"https://api.github.com/users/wildfly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wildfly/wildfly","description":"WildFly Application Server","fork":false,"url":"https://api.github.com/repos/wildfly/wildfly","forks_url":"https://api.github.com/repos/wildfly/wildfly/forks","keys_url":"https://api.github.com/repos/wildfly/wildfly/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wildfly/wildfly/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wildfly/wildfly/teams","hooks_url":"https://api.github.com/repos/wildfly/wildfly/hooks","issue_events_url":"https://api.github.com/repos/wildfly/wildfly/issues/events{/number}","events_url":"https://api.github.com/repos/wildfly/wildfly/events","assignees_url":"https://api.github.com/repos/wildfly/wildfly/assignees{/user}","branches_url":"https://api.github.com/repos/wildfly/wildfly/branches{/branch}","tags_url":"https://api.github.com/repos/wildfly/wildfly/tags","blobs_url":"https://api.github.com/repos/wildfly/wildfly/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wildfly/wildfly/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wildfly/wildfly/git/refs{/sha}","trees_url":"https://api.github.com/repos/wildfly/wildfly/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wildfly/wildfly/statuses/{sha}","languages_url":"https://api.github.com/repos/wildfly/wildfly/languages","stargazers_url":"https://api.github.com/repos/wildfly/wildfly/stargazers","contributors_url":"https://api.github.com/repos/wildfly/wildfly/contributors","subscribers_url":"https://api.github.com/repos/wildfly/wildfly/subscribers","subscription_url":"https://api.github.com/repos/wildfly/wildfly/subscription","commits_url":"https://api.github.com/repos/wildfly/wildfly/commits{/sha}","git_commits_url":"https://api.github.com/repos/wildfly/wildfly/git/commits{/sha}","comments_url":"https://api.github.com/repos/wildfly/wildfly/comments{/number}","issue_comment_url":"https://api.github.com/repos/wildfly/wildfly/issues/comments{/number}","contents_url":"https://api.github.com/repos/wildfly/wildfly/contents/{+path}","compare_url":"https://api.github.com/repos/wildfly/wildfly/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wildfly/wildfly/merges","archive_url":"https://api.github.com/repos/wildfly/wildfly/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wildfly/wildfly/downloads","issues_url":"https://api.github.com/repos/wildfly/wildfly/issues{/number}","pulls_url":"https://api.github.com/repos/wildfly/wildfly/pulls{/number}","milestones_url":"https://api.github.com/repos/wildfly/wildfly/milestones{/number}","notifications_url":"https://api.github.com/repos/wildfly/wildfly/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wildfly/wildfly/labels{/name}","releases_url":"https://api.github.com/repos/wildfly/wildfly/releases{/id}","deployments_url":"https://api.github.com/repos/wildfly/wildfly/deployments","created_at":"2010-07-08T20:46:07Z","updated_at":"2018-08-13T15:08:18Z","pushed_at":"2018-08-13T15:08:09Z","git_url":"git://github.com/wildfly/wildfly.git","ssh_url":"git@github.com:wildfly/wildfly.git","clone_url":"https://github.com/wildfly/wildfly.git","svn_url":"https://github.com/wildfly/wildfly","homepage":"http://wildfly.org","size":187002,"stargazers_count":2028,"watchers_count":2028,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1809,"mirror_url":null,"archived":false,"open_issues_count":42,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":1809,"open_issues":42,"watchers":2028,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wildfly/wildfly/pulls/11497"},"html":{"href":"https://github.com/wildfly/wildfly/pull/11497"},"issue":{"href":"https://api.github.com/repos/wildfly/wildfly/issues/11497"},"comments":{"href":"https://api.github.com/repos/wildfly/wildfly/issues/11497/comments"},"review_comments":{"href":"https://api.github.com/repos/wildfly/wildfly/pulls/11497/comments"},"review_comment":{"href":"https://api.github.com/repos/wildfly/wildfly/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wildfly/wildfly/pulls/11497/commits"},"statuses":{"href":"https://api.github.com/repos/wildfly/wildfly/statuses/4d4c7705d955b8ff7f2f9e7af50bf6784a944b0d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"darranl"}}