{"action":"created","comment":{"url":"https://api.github.com/repos/yahoo/pulsar/pulls/comments/85853607","pull_request_review_id":6544538,"id":85853607,"diff_hunk":"@@ -73,11 +74,16 @@ public void onWebSocketConnect(Session session) {\n             }\n         }\n \n-        if (service.isAuthorizationEnabled() && !isAuthorized(authRole)) {\n-            log.warn(\"[{}] WebSocket Client [{}] is not authorized on topic {}\", session.getRemoteAddress(), authRole,\n-                    topic);\n-            close(WebSocketError.NotAuthorizedError);\n-            return;\n+        if (service.isAuthorizationEnabled()) {\n+            final String role = authRole;\n+            isAuthorized(authRole).thenApply(isAuthorized -> {","path":"pulsar-websocket/src/main/java/com/yahoo/pulsar/websocket/AbstractWebSocketHandler.java","position":19,"original_position":19,"commit_id":"9aa7b30256b144290c771e43f624854918b75bff","original_commit_id":"9aa7b30256b144290c771e43f624854918b75bff","user":{"login":"merlimat","id":62500,"avatar_url":"https://avatars.githubusercontent.com/u/62500?v=3","gravatar_id":"","url":"https://api.github.com/users/merlimat","html_url":"https://github.com/merlimat","followers_url":"https://api.github.com/users/merlimat/followers","following_url":"https://api.github.com/users/merlimat/following{/other_user}","gists_url":"https://api.github.com/users/merlimat/gists{/gist_id}","starred_url":"https://api.github.com/users/merlimat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merlimat/subscriptions","organizations_url":"https://api.github.com/users/merlimat/orgs","repos_url":"https://api.github.com/users/merlimat/repos","events_url":"https://api.github.com/users/merlimat/events{/privacy}","received_events_url":"https://api.github.com/users/merlimat/received_events","type":"User","site_admin":false},"body":"This would be kind of different, because when the `onWebSocketConnect()` method completes we should have already done the authorization. \r\n\r\nI think we need to block on the `isAuhtorized()` future, or find a way to have an async `onWebSocketConnect()`","created_at":"2016-10-31T23:26:10Z","updated_at":"2016-10-31T23:26:54Z","html_url":"https://github.com/yahoo/pulsar/pull/98#discussion_r85853607","pull_request_url":"https://api.github.com/repos/yahoo/pulsar/pulls/98","_links":{"self":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/comments/85853607"},"html":{"href":"https://github.com/yahoo/pulsar/pull/98#discussion_r85853607"},"pull_request":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/98"}}},"pull_request":{"url":"https://api.github.com/repos/yahoo/pulsar/pulls/98","id":91697540,"html_url":"https://github.com/yahoo/pulsar/pull/98","diff_url":"https://github.com/yahoo/pulsar/pull/98.diff","patch_url":"https://github.com/yahoo/pulsar/pull/98.patch","issue_url":"https://api.github.com/repos/yahoo/pulsar/issues/98","number":98,"state":"open","locked":false,"title":"Async authorization check while creation of producer/consumer","user":{"login":"rdhabalia","id":2898254,"avatar_url":"https://avatars.githubusercontent.com/u/2898254?v=3","gravatar_id":"","url":"https://api.github.com/users/rdhabalia","html_url":"https://github.com/rdhabalia","followers_url":"https://api.github.com/users/rdhabalia/followers","following_url":"https://api.github.com/users/rdhabalia/following{/other_user}","gists_url":"https://api.github.com/users/rdhabalia/gists{/gist_id}","starred_url":"https://api.github.com/users/rdhabalia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdhabalia/subscriptions","organizations_url":"https://api.github.com/users/rdhabalia/orgs","repos_url":"https://api.github.com/users/rdhabalia/repos","events_url":"https://api.github.com/users/rdhabalia/events{/privacy}","received_events_url":"https://api.github.com/users/rdhabalia/received_events","type":"User","site_admin":false},"body":"### Motivation\r\n\r\nWhile creating producer/consumer at broker: broker performs sync authorization check (sync zk-policies checks) on client-connection which blocks broker-io threads.\r\n\r\n### Modifications\r\n\r\nMade async-authorization check while creating producer/consumer at broker and websocket server.\r\n\r\n### Result\r\n\r\nNo functional change and it will avoid i/o thread blocking while creating producer/consumer.\r\n\r\n","created_at":"2016-10-31T21:50:19Z","updated_at":"2016-10-31T23:26:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa26ecc826d121a12cb516edd4e171b85a932847","assignee":{"login":"rdhabalia","id":2898254,"avatar_url":"https://avatars.githubusercontent.com/u/2898254?v=3","gravatar_id":"","url":"https://api.github.com/users/rdhabalia","html_url":"https://github.com/rdhabalia","followers_url":"https://api.github.com/users/rdhabalia/followers","following_url":"https://api.github.com/users/rdhabalia/following{/other_user}","gists_url":"https://api.github.com/users/rdhabalia/gists{/gist_id}","starred_url":"https://api.github.com/users/rdhabalia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdhabalia/subscriptions","organizations_url":"https://api.github.com/users/rdhabalia/orgs","repos_url":"https://api.github.com/users/rdhabalia/repos","events_url":"https://api.github.com/users/rdhabalia/events{/privacy}","received_events_url":"https://api.github.com/users/rdhabalia/received_events","type":"User","site_admin":false},"assignees":[{"login":"rdhabalia","id":2898254,"avatar_url":"https://avatars.githubusercontent.com/u/2898254?v=3","gravatar_id":"","url":"https://api.github.com/users/rdhabalia","html_url":"https://github.com/rdhabalia","followers_url":"https://api.github.com/users/rdhabalia/followers","following_url":"https://api.github.com/users/rdhabalia/following{/other_user}","gists_url":"https://api.github.com/users/rdhabalia/gists{/gist_id}","starred_url":"https://api.github.com/users/rdhabalia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdhabalia/subscriptions","organizations_url":"https://api.github.com/users/rdhabalia/orgs","repos_url":"https://api.github.com/users/rdhabalia/repos","events_url":"https://api.github.com/users/rdhabalia/events{/privacy}","received_events_url":"https://api.github.com/users/rdhabalia/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/yahoo/pulsar/milestones/2","html_url":"https://github.com/yahoo/pulsar/milestones/1.16","labels_url":"https://api.github.com/repos/yahoo/pulsar/milestones/2/labels","id":2056012,"number":2,"title":"1.16","description":"","creator":{"login":"merlimat","id":62500,"avatar_url":"https://avatars.githubusercontent.com/u/62500?v=3","gravatar_id":"","url":"https://api.github.com/users/merlimat","html_url":"https://github.com/merlimat","followers_url":"https://api.github.com/users/merlimat/followers","following_url":"https://api.github.com/users/merlimat/following{/other_user}","gists_url":"https://api.github.com/users/merlimat/gists{/gist_id}","starred_url":"https://api.github.com/users/merlimat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merlimat/subscriptions","organizations_url":"https://api.github.com/users/merlimat/orgs","repos_url":"https://api.github.com/users/merlimat/repos","events_url":"https://api.github.com/users/merlimat/events{/privacy}","received_events_url":"https://api.github.com/users/merlimat/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":12,"state":"open","created_at":"2016-10-07T23:59:26Z","updated_at":"2016-10-31T23:08:23Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/yahoo/pulsar/pulls/98/commits","review_comments_url":"https://api.github.com/repos/yahoo/pulsar/pulls/98/comments","review_comment_url":"https://api.github.com/repos/yahoo/pulsar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yahoo/pulsar/issues/98/comments","statuses_url":"https://api.github.com/repos/yahoo/pulsar/statuses/9aa7b30256b144290c771e43f624854918b75bff","head":{"label":"rdhabalia:async_auth","ref":"async_auth","sha":"9aa7b30256b144290c771e43f624854918b75bff","user":{"login":"rdhabalia","id":2898254,"avatar_url":"https://avatars.githubusercontent.com/u/2898254?v=3","gravatar_id":"","url":"https://api.github.com/users/rdhabalia","html_url":"https://github.com/rdhabalia","followers_url":"https://api.github.com/users/rdhabalia/followers","following_url":"https://api.github.com/users/rdhabalia/following{/other_user}","gists_url":"https://api.github.com/users/rdhabalia/gists{/gist_id}","starred_url":"https://api.github.com/users/rdhabalia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdhabalia/subscriptions","organizations_url":"https://api.github.com/users/rdhabalia/orgs","repos_url":"https://api.github.com/users/rdhabalia/repos","events_url":"https://api.github.com/users/rdhabalia/events{/privacy}","received_events_url":"https://api.github.com/users/rdhabalia/received_events","type":"User","site_admin":false},"repo":{"id":67649596,"name":"pulsar","full_name":"rdhabalia/pulsar","owner":{"login":"rdhabalia","id":2898254,"avatar_url":"https://avatars.githubusercontent.com/u/2898254?v=3","gravatar_id":"","url":"https://api.github.com/users/rdhabalia","html_url":"https://github.com/rdhabalia","followers_url":"https://api.github.com/users/rdhabalia/followers","following_url":"https://api.github.com/users/rdhabalia/following{/other_user}","gists_url":"https://api.github.com/users/rdhabalia/gists{/gist_id}","starred_url":"https://api.github.com/users/rdhabalia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdhabalia/subscriptions","organizations_url":"https://api.github.com/users/rdhabalia/orgs","repos_url":"https://api.github.com/users/rdhabalia/repos","events_url":"https://api.github.com/users/rdhabalia/events{/privacy}","received_events_url":"https://api.github.com/users/rdhabalia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rdhabalia/pulsar","description":"Pulsar - distributed pub-sub messaging system","fork":true,"url":"https://api.github.com/repos/rdhabalia/pulsar","forks_url":"https://api.github.com/repos/rdhabalia/pulsar/forks","keys_url":"https://api.github.com/repos/rdhabalia/pulsar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rdhabalia/pulsar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rdhabalia/pulsar/teams","hooks_url":"https://api.github.com/repos/rdhabalia/pulsar/hooks","issue_events_url":"https://api.github.com/repos/rdhabalia/pulsar/issues/events{/number}","events_url":"https://api.github.com/repos/rdhabalia/pulsar/events","assignees_url":"https://api.github.com/repos/rdhabalia/pulsar/assignees{/user}","branches_url":"https://api.github.com/repos/rdhabalia/pulsar/branches{/branch}","tags_url":"https://api.github.com/repos/rdhabalia/pulsar/tags","blobs_url":"https://api.github.com/repos/rdhabalia/pulsar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rdhabalia/pulsar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rdhabalia/pulsar/git/refs{/sha}","trees_url":"https://api.github.com/repos/rdhabalia/pulsar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rdhabalia/pulsar/statuses/{sha}","languages_url":"https://api.github.com/repos/rdhabalia/pulsar/languages","stargazers_url":"https://api.github.com/repos/rdhabalia/pulsar/stargazers","contributors_url":"https://api.github.com/repos/rdhabalia/pulsar/contributors","subscribers_url":"https://api.github.com/repos/rdhabalia/pulsar/subscribers","subscription_url":"https://api.github.com/repos/rdhabalia/pulsar/subscription","commits_url":"https://api.github.com/repos/rdhabalia/pulsar/commits{/sha}","git_commits_url":"https://api.github.com/repos/rdhabalia/pulsar/git/commits{/sha}","comments_url":"https://api.github.com/repos/rdhabalia/pulsar/comments{/number}","issue_comment_url":"https://api.github.com/repos/rdhabalia/pulsar/issues/comments{/number}","contents_url":"https://api.github.com/repos/rdhabalia/pulsar/contents/{+path}","compare_url":"https://api.github.com/repos/rdhabalia/pulsar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rdhabalia/pulsar/merges","archive_url":"https://api.github.com/repos/rdhabalia/pulsar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rdhabalia/pulsar/downloads","issues_url":"https://api.github.com/repos/rdhabalia/pulsar/issues{/number}","pulls_url":"https://api.github.com/repos/rdhabalia/pulsar/pulls{/number}","milestones_url":"https://api.github.com/repos/rdhabalia/pulsar/milestones{/number}","notifications_url":"https://api.github.com/repos/rdhabalia/pulsar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rdhabalia/pulsar/labels{/name}","releases_url":"https://api.github.com/repos/rdhabalia/pulsar/releases{/id}","deployments_url":"https://api.github.com/repos/rdhabalia/pulsar/deployments","created_at":"2016-09-07T22:57:02Z","updated_at":"2016-09-07T22:57:05Z","pushed_at":"2016-10-31T21:41:10Z","git_url":"git://github.com/rdhabalia/pulsar.git","ssh_url":"git@github.com:rdhabalia/pulsar.git","clone_url":"https://github.com/rdhabalia/pulsar.git","svn_url":"https://github.com/rdhabalia/pulsar","homepage":"","size":1939,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"yahoo:master","ref":"master","sha":"340dc8d170ee5ecea8c4623cfbbbc7aaef999b38","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":62117812,"name":"pulsar","full_name":"yahoo/pulsar","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/pulsar","description":"Pulsar - distributed pub-sub messaging system","fork":false,"url":"https://api.github.com/repos/yahoo/pulsar","forks_url":"https://api.github.com/repos/yahoo/pulsar/forks","keys_url":"https://api.github.com/repos/yahoo/pulsar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/pulsar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/pulsar/teams","hooks_url":"https://api.github.com/repos/yahoo/pulsar/hooks","issue_events_url":"https://api.github.com/repos/yahoo/pulsar/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/pulsar/events","assignees_url":"https://api.github.com/repos/yahoo/pulsar/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/pulsar/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/pulsar/tags","blobs_url":"https://api.github.com/repos/yahoo/pulsar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/pulsar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/pulsar/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/pulsar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/pulsar/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/pulsar/languages","stargazers_url":"https://api.github.com/repos/yahoo/pulsar/stargazers","contributors_url":"https://api.github.com/repos/yahoo/pulsar/contributors","subscribers_url":"https://api.github.com/repos/yahoo/pulsar/subscribers","subscription_url":"https://api.github.com/repos/yahoo/pulsar/subscription","commits_url":"https://api.github.com/repos/yahoo/pulsar/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/pulsar/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/pulsar/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/pulsar/issues/comments{/number}","contents_url":"https://api.github.com/repos/yahoo/pulsar/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/pulsar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/pulsar/merges","archive_url":"https://api.github.com/repos/yahoo/pulsar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/pulsar/downloads","issues_url":"https://api.github.com/repos/yahoo/pulsar/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/pulsar/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/pulsar/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/pulsar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/pulsar/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/pulsar/releases{/id}","deployments_url":"https://api.github.com/repos/yahoo/pulsar/deployments","created_at":"2016-06-28T07:00:03Z","updated_at":"2016-10-31T17:49:38Z","pushed_at":"2016-10-31T21:50:19Z","git_url":"git://github.com/yahoo/pulsar.git","ssh_url":"git@github.com:yahoo/pulsar.git","clone_url":"https://github.com/yahoo/pulsar.git","svn_url":"https://github.com/yahoo/pulsar","homepage":"","size":1967,"stargazers_count":1037,"watchers_count":1037,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":199,"mirror_url":null,"open_issues_count":17,"forks":199,"open_issues":17,"watchers":1037,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/98"},"html":{"href":"https://github.com/yahoo/pulsar/pull/98"},"issue":{"href":"https://api.github.com/repos/yahoo/pulsar/issues/98"},"comments":{"href":"https://api.github.com/repos/yahoo/pulsar/issues/98/comments"},"review_comments":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/98/comments"},"review_comment":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/98/commits"},"statuses":{"href":"https://api.github.com/repos/yahoo/pulsar/statuses/9aa7b30256b144290c771e43f624854918b75bff"}}}}
{"actor":{"display_login":"merlimat"}}