{"action":"created","comment":{"url":"https://api.github.com/repos/vitessio/vitess/pulls/comments/237748433","pull_request_review_id":180123956,"id":237748433,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNzc0ODQzMw==","diff_hunk":"@@ -0,0 +1,57 @@\n+package io.client.grpc;\n+\n+import io.vitess.client.Context;\n+import io.vitess.client.RpcClientTest;\n+import io.vitess.client.grpc.GrpcClientFactory;\n+import io.vitess.client.grpc.StaticAuthCredentials;\n+import java.net.ServerSocket;\n+import java.net.URI;\n+import java.util.Arrays;\n+import org.joda.time.Duration;\n+import org.junit.AfterClass;\n+import org.junit.BeforeClass;\n+import org.junit.runner.RunWith;\n+import org.junit.runners.JUnit4;\n+\n+@RunWith(JUnit4.class)\n+public class GrpcClientStaticAuthTest extends RpcClientTest {\n+  private static Process vtgateclienttest;\n+\n+  @BeforeClass\n+  public static void setUpBeforeClass() throws Exception {\n+    String vtRoot = System.getenv(\"VTROOT\");\n+    if (vtRoot == null) {\n+      throw new RuntimeException(\"cannot find env variable VTROOT; make sure to source dev.env\");\n+    }\n+    URI staticAuthFile = GrpcClientStaticAuthTest.class.getResource(\"grpc_static_auth.json\").toURI();\n+\n+    ServerSocket socket = new ServerSocket(0);\n+    int port = socket.getLocalPort();\n+    socket.close();\n+\n+    vtgateclienttest = new ProcessBuilder(Arrays.asList(\n+        vtRoot + \"/bin/vtgateclienttest\",\n+        \"-logtostderr\",\n+        \"-grpc_port\", Integer.toString(port),\n+        \"-service_map\", \"grpc-vtgateservice\",\n+        \"-grpc_auth_mode\", \"static\",\n+        \"-grpc_auth_static_password_file\", staticAuthFile.getPath()\n+    )).inheritIO().start();\n+\n+    Context ctx = Context.getDefault().withDeadlineAfter(Duration.millis(5000L));\n+    client = new GrpcClientFactory()\n+        .setCallCredentials(new StaticAuthCredentials(\"test-username\", \"test-password\"))\n+        .create(ctx, \"localhost:\" + port);","path":"java/grpc-client/src/test/java/io/client/grpc/GrpcClientStaticAuthTest.java","position":53,"original_position":44,"commit_id":"683819501761aad2372698d6bff2c2b9fc26d9f9","original_commit_id":"ebd0271983cbcbaf5dc47224ca8b910662828c62","user":{"login":"ys8","id":167241,"node_id":"MDQ6VXNlcjE2NzI0MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/167241?v=4","gravatar_id":"","url":"https://api.github.com/users/ys8","html_url":"https://github.com/ys8","followers_url":"https://api.github.com/users/ys8/followers","following_url":"https://api.github.com/users/ys8/following{/other_user}","gists_url":"https://api.github.com/users/ys8/gists{/gist_id}","starred_url":"https://api.github.com/users/ys8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ys8/subscriptions","organizations_url":"https://api.github.com/users/ys8/orgs","repos_url":"https://api.github.com/users/ys8/repos","events_url":"https://api.github.com/users/ys8/events{/privacy}","received_events_url":"https://api.github.com/users/ys8/received_events","type":"User","site_admin":false},"body":"👍 added `testWrongPassword` case","created_at":"2018-11-30T05:13:51Z","updated_at":"2018-11-30T05:13:51Z","html_url":"https://github.com/vitessio/vitess/pull/4406#discussion_r237748433","pull_request_url":"https://api.github.com/repos/vitessio/vitess/pulls/4406","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/vitessio/vitess/pulls/comments/237748433"},"html":{"href":"https://github.com/vitessio/vitess/pull/4406#discussion_r237748433"},"pull_request":{"href":"https://api.github.com/repos/vitessio/vitess/pulls/4406"}},"in_reply_to_id":237744739},"pull_request":{"url":"https://api.github.com/repos/vitessio/vitess/pulls/4406","id":234844473,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0ODQ0NDcz","html_url":"https://github.com/vitessio/vitess/pull/4406","diff_url":"https://github.com/vitessio/vitess/pull/4406.diff","patch_url":"https://github.com/vitessio/vitess/pull/4406.patch","issue_url":"https://api.github.com/repos/vitessio/vitess/issues/4406","number":4406,"state":"open","locked":false,"title":"Support username/password GRPC auth","user":{"login":"ys8","id":167241,"node_id":"MDQ6VXNlcjE2NzI0MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/167241?v=4","gravatar_id":"","url":"https://api.github.com/users/ys8","html_url":"https://github.com/ys8","followers_url":"https://api.github.com/users/ys8/followers","following_url":"https://api.github.com/users/ys8/following{/other_user}","gists_url":"https://api.github.com/users/ys8/gists{/gist_id}","starred_url":"https://api.github.com/users/ys8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ys8/subscriptions","organizations_url":"https://api.github.com/users/ys8/orgs","repos_url":"https://api.github.com/users/ys8/repos","events_url":"https://api.github.com/users/ys8/events{/privacy}","received_events_url":"https://api.github.com/users/ys8/received_events","type":"User","site_admin":false},"body":"Fixes #4366\r\n\r\n- Modified GrpcClientFactory to allow setting a custom CallCredentials to GrpcClient.\r\n- Added StaticAuthCredentials class that implements CallCredentials to support plain username/password.\r\n\r\nSigned-off-by: Yuichi Sasaki <ysasaki@astro.ai>","created_at":"2018-11-30T01:39:46Z","updated_at":"2018-11-30T05:13:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d61445e73fd5258451a567cb3a53eaf9b19d6635","assignee":null,"assignees":[],"requested_reviewers":[{"login":"sougou","id":589370,"node_id":"MDQ6VXNlcjU4OTM3MA==","avatar_url":"https://avatars1.githubusercontent.com/u/589370?v=4","gravatar_id":"","url":"https://api.github.com/users/sougou","html_url":"https://github.com/sougou","followers_url":"https://api.github.com/users/sougou/followers","following_url":"https://api.github.com/users/sougou/following{/other_user}","gists_url":"https://api.github.com/users/sougou/gists{/gist_id}","starred_url":"https://api.github.com/users/sougou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sougou/subscriptions","organizations_url":"https://api.github.com/users/sougou/orgs","repos_url":"https://api.github.com/users/sougou/repos","events_url":"https://api.github.com/users/sougou/events{/privacy}","received_events_url":"https://api.github.com/users/sougou/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/vitessio/vitess/pulls/4406/commits","review_comments_url":"https://api.github.com/repos/vitessio/vitess/pulls/4406/comments","review_comment_url":"https://api.github.com/repos/vitessio/vitess/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vitessio/vitess/issues/4406/comments","statuses_url":"https://api.github.com/repos/vitessio/vitess/statuses/683819501761aad2372698d6bff2c2b9fc26d9f9","head":{"label":"tinyspeck:grpc-static-auth","ref":"grpc-static-auth","sha":"683819501761aad2372698d6bff2c2b9fc26d9f9","user":{"login":"tinyspeck","id":371467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MTQ2Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/371467?v=4","gravatar_id":"","url":"https://api.github.com/users/tinyspeck","html_url":"https://github.com/tinyspeck","followers_url":"https://api.github.com/users/tinyspeck/followers","following_url":"https://api.github.com/users/tinyspeck/following{/other_user}","gists_url":"https://api.github.com/users/tinyspeck/gists{/gist_id}","starred_url":"https://api.github.com/users/tinyspeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinyspeck/subscriptions","organizations_url":"https://api.github.com/users/tinyspeck/orgs","repos_url":"https://api.github.com/users/tinyspeck/repos","events_url":"https://api.github.com/users/tinyspeck/events{/privacy}","received_events_url":"https://api.github.com/users/tinyspeck/received_events","type":"Organization","site_admin":false},"repo":{"id":79269846,"node_id":"MDEwOlJlcG9zaXRvcnk3OTI2OTg0Ng==","name":"vitess","full_name":"tinyspeck/vitess","private":false,"owner":{"login":"tinyspeck","id":371467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MTQ2Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/371467?v=4","gravatar_id":"","url":"https://api.github.com/users/tinyspeck","html_url":"https://github.com/tinyspeck","followers_url":"https://api.github.com/users/tinyspeck/followers","following_url":"https://api.github.com/users/tinyspeck/following{/other_user}","gists_url":"https://api.github.com/users/tinyspeck/gists{/gist_id}","starred_url":"https://api.github.com/users/tinyspeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinyspeck/subscriptions","organizations_url":"https://api.github.com/users/tinyspeck/orgs","repos_url":"https://api.github.com/users/tinyspeck/repos","events_url":"https://api.github.com/users/tinyspeck/events{/privacy}","received_events_url":"https://api.github.com/users/tinyspeck/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/tinyspeck/vitess","description":"Vitess is a database clustering system for horizontal scaling of MySQL.","fork":true,"url":"https://api.github.com/repos/tinyspeck/vitess","forks_url":"https://api.github.com/repos/tinyspeck/vitess/forks","keys_url":"https://api.github.com/repos/tinyspeck/vitess/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tinyspeck/vitess/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tinyspeck/vitess/teams","hooks_url":"https://api.github.com/repos/tinyspeck/vitess/hooks","issue_events_url":"https://api.github.com/repos/tinyspeck/vitess/issues/events{/number}","events_url":"https://api.github.com/repos/tinyspeck/vitess/events","assignees_url":"https://api.github.com/repos/tinyspeck/vitess/assignees{/user}","branches_url":"https://api.github.com/repos/tinyspeck/vitess/branches{/branch}","tags_url":"https://api.github.com/repos/tinyspeck/vitess/tags","blobs_url":"https://api.github.com/repos/tinyspeck/vitess/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tinyspeck/vitess/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tinyspeck/vitess/git/refs{/sha}","trees_url":"https://api.github.com/repos/tinyspeck/vitess/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tinyspeck/vitess/statuses/{sha}","languages_url":"https://api.github.com/repos/tinyspeck/vitess/languages","stargazers_url":"https://api.github.com/repos/tinyspeck/vitess/stargazers","contributors_url":"https://api.github.com/repos/tinyspeck/vitess/contributors","subscribers_url":"https://api.github.com/repos/tinyspeck/vitess/subscribers","subscription_url":"https://api.github.com/repos/tinyspeck/vitess/subscription","commits_url":"https://api.github.com/repos/tinyspeck/vitess/commits{/sha}","git_commits_url":"https://api.github.com/repos/tinyspeck/vitess/git/commits{/sha}","comments_url":"https://api.github.com/repos/tinyspeck/vitess/comments{/number}","issue_comment_url":"https://api.github.com/repos/tinyspeck/vitess/issues/comments{/number}","contents_url":"https://api.github.com/repos/tinyspeck/vitess/contents/{+path}","compare_url":"https://api.github.com/repos/tinyspeck/vitess/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tinyspeck/vitess/merges","archive_url":"https://api.github.com/repos/tinyspeck/vitess/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tinyspeck/vitess/downloads","issues_url":"https://api.github.com/repos/tinyspeck/vitess/issues{/number}","pulls_url":"https://api.github.com/repos/tinyspeck/vitess/pulls{/number}","milestones_url":"https://api.github.com/repos/tinyspeck/vitess/milestones{/number}","notifications_url":"https://api.github.com/repos/tinyspeck/vitess/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tinyspeck/vitess/labels{/name}","releases_url":"https://api.github.com/repos/tinyspeck/vitess/releases{/id}","deployments_url":"https://api.github.com/repos/tinyspeck/vitess/deployments","created_at":"2017-01-17T20:41:49Z","updated_at":"2018-10-30T16:01:08Z","pushed_at":"2018-11-30T05:05:35Z","git_url":"git://github.com/tinyspeck/vitess.git","ssh_url":"git@github.com:tinyspeck/vitess.git","clone_url":"https://github.com/tinyspeck/vitess.git","svn_url":"https://github.com/tinyspeck/vitess","homepage":"http://vitess.io","size":100673,"stargazers_count":0,"watchers_count":0,"language":"Go","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":3,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"vitessio:master","ref":"master","sha":"66a73bf9df516463eb54918b44ebc923210b3b29","user":{"login":"vitessio","id":33043890,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMDQzODkw","avatar_url":"https://avatars1.githubusercontent.com/u/33043890?v=4","gravatar_id":"","url":"https://api.github.com/users/vitessio","html_url":"https://github.com/vitessio","followers_url":"https://api.github.com/users/vitessio/followers","following_url":"https://api.github.com/users/vitessio/following{/other_user}","gists_url":"https://api.github.com/users/vitessio/gists{/gist_id}","starred_url":"https://api.github.com/users/vitessio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitessio/subscriptions","organizations_url":"https://api.github.com/users/vitessio/orgs","repos_url":"https://api.github.com/users/vitessio/repos","events_url":"https://api.github.com/users/vitessio/events{/privacy}","received_events_url":"https://api.github.com/users/vitessio/received_events","type":"Organization","site_admin":false},"repo":{"id":11008207,"node_id":"MDEwOlJlcG9zaXRvcnkxMTAwODIwNw==","name":"vitess","full_name":"vitessio/vitess","private":false,"owner":{"login":"vitessio","id":33043890,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMDQzODkw","avatar_url":"https://avatars1.githubusercontent.com/u/33043890?v=4","gravatar_id":"","url":"https://api.github.com/users/vitessio","html_url":"https://github.com/vitessio","followers_url":"https://api.github.com/users/vitessio/followers","following_url":"https://api.github.com/users/vitessio/following{/other_user}","gists_url":"https://api.github.com/users/vitessio/gists{/gist_id}","starred_url":"https://api.github.com/users/vitessio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitessio/subscriptions","organizations_url":"https://api.github.com/users/vitessio/orgs","repos_url":"https://api.github.com/users/vitessio/repos","events_url":"https://api.github.com/users/vitessio/events{/privacy}","received_events_url":"https://api.github.com/users/vitessio/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/vitessio/vitess","description":"Vitess is a database clustering system for horizontal scaling of MySQL.","fork":false,"url":"https://api.github.com/repos/vitessio/vitess","forks_url":"https://api.github.com/repos/vitessio/vitess/forks","keys_url":"https://api.github.com/repos/vitessio/vitess/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vitessio/vitess/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vitessio/vitess/teams","hooks_url":"https://api.github.com/repos/vitessio/vitess/hooks","issue_events_url":"https://api.github.com/repos/vitessio/vitess/issues/events{/number}","events_url":"https://api.github.com/repos/vitessio/vitess/events","assignees_url":"https://api.github.com/repos/vitessio/vitess/assignees{/user}","branches_url":"https://api.github.com/repos/vitessio/vitess/branches{/branch}","tags_url":"https://api.github.com/repos/vitessio/vitess/tags","blobs_url":"https://api.github.com/repos/vitessio/vitess/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vitessio/vitess/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vitessio/vitess/git/refs{/sha}","trees_url":"https://api.github.com/repos/vitessio/vitess/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vitessio/vitess/statuses/{sha}","languages_url":"https://api.github.com/repos/vitessio/vitess/languages","stargazers_url":"https://api.github.com/repos/vitessio/vitess/stargazers","contributors_url":"https://api.github.com/repos/vitessio/vitess/contributors","subscribers_url":"https://api.github.com/repos/vitessio/vitess/subscribers","subscription_url":"https://api.github.com/repos/vitessio/vitess/subscription","commits_url":"https://api.github.com/repos/vitessio/vitess/commits{/sha}","git_commits_url":"https://api.github.com/repos/vitessio/vitess/git/commits{/sha}","comments_url":"https://api.github.com/repos/vitessio/vitess/comments{/number}","issue_comment_url":"https://api.github.com/repos/vitessio/vitess/issues/comments{/number}","contents_url":"https://api.github.com/repos/vitessio/vitess/contents/{+path}","compare_url":"https://api.github.com/repos/vitessio/vitess/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vitessio/vitess/merges","archive_url":"https://api.github.com/repos/vitessio/vitess/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vitessio/vitess/downloads","issues_url":"https://api.github.com/repos/vitessio/vitess/issues{/number}","pulls_url":"https://api.github.com/repos/vitessio/vitess/pulls{/number}","milestones_url":"https://api.github.com/repos/vitessio/vitess/milestones{/number}","notifications_url":"https://api.github.com/repos/vitessio/vitess/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vitessio/vitess/labels{/name}","releases_url":"https://api.github.com/repos/vitessio/vitess/releases{/id}","deployments_url":"https://api.github.com/repos/vitessio/vitess/deployments","created_at":"2013-06-27T21:20:28Z","updated_at":"2018-11-30T05:07:22Z","pushed_at":"2018-11-30T05:05:36Z","git_url":"git://github.com/vitessio/vitess.git","ssh_url":"git@github.com:vitessio/vitess.git","clone_url":"https://github.com/vitessio/vitess.git","svn_url":"https://github.com/vitessio/vitess","homepage":"http://vitess.io","size":100690,"stargazers_count":6959,"watchers_count":6959,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":909,"mirror_url":null,"archived":false,"open_issues_count":240,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":909,"open_issues":240,"watchers":6959,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vitessio/vitess/pulls/4406"},"html":{"href":"https://github.com/vitessio/vitess/pull/4406"},"issue":{"href":"https://api.github.com/repos/vitessio/vitess/issues/4406"},"comments":{"href":"https://api.github.com/repos/vitessio/vitess/issues/4406/comments"},"review_comments":{"href":"https://api.github.com/repos/vitessio/vitess/pulls/4406/comments"},"review_comment":{"href":"https://api.github.com/repos/vitessio/vitess/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vitessio/vitess/pulls/4406/commits"},"statuses":{"href":"https://api.github.com/repos/vitessio/vitess/statuses/683819501761aad2372698d6bff2c2b9fc26d9f9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ys8"}}