{"action":"created","comment":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/comments/35512106","id":35512106,"diff_hunk":"@@ -144,4 +148,40 @@ private void throwIfNotComplete() {\n       throw new IllegalStateException(\"PLAIN authentication not completed\");\n     }\n   }\n+\n+  public static final class PlainServerCallbackHandler implements CallbackHandler {\n+    private final AuthenticationMethod mAuthMethod;\n+\n+    public PlainServerCallbackHandler(String authMethodStr) {\n+      mAuthMethod = AuthenticationMethod.getValidAuthenticationMethod(authMethodStr);\n+    }\n+\n+    @Override\n+    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {\n+      String username = null;\n+      String password = null;\n+      AuthorizeCallback ac = null;\n+\n+      for (Callback callback : callbacks) {\n+        if (callback instanceof NameCallback) {\n+          NameCallback nc = (NameCallback) callback;\n+          username = nc.getName();\n+        } else if (callback instanceof PasswordCallback) {\n+          PasswordCallback pc = (PasswordCallback) callback;\n+          password = new String(pc.getPassword());\n+        } else if (callback instanceof AuthorizeCallback) {\n+          ac = (AuthorizeCallback) callback;\n+        } else {\n+          throw new UnsupportedCallbackException(callback);\n+        }\n+      }\n+","path":"common/src/main/java/tachyon/security/PlainSaslServer.java","position":42,"original_position":42,"commit_id":"da411ec8ba988263e5613c346565d04e87b4a88d","original_commit_id":"da411ec8ba988263e5613c346565d04e87b4a88d","user":{"login":"shenguoquan","id":6701903,"avatar_url":"https://avatars.githubusercontent.com/u/6701903?v=3","gravatar_id":"","url":"https://api.github.com/users/shenguoquan","html_url":"https://github.com/shenguoquan","followers_url":"https://api.github.com/users/shenguoquan/followers","following_url":"https://api.github.com/users/shenguoquan/following{/other_user}","gists_url":"https://api.github.com/users/shenguoquan/gists{/gist_id}","starred_url":"https://api.github.com/users/shenguoquan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shenguoquan/subscriptions","organizations_url":"https://api.github.com/users/shenguoquan/orgs","repos_url":"https://api.github.com/users/shenguoquan/repos","events_url":"https://api.github.com/users/shenguoquan/events{/privacy}","received_events_url":"https://api.github.com/users/shenguoquan/received_events","type":"User","site_admin":false},"body":"Hi @apc999 , Do you think the username, password should be check there. I want to postpone this check to the authenticationProvider.","created_at":"2015-07-27T07:52:02Z","updated_at":"2015-07-27T07:52:02Z","html_url":"https://github.com/amplab/tachyon/pull/1176#discussion_r35512106","pull_request_url":"https://api.github.com/repos/amplab/tachyon/pulls/1176","_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments/35512106"},"html":{"href":"https://github.com/amplab/tachyon/pull/1176#discussion_r35512106"},"pull_request":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/1176"}}},"pull_request":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/1176","id":40744983,"html_url":"https://github.com/amplab/tachyon/pull/1176","diff_url":"https://github.com/amplab/tachyon/pull/1176.diff","patch_url":"https://github.com/amplab/tachyon/pull/1176.patch","issue_url":"https://api.github.com/repos/amplab/tachyon/issues/1176","number":1176,"state":"open","locked":false,"title":"[TACHYON-696] Add AuthenticationProvider to authenticate the connected user","user":{"login":"shenguoquan","id":6701903,"avatar_url":"https://avatars.githubusercontent.com/u/6701903?v=3","gravatar_id":"","url":"https://api.github.com/users/shenguoquan","html_url":"https://github.com/shenguoquan","followers_url":"https://api.github.com/users/shenguoquan/followers","following_url":"https://api.github.com/users/shenguoquan/following{/other_user}","gists_url":"https://api.github.com/users/shenguoquan/gists{/gist_id}","starred_url":"https://api.github.com/users/shenguoquan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shenguoquan/subscriptions","organizations_url":"https://api.github.com/users/shenguoquan/orgs","repos_url":"https://api.github.com/users/shenguoquan/repos","events_url":"https://api.github.com/users/shenguoquan/events{/privacy}","received_events_url":"https://api.github.com/users/shenguoquan/received_events","type":"User","site_admin":false},"body":"https://tachyon.atlassian.net/browse/TACHYON-696\r\nThe PlainSaslServer receives the connected user information from client side. The Server calls the callbackHandler to process the user information. The instance implemented AuthenticationProvider will be instatiated and verified the connected user. This AuthenticationProvider\r\ncan use to disallow some users connect this Sasl server.","created_at":"2015-07-24T05:59:41Z","updated_at":"2015-07-27T07:52:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93dee03d1119284924ce5838eb83513ccd138bec","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/amplab/tachyon/pulls/1176/commits","review_comments_url":"https://api.github.com/repos/amplab/tachyon/pulls/1176/comments","review_comment_url":"https://api.github.com/repos/amplab/tachyon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amplab/tachyon/issues/1176/comments","statuses_url":"https://api.github.com/repos/amplab/tachyon/statuses/da411ec8ba988263e5613c346565d04e87b4a88d","head":{"label":"shenguoquan:TACHYON-696","ref":"TACHYON-696","sha":"da411ec8ba988263e5613c346565d04e87b4a88d","user":{"login":"shenguoquan","id":6701903,"avatar_url":"https://avatars.githubusercontent.com/u/6701903?v=3","gravatar_id":"","url":"https://api.github.com/users/shenguoquan","html_url":"https://github.com/shenguoquan","followers_url":"https://api.github.com/users/shenguoquan/followers","following_url":"https://api.github.com/users/shenguoquan/following{/other_user}","gists_url":"https://api.github.com/users/shenguoquan/gists{/gist_id}","starred_url":"https://api.github.com/users/shenguoquan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shenguoquan/subscriptions","organizations_url":"https://api.github.com/users/shenguoquan/orgs","repos_url":"https://api.github.com/users/shenguoquan/repos","events_url":"https://api.github.com/users/shenguoquan/events{/privacy}","received_events_url":"https://api.github.com/users/shenguoquan/received_events","type":"User","site_admin":false},"repo":{"id":32506158,"name":"tachyon","full_name":"shenguoquan/tachyon","owner":{"login":"shenguoquan","id":6701903,"avatar_url":"https://avatars.githubusercontent.com/u/6701903?v=3","gravatar_id":"","url":"https://api.github.com/users/shenguoquan","html_url":"https://github.com/shenguoquan","followers_url":"https://api.github.com/users/shenguoquan/followers","following_url":"https://api.github.com/users/shenguoquan/following{/other_user}","gists_url":"https://api.github.com/users/shenguoquan/gists{/gist_id}","starred_url":"https://api.github.com/users/shenguoquan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shenguoquan/subscriptions","organizations_url":"https://api.github.com/users/shenguoquan/orgs","repos_url":"https://api.github.com/users/shenguoquan/repos","events_url":"https://api.github.com/users/shenguoquan/events{/privacy}","received_events_url":"https://api.github.com/users/shenguoquan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shenguoquan/tachyon","description":" A Reliable Memory Centric Distributed Storage System","fork":true,"url":"https://api.github.com/repos/shenguoquan/tachyon","forks_url":"https://api.github.com/repos/shenguoquan/tachyon/forks","keys_url":"https://api.github.com/repos/shenguoquan/tachyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shenguoquan/tachyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shenguoquan/tachyon/teams","hooks_url":"https://api.github.com/repos/shenguoquan/tachyon/hooks","issue_events_url":"https://api.github.com/repos/shenguoquan/tachyon/issues/events{/number}","events_url":"https://api.github.com/repos/shenguoquan/tachyon/events","assignees_url":"https://api.github.com/repos/shenguoquan/tachyon/assignees{/user}","branches_url":"https://api.github.com/repos/shenguoquan/tachyon/branches{/branch}","tags_url":"https://api.github.com/repos/shenguoquan/tachyon/tags","blobs_url":"https://api.github.com/repos/shenguoquan/tachyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shenguoquan/tachyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shenguoquan/tachyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/shenguoquan/tachyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shenguoquan/tachyon/statuses/{sha}","languages_url":"https://api.github.com/repos/shenguoquan/tachyon/languages","stargazers_url":"https://api.github.com/repos/shenguoquan/tachyon/stargazers","contributors_url":"https://api.github.com/repos/shenguoquan/tachyon/contributors","subscribers_url":"https://api.github.com/repos/shenguoquan/tachyon/subscribers","subscription_url":"https://api.github.com/repos/shenguoquan/tachyon/subscription","commits_url":"https://api.github.com/repos/shenguoquan/tachyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/shenguoquan/tachyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/shenguoquan/tachyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/shenguoquan/tachyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/shenguoquan/tachyon/contents/{+path}","compare_url":"https://api.github.com/repos/shenguoquan/tachyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shenguoquan/tachyon/merges","archive_url":"https://api.github.com/repos/shenguoquan/tachyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shenguoquan/tachyon/downloads","issues_url":"https://api.github.com/repos/shenguoquan/tachyon/issues{/number}","pulls_url":"https://api.github.com/repos/shenguoquan/tachyon/pulls{/number}","milestones_url":"https://api.github.com/repos/shenguoquan/tachyon/milestones{/number}","notifications_url":"https://api.github.com/repos/shenguoquan/tachyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shenguoquan/tachyon/labels{/name}","releases_url":"https://api.github.com/repos/shenguoquan/tachyon/releases{/id}","created_at":"2015-03-19T07:06:25Z","updated_at":"2015-03-19T07:06:28Z","pushed_at":"2015-07-27T03:12:36Z","git_url":"git://github.com/shenguoquan/tachyon.git","ssh_url":"git@github.com:shenguoquan/tachyon.git","clone_url":"https://github.com/shenguoquan/tachyon.git","svn_url":"https://github.com/shenguoquan/tachyon","homepage":"http://tachyon-project.org","size":15440,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"amplab:security","ref":"security","sha":"78cbacf373eb3ea4b9132c4d74c097a17dc78c21","user":{"login":"amplab","id":1438454,"avatar_url":"https://avatars.githubusercontent.com/u/1438454?v=3","gravatar_id":"","url":"https://api.github.com/users/amplab","html_url":"https://github.com/amplab","followers_url":"https://api.github.com/users/amplab/followers","following_url":"https://api.github.com/users/amplab/following{/other_user}","gists_url":"https://api.github.com/users/amplab/gists{/gist_id}","starred_url":"https://api.github.com/users/amplab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplab/subscriptions","organizations_url":"https://api.github.com/users/amplab/orgs","repos_url":"https://api.github.com/users/amplab/repos","events_url":"https://api.github.com/users/amplab/events{/privacy}","received_events_url":"https://api.github.com/users/amplab/received_events","type":"Organization","site_admin":false},"repo":{"id":7276954,"name":"tachyon","full_name":"amplab/tachyon","owner":{"login":"amplab","id":1438454,"avatar_url":"https://avatars.githubusercontent.com/u/1438454?v=3","gravatar_id":"","url":"https://api.github.com/users/amplab","html_url":"https://github.com/amplab","followers_url":"https://api.github.com/users/amplab/followers","following_url":"https://api.github.com/users/amplab/following{/other_user}","gists_url":"https://api.github.com/users/amplab/gists{/gist_id}","starred_url":"https://api.github.com/users/amplab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplab/subscriptions","organizations_url":"https://api.github.com/users/amplab/orgs","repos_url":"https://api.github.com/users/amplab/repos","events_url":"https://api.github.com/users/amplab/events{/privacy}","received_events_url":"https://api.github.com/users/amplab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amplab/tachyon","description":" A Reliable Memory Centric Distributed Storage System","fork":false,"url":"https://api.github.com/repos/amplab/tachyon","forks_url":"https://api.github.com/repos/amplab/tachyon/forks","keys_url":"https://api.github.com/repos/amplab/tachyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amplab/tachyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amplab/tachyon/teams","hooks_url":"https://api.github.com/repos/amplab/tachyon/hooks","issue_events_url":"https://api.github.com/repos/amplab/tachyon/issues/events{/number}","events_url":"https://api.github.com/repos/amplab/tachyon/events","assignees_url":"https://api.github.com/repos/amplab/tachyon/assignees{/user}","branches_url":"https://api.github.com/repos/amplab/tachyon/branches{/branch}","tags_url":"https://api.github.com/repos/amplab/tachyon/tags","blobs_url":"https://api.github.com/repos/amplab/tachyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amplab/tachyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amplab/tachyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/amplab/tachyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amplab/tachyon/statuses/{sha}","languages_url":"https://api.github.com/repos/amplab/tachyon/languages","stargazers_url":"https://api.github.com/repos/amplab/tachyon/stargazers","contributors_url":"https://api.github.com/repos/amplab/tachyon/contributors","subscribers_url":"https://api.github.com/repos/amplab/tachyon/subscribers","subscription_url":"https://api.github.com/repos/amplab/tachyon/subscription","commits_url":"https://api.github.com/repos/amplab/tachyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/amplab/tachyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/amplab/tachyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/amplab/tachyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/amplab/tachyon/contents/{+path}","compare_url":"https://api.github.com/repos/amplab/tachyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amplab/tachyon/merges","archive_url":"https://api.github.com/repos/amplab/tachyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amplab/tachyon/downloads","issues_url":"https://api.github.com/repos/amplab/tachyon/issues{/number}","pulls_url":"https://api.github.com/repos/amplab/tachyon/pulls{/number}","milestones_url":"https://api.github.com/repos/amplab/tachyon/milestones{/number}","notifications_url":"https://api.github.com/repos/amplab/tachyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amplab/tachyon/labels{/name}","releases_url":"https://api.github.com/repos/amplab/tachyon/releases{/id}","created_at":"2012-12-21T17:43:46Z","updated_at":"2015-07-26T11:07:30Z","pushed_at":"2015-07-27T03:12:36Z","git_url":"git://github.com/amplab/tachyon.git","ssh_url":"git@github.com:amplab/tachyon.git","clone_url":"https://github.com/amplab/tachyon.git","svn_url":"https://github.com/amplab/tachyon","homepage":"http://tachyon-project.org","size":37740,"stargazers_count":1481,"watchers_count":1481,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":567,"mirror_url":null,"open_issues_count":17,"forks":567,"open_issues":17,"watchers":1481,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/1176"},"html":{"href":"https://github.com/amplab/tachyon/pull/1176"},"issue":{"href":"https://api.github.com/repos/amplab/tachyon/issues/1176"},"comments":{"href":"https://api.github.com/repos/amplab/tachyon/issues/1176/comments"},"review_comments":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/1176/comments"},"review_comment":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/1176/commits"},"statuses":{"href":"https://api.github.com/repos/amplab/tachyon/statuses/da411ec8ba988263e5613c346565d04e87b4a88d"}}}}