{"action":"created","comment":{"url":"https://api.github.com/repos/floragunncom/search-guard/pulls/comments/109104052","pull_request_review_id":30183406,"id":109104052,"diff_hunk":"@@ -0,0 +1,178 @@\n+/*\n+ * Copyright 2015 floragunn UG (haftungsbeschränkt)\n+ * \n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ * \n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ * \n+ */\n+\n+package com.floragunn.searchguard.transport;\n+\n+import java.net.InetSocketAddress;\n+import java.util.HashMap;\n+import java.util.Map;\n+\n+import org.elasticsearch.ElasticsearchSecurityException;\n+import org.elasticsearch.cluster.node.DiscoveryNode;\n+import org.elasticsearch.common.inject.Inject;\n+import org.elasticsearch.common.inject.Provider;\n+import org.elasticsearch.common.settings.Settings;\n+import org.elasticsearch.common.transport.InetSocketTransportAddress;\n+import org.elasticsearch.common.util.concurrent.ThreadContext;\n+import org.elasticsearch.threadpool.ThreadPool;\n+import org.elasticsearch.transport.TransportException;\n+import org.elasticsearch.transport.TransportInterceptor.AsyncSender;\n+import org.elasticsearch.transport.TransportRequest;\n+import org.elasticsearch.transport.TransportRequestHandler;\n+import org.elasticsearch.transport.TransportRequestOptions;\n+import org.elasticsearch.transport.TransportResponse;\n+import org.elasticsearch.transport.TransportResponseHandler;\n+\n+import com.floragunn.searchguard.SearchGuardPlugin;\n+import com.floragunn.searchguard.auditlog.AuditLog;\n+import com.floragunn.searchguard.auth.BackendRegistry;\n+import com.floragunn.searchguard.configuration.InstanceId;\n+import com.floragunn.searchguard.ssl.transport.PrincipalExtractor;\n+import com.floragunn.searchguard.support.Base64Helper;\n+import com.floragunn.searchguard.support.ConfigConstants;\n+import com.floragunn.searchguard.user.User;\n+import com.google.common.collect.Maps;\n+\n+public class SearchGuardInterceptor {\n+    \n+    private Provider<BackendRegistry> backendRegistry;\n+    private Provider<AuditLog> auditLog;\n+    private final String certOid;","path":"src/main/java/com/floragunn/searchguard/transport/SearchGuardInterceptor.java","position":54,"original_position":54,"commit_id":"7d533f1a89b6fd4dedf86bd9c5353a6757dfda44","original_commit_id":"7d533f1a89b6fd4dedf86bd9c5353a6757dfda44","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars2.githubusercontent.com/u/19940114?v=3","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Perhaps 'certOid' could be replaced by a local variable.](https://www.codacy.com/app/dev_23/search-guard/pullRequest?prid=586720)","created_at":"2017-03-31T07:38:29Z","updated_at":"2017-03-31T07:38:29Z","html_url":"https://github.com/floragunncom/search-guard/pull/318#discussion_r109104052","pull_request_url":"https://api.github.com/repos/floragunncom/search-guard/pulls/318","_links":{"self":{"href":"https://api.github.com/repos/floragunncom/search-guard/pulls/comments/109104052"},"html":{"href":"https://github.com/floragunncom/search-guard/pull/318#discussion_r109104052"},"pull_request":{"href":"https://api.github.com/repos/floragunncom/search-guard/pulls/318"}}},"pull_request":{"url":"https://api.github.com/repos/floragunncom/search-guard/pulls/318","id":113590893,"html_url":"https://github.com/floragunncom/search-guard/pull/318","diff_url":"https://github.com/floragunncom/search-guard/pull/318.diff","patch_url":"https://github.com/floragunncom/search-guard/pull/318.patch","issue_url":"https://api.github.com/repos/floragunncom/search-guard/issues/318","number":318,"state":"open","locked":false,"title":"5.0.0","user":{"login":"callmepenggg","id":3048904,"avatar_url":"https://avatars3.githubusercontent.com/u/3048904?v=3","gravatar_id":"","url":"https://api.github.com/users/callmepenggg","html_url":"https://github.com/callmepenggg","followers_url":"https://api.github.com/users/callmepenggg/followers","following_url":"https://api.github.com/users/callmepenggg/following{/other_user}","gists_url":"https://api.github.com/users/callmepenggg/gists{/gist_id}","starred_url":"https://api.github.com/users/callmepenggg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callmepenggg/subscriptions","organizations_url":"https://api.github.com/users/callmepenggg/orgs","repos_url":"https://api.github.com/users/callmepenggg/repos","events_url":"https://api.github.com/users/callmepenggg/events{/privacy}","received_events_url":"https://api.github.com/users/callmepenggg/received_events","type":"User","site_admin":false},"body":"<!---\r\nIf you not have already signed our CLA (Contributor License Agreement) \r\npls. send us an e-mail with your full name and your e-mail address to info(at)search-guard.com\r\nor to the addresses listed here https://floragunn.com/contact .You will then receive the CLA via\r\nDocuSign (https://www.docusign.com). Without a signed CLA we cannot merge your pull request!\r\n\r\nYou only need to sign the CLA once. It takes no longer that 2 minutes.\r\n--->\r\n","created_at":"2017-03-31T07:36:31Z","updated_at":"2017-03-31T07:38:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/floragunncom/search-guard/pulls/318/commits","review_comments_url":"https://api.github.com/repos/floragunncom/search-guard/pulls/318/comments","review_comment_url":"https://api.github.com/repos/floragunncom/search-guard/pulls/comments{/number}","comments_url":"https://api.github.com/repos/floragunncom/search-guard/issues/318/comments","statuses_url":"https://api.github.com/repos/floragunncom/search-guard/statuses/7d533f1a89b6fd4dedf86bd9c5353a6757dfda44","head":{"label":"floragunncom:5.0.0","ref":"5.0.0","sha":"7d533f1a89b6fd4dedf86bd9c5353a6757dfda44","user":{"login":"floragunncom","id":11678154,"avatar_url":"https://avatars0.githubusercontent.com/u/11678154?v=3","gravatar_id":"","url":"https://api.github.com/users/floragunncom","html_url":"https://github.com/floragunncom","followers_url":"https://api.github.com/users/floragunncom/followers","following_url":"https://api.github.com/users/floragunncom/following{/other_user}","gists_url":"https://api.github.com/users/floragunncom/gists{/gist_id}","starred_url":"https://api.github.com/users/floragunncom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floragunncom/subscriptions","organizations_url":"https://api.github.com/users/floragunncom/orgs","repos_url":"https://api.github.com/users/floragunncom/repos","events_url":"https://api.github.com/users/floragunncom/events{/privacy}","received_events_url":"https://api.github.com/users/floragunncom/received_events","type":"User","site_admin":false},"repo":{"id":36199933,"name":"search-guard","full_name":"floragunncom/search-guard","owner":{"login":"floragunncom","id":11678154,"avatar_url":"https://avatars0.githubusercontent.com/u/11678154?v=3","gravatar_id":"","url":"https://api.github.com/users/floragunncom","html_url":"https://github.com/floragunncom","followers_url":"https://api.github.com/users/floragunncom/followers","following_url":"https://api.github.com/users/floragunncom/following{/other_user}","gists_url":"https://api.github.com/users/floragunncom/gists{/gist_id}","starred_url":"https://api.github.com/users/floragunncom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floragunncom/subscriptions","organizations_url":"https://api.github.com/users/floragunncom/orgs","repos_url":"https://api.github.com/users/floragunncom/repos","events_url":"https://api.github.com/users/floragunncom/events{/privacy}","received_events_url":"https://api.github.com/users/floragunncom/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/floragunncom/search-guard","description":"Elasticsearch security for free.","fork":false,"url":"https://api.github.com/repos/floragunncom/search-guard","forks_url":"https://api.github.com/repos/floragunncom/search-guard/forks","keys_url":"https://api.github.com/repos/floragunncom/search-guard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/floragunncom/search-guard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/floragunncom/search-guard/teams","hooks_url":"https://api.github.com/repos/floragunncom/search-guard/hooks","issue_events_url":"https://api.github.com/repos/floragunncom/search-guard/issues/events{/number}","events_url":"https://api.github.com/repos/floragunncom/search-guard/events","assignees_url":"https://api.github.com/repos/floragunncom/search-guard/assignees{/user}","branches_url":"https://api.github.com/repos/floragunncom/search-guard/branches{/branch}","tags_url":"https://api.github.com/repos/floragunncom/search-guard/tags","blobs_url":"https://api.github.com/repos/floragunncom/search-guard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/floragunncom/search-guard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/floragunncom/search-guard/git/refs{/sha}","trees_url":"https://api.github.com/repos/floragunncom/search-guard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/floragunncom/search-guard/statuses/{sha}","languages_url":"https://api.github.com/repos/floragunncom/search-guard/languages","stargazers_url":"https://api.github.com/repos/floragunncom/search-guard/stargazers","contributors_url":"https://api.github.com/repos/floragunncom/search-guard/contributors","subscribers_url":"https://api.github.com/repos/floragunncom/search-guard/subscribers","subscription_url":"https://api.github.com/repos/floragunncom/search-guard/subscription","commits_url":"https://api.github.com/repos/floragunncom/search-guard/commits{/sha}","git_commits_url":"https://api.github.com/repos/floragunncom/search-guard/git/commits{/sha}","comments_url":"https://api.github.com/repos/floragunncom/search-guard/comments{/number}","issue_comment_url":"https://api.github.com/repos/floragunncom/search-guard/issues/comments{/number}","contents_url":"https://api.github.com/repos/floragunncom/search-guard/contents/{+path}","compare_url":"https://api.github.com/repos/floragunncom/search-guard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/floragunncom/search-guard/merges","archive_url":"https://api.github.com/repos/floragunncom/search-guard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/floragunncom/search-guard/downloads","issues_url":"https://api.github.com/repos/floragunncom/search-guard/issues{/number}","pulls_url":"https://api.github.com/repos/floragunncom/search-guard/pulls{/number}","milestones_url":"https://api.github.com/repos/floragunncom/search-guard/milestones{/number}","notifications_url":"https://api.github.com/repos/floragunncom/search-guard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/floragunncom/search-guard/labels{/name}","releases_url":"https://api.github.com/repos/floragunncom/search-guard/releases{/id}","deployments_url":"https://api.github.com/repos/floragunncom/search-guard/deployments","created_at":"2015-05-24T23:55:43Z","updated_at":"2017-03-31T06:54:29Z","pushed_at":"2017-03-31T07:36:32Z","git_url":"git://github.com/floragunncom/search-guard.git","ssh_url":"git@github.com:floragunncom/search-guard.git","clone_url":"https://github.com/floragunncom/search-guard.git","svn_url":"https://github.com/floragunncom/search-guard","homepage":"http://floragunn.com/searchguard","size":1478,"stargazers_count":893,"watchers_count":893,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":199,"mirror_url":null,"open_issues_count":16,"forks":199,"open_issues":16,"watchers":893,"default_branch":"master"}},"base":{"label":"floragunncom:master","ref":"master","sha":"1635c5fe6b57f94db30d769491b1ab22c91c26a5","user":{"login":"floragunncom","id":11678154,"avatar_url":"https://avatars0.githubusercontent.com/u/11678154?v=3","gravatar_id":"","url":"https://api.github.com/users/floragunncom","html_url":"https://github.com/floragunncom","followers_url":"https://api.github.com/users/floragunncom/followers","following_url":"https://api.github.com/users/floragunncom/following{/other_user}","gists_url":"https://api.github.com/users/floragunncom/gists{/gist_id}","starred_url":"https://api.github.com/users/floragunncom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floragunncom/subscriptions","organizations_url":"https://api.github.com/users/floragunncom/orgs","repos_url":"https://api.github.com/users/floragunncom/repos","events_url":"https://api.github.com/users/floragunncom/events{/privacy}","received_events_url":"https://api.github.com/users/floragunncom/received_events","type":"User","site_admin":false},"repo":{"id":36199933,"name":"search-guard","full_name":"floragunncom/search-guard","owner":{"login":"floragunncom","id":11678154,"avatar_url":"https://avatars0.githubusercontent.com/u/11678154?v=3","gravatar_id":"","url":"https://api.github.com/users/floragunncom","html_url":"https://github.com/floragunncom","followers_url":"https://api.github.com/users/floragunncom/followers","following_url":"https://api.github.com/users/floragunncom/following{/other_user}","gists_url":"https://api.github.com/users/floragunncom/gists{/gist_id}","starred_url":"https://api.github.com/users/floragunncom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floragunncom/subscriptions","organizations_url":"https://api.github.com/users/floragunncom/orgs","repos_url":"https://api.github.com/users/floragunncom/repos","events_url":"https://api.github.com/users/floragunncom/events{/privacy}","received_events_url":"https://api.github.com/users/floragunncom/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/floragunncom/search-guard","description":"Elasticsearch security for free.","fork":false,"url":"https://api.github.com/repos/floragunncom/search-guard","forks_url":"https://api.github.com/repos/floragunncom/search-guard/forks","keys_url":"https://api.github.com/repos/floragunncom/search-guard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/floragunncom/search-guard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/floragunncom/search-guard/teams","hooks_url":"https://api.github.com/repos/floragunncom/search-guard/hooks","issue_events_url":"https://api.github.com/repos/floragunncom/search-guard/issues/events{/number}","events_url":"https://api.github.com/repos/floragunncom/search-guard/events","assignees_url":"https://api.github.com/repos/floragunncom/search-guard/assignees{/user}","branches_url":"https://api.github.com/repos/floragunncom/search-guard/branches{/branch}","tags_url":"https://api.github.com/repos/floragunncom/search-guard/tags","blobs_url":"https://api.github.com/repos/floragunncom/search-guard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/floragunncom/search-guard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/floragunncom/search-guard/git/refs{/sha}","trees_url":"https://api.github.com/repos/floragunncom/search-guard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/floragunncom/search-guard/statuses/{sha}","languages_url":"https://api.github.com/repos/floragunncom/search-guard/languages","stargazers_url":"https://api.github.com/repos/floragunncom/search-guard/stargazers","contributors_url":"https://api.github.com/repos/floragunncom/search-guard/contributors","subscribers_url":"https://api.github.com/repos/floragunncom/search-guard/subscribers","subscription_url":"https://api.github.com/repos/floragunncom/search-guard/subscription","commits_url":"https://api.github.com/repos/floragunncom/search-guard/commits{/sha}","git_commits_url":"https://api.github.com/repos/floragunncom/search-guard/git/commits{/sha}","comments_url":"https://api.github.com/repos/floragunncom/search-guard/comments{/number}","issue_comment_url":"https://api.github.com/repos/floragunncom/search-guard/issues/comments{/number}","contents_url":"https://api.github.com/repos/floragunncom/search-guard/contents/{+path}","compare_url":"https://api.github.com/repos/floragunncom/search-guard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/floragunncom/search-guard/merges","archive_url":"https://api.github.com/repos/floragunncom/search-guard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/floragunncom/search-guard/downloads","issues_url":"https://api.github.com/repos/floragunncom/search-guard/issues{/number}","pulls_url":"https://api.github.com/repos/floragunncom/search-guard/pulls{/number}","milestones_url":"https://api.github.com/repos/floragunncom/search-guard/milestones{/number}","notifications_url":"https://api.github.com/repos/floragunncom/search-guard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/floragunncom/search-guard/labels{/name}","releases_url":"https://api.github.com/repos/floragunncom/search-guard/releases{/id}","deployments_url":"https://api.github.com/repos/floragunncom/search-guard/deployments","created_at":"2015-05-24T23:55:43Z","updated_at":"2017-03-31T06:54:29Z","pushed_at":"2017-03-31T07:36:32Z","git_url":"git://github.com/floragunncom/search-guard.git","ssh_url":"git@github.com:floragunncom/search-guard.git","clone_url":"https://github.com/floragunncom/search-guard.git","svn_url":"https://github.com/floragunncom/search-guard","homepage":"http://floragunn.com/searchguard","size":1478,"stargazers_count":893,"watchers_count":893,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":199,"mirror_url":null,"open_issues_count":16,"forks":199,"open_issues":16,"watchers":893,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/floragunncom/search-guard/pulls/318"},"html":{"href":"https://github.com/floragunncom/search-guard/pull/318"},"issue":{"href":"https://api.github.com/repos/floragunncom/search-guard/issues/318"},"comments":{"href":"https://api.github.com/repos/floragunncom/search-guard/issues/318/comments"},"review_comments":{"href":"https://api.github.com/repos/floragunncom/search-guard/pulls/318/comments"},"review_comment":{"href":"https://api.github.com/repos/floragunncom/search-guard/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/floragunncom/search-guard/pulls/318/commits"},"statuses":{"href":"https://api.github.com/repos/floragunncom/search-guard/statuses/7d533f1a89b6fd4dedf86bd9c5353a6757dfda44"}}}}
{"actor":{"display_login":"codacy-bot"}}