{"action":"created","comment":{"url":"https://api.github.com/repos/coreos/etcd/pulls/comments/91358182","pull_request_review_id":11867153,"id":91358182,"diff_hunk":"@@ -454,3 +459,95 @@ func authTestPrefixPerm(cx ctlCtx) {\n \t\tcx.t.Fatal(err)\n \t}\n }\n+\n+func authTestMemberAdd(cx ctlCtx) {\n+\tif err := authEnable(cx); err != nil {\n+\t\tcx.t.Fatal(err)\n+\t}\n+\n+\tcx.user, cx.pass = \"root\", \"root\"\n+\tauthSetupTestUser(cx)\n+\n+\t// ordinal user cannot add a new member\n+\tcx.user, cx.pass = \"test-user\", \"pass\"\n+\tpeerURL := fmt.Sprintf(\"http://localhost:%d\", etcdProcessBasePort+11)\n+\tcmdArgs := append(cx.PrefixArgs(), \"member\", \"add\", \"newmember\", fmt.Sprintf(\"--peer-urls=%s\", peerURL))\n+\tif err := spawnWithExpect(cmdArgs, \"Error:  etcdserver: permission denied\"); err != nil {\n+\t\tcx.t.Fatal(err)\n+\t}\n+\n+\t// root can add a new member\n+\tcx.user, cx.pass = \"root\", \"root\"\n+\tcmdArgs = append(cx.PrefixArgs(), \"member\", \"add\", \"newmember\", fmt.Sprintf(\"--peer-urls=%s\", peerURL))\n+\tif err := spawnWithExpect(cmdArgs, \" added to cluster \"); err != nil {\n+\t\tcx.t.Fatal(err)\n+\t}\n+}\n+\n+func authTestMemberRemove(cx ctlCtx) {\n+\tif err := authEnable(cx); err != nil {\n+\t\tcx.t.Fatal(err)\n+\t}\n+\n+\tcx.user, cx.pass = \"root\", \"root\"\n+\tauthSetupTestUser(cx)\n+\n+\tn1 := cx.cfg.clusterSize\n+\tif n1 < 2 {\n+\t\tcx.t.Fatalf(\"%d-node is too small to test 'member remove'\", n1)\n+\t}\n+\tresp, err := getMemberList(cx)\n+\tif err != nil {\n+\t\tcx.t.Fatal(err)\n+\t}\n+\tif n1 != len(resp.Members) {\n+\t\tcx.t.Fatalf(\"expected %d, got %d\", n1, len(resp.Members))\n+\t}\n+\n+\tvar (\n+\t\tmemIDToRemove = fmt.Sprintf(\"%x\", resp.Header.MemberId)\n+\t\tcluserID      = fmt.Sprintf(\"%x\", resp.Header.ClusterId)\n+\t)\n+\n+\t// ordinal user cannot remove a member\n+\tcx.user, cx.pass = \"test-user\", \"pass\"\n+\tcmdArgs := append(cx.PrefixArgs(), \"member\", \"remove\", memIDToRemove)\n+\tif err := spawnWithExpect(cmdArgs, \"Error:  etcdserver: permission denied\"); err != nil {","path":"e2e/ctl_v3_auth_test.go","position":69,"original_position":69,"commit_id":"d3e5e8d46dadcf70fd4a9727a682dd8027be5241","original_commit_id":"d3e5e8d46dadcf70fd4a9727a682dd8027be5241","user":{"login":"heyitsanthony","id":16294350,"avatar_url":"https://avatars.githubusercontent.com/u/16294350?v=3","gravatar_id":"","url":"https://api.github.com/users/heyitsanthony","html_url":"https://github.com/heyitsanthony","followers_url":"https://api.github.com/users/heyitsanthony/followers","following_url":"https://api.github.com/users/heyitsanthony/following{/other_user}","gists_url":"https://api.github.com/users/heyitsanthony/gists{/gist_id}","starred_url":"https://api.github.com/users/heyitsanthony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heyitsanthony/subscriptions","organizations_url":"https://api.github.com/users/heyitsanthony/orgs","repos_url":"https://api.github.com/users/heyitsanthony/repos","events_url":"https://api.github.com/users/heyitsanthony/events{/privacy}","received_events_url":"https://api.github.com/users/heyitsanthony/received_events","type":"User","site_admin":false},"body":"`err := ctlV3MemberRemove(cx, resp.Header.MemberId, resp.Header.ClusterId)`","created_at":"2016-12-07T18:40:57Z","updated_at":"2016-12-07T18:40:57Z","html_url":"https://github.com/coreos/etcd/pull/6903#discussion_r91358182","pull_request_url":"https://api.github.com/repos/coreos/etcd/pulls/6903","_links":{"self":{"href":"https://api.github.com/repos/coreos/etcd/pulls/comments/91358182"},"html":{"href":"https://github.com/coreos/etcd/pull/6903#discussion_r91358182"},"pull_request":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6903"}}},"pull_request":{"url":"https://api.github.com/repos/coreos/etcd/pulls/6903","id":95454480,"html_url":"https://github.com/coreos/etcd/pull/6903","diff_url":"https://github.com/coreos/etcd/pull/6903.diff","patch_url":"https://github.com/coreos/etcd/pull/6903.patch","issue_url":"https://api.github.com/repos/coreos/etcd/issues/6903","number":6903,"state":"open","locked":false,"title":"protect membership change RPCs with auth","user":{"login":"mitake","id":1173955,"avatar_url":"https://avatars.githubusercontent.com/u/1173955?v=3","gravatar_id":"","url":"https://api.github.com/users/mitake","html_url":"https://github.com/mitake","followers_url":"https://api.github.com/users/mitake/followers","following_url":"https://api.github.com/users/mitake/following{/other_user}","gists_url":"https://api.github.com/users/mitake/gists{/gist_id}","starred_url":"https://api.github.com/users/mitake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitake/subscriptions","organizations_url":"https://api.github.com/users/mitake/orgs","repos_url":"https://api.github.com/users/mitake/repos","events_url":"https://api.github.com/users/mitake/events{/privacy}","received_events_url":"https://api.github.com/users/mitake/received_events","type":"User","site_admin":false},"body":"This PR add a mechanism for protecting the membership change RPCs with auth.\r\n\r\nFixes https://github.com/coreos/etcd/issues/6899","created_at":"2016-11-28T08:20:29Z","updated_at":"2016-12-07T18:55:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9dc86105dbac60d0c0dd0b2d07f1e72d2f7e2ea4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/coreos/etcd/pulls/6903/commits","review_comments_url":"https://api.github.com/repos/coreos/etcd/pulls/6903/comments","review_comment_url":"https://api.github.com/repos/coreos/etcd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coreos/etcd/issues/6903/comments","statuses_url":"https://api.github.com/repos/coreos/etcd/statuses/d3e5e8d46dadcf70fd4a9727a682dd8027be5241","head":{"label":"mitake:auth-member","ref":"auth-member","sha":"d3e5e8d46dadcf70fd4a9727a682dd8027be5241","user":{"login":"mitake","id":1173955,"avatar_url":"https://avatars.githubusercontent.com/u/1173955?v=3","gravatar_id":"","url":"https://api.github.com/users/mitake","html_url":"https://github.com/mitake","followers_url":"https://api.github.com/users/mitake/followers","following_url":"https://api.github.com/users/mitake/following{/other_user}","gists_url":"https://api.github.com/users/mitake/gists{/gist_id}","starred_url":"https://api.github.com/users/mitake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitake/subscriptions","organizations_url":"https://api.github.com/users/mitake/orgs","repos_url":"https://api.github.com/users/mitake/repos","events_url":"https://api.github.com/users/mitake/events{/privacy}","received_events_url":"https://api.github.com/users/mitake/received_events","type":"User","site_admin":false},"repo":{"id":40219422,"name":"etcd","full_name":"mitake/etcd","owner":{"login":"mitake","id":1173955,"avatar_url":"https://avatars.githubusercontent.com/u/1173955?v=3","gravatar_id":"","url":"https://api.github.com/users/mitake","html_url":"https://github.com/mitake","followers_url":"https://api.github.com/users/mitake/followers","following_url":"https://api.github.com/users/mitake/following{/other_user}","gists_url":"https://api.github.com/users/mitake/gists{/gist_id}","starred_url":"https://api.github.com/users/mitake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitake/subscriptions","organizations_url":"https://api.github.com/users/mitake/orgs","repos_url":"https://api.github.com/users/mitake/repos","events_url":"https://api.github.com/users/mitake/events{/privacy}","received_events_url":"https://api.github.com/users/mitake/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mitake/etcd","description":"A distributed consistent key-value store for shared configuration and service discovery","fork":true,"url":"https://api.github.com/repos/mitake/etcd","forks_url":"https://api.github.com/repos/mitake/etcd/forks","keys_url":"https://api.github.com/repos/mitake/etcd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mitake/etcd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mitake/etcd/teams","hooks_url":"https://api.github.com/repos/mitake/etcd/hooks","issue_events_url":"https://api.github.com/repos/mitake/etcd/issues/events{/number}","events_url":"https://api.github.com/repos/mitake/etcd/events","assignees_url":"https://api.github.com/repos/mitake/etcd/assignees{/user}","branches_url":"https://api.github.com/repos/mitake/etcd/branches{/branch}","tags_url":"https://api.github.com/repos/mitake/etcd/tags","blobs_url":"https://api.github.com/repos/mitake/etcd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mitake/etcd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mitake/etcd/git/refs{/sha}","trees_url":"https://api.github.com/repos/mitake/etcd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mitake/etcd/statuses/{sha}","languages_url":"https://api.github.com/repos/mitake/etcd/languages","stargazers_url":"https://api.github.com/repos/mitake/etcd/stargazers","contributors_url":"https://api.github.com/repos/mitake/etcd/contributors","subscribers_url":"https://api.github.com/repos/mitake/etcd/subscribers","subscription_url":"https://api.github.com/repos/mitake/etcd/subscription","commits_url":"https://api.github.com/repos/mitake/etcd/commits{/sha}","git_commits_url":"https://api.github.com/repos/mitake/etcd/git/commits{/sha}","comments_url":"https://api.github.com/repos/mitake/etcd/comments{/number}","issue_comment_url":"https://api.github.com/repos/mitake/etcd/issues/comments{/number}","contents_url":"https://api.github.com/repos/mitake/etcd/contents/{+path}","compare_url":"https://api.github.com/repos/mitake/etcd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mitake/etcd/merges","archive_url":"https://api.github.com/repos/mitake/etcd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mitake/etcd/downloads","issues_url":"https://api.github.com/repos/mitake/etcd/issues{/number}","pulls_url":"https://api.github.com/repos/mitake/etcd/pulls{/number}","milestones_url":"https://api.github.com/repos/mitake/etcd/milestones{/number}","notifications_url":"https://api.github.com/repos/mitake/etcd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mitake/etcd/labels{/name}","releases_url":"https://api.github.com/repos/mitake/etcd/releases{/id}","deployments_url":"https://api.github.com/repos/mitake/etcd/deployments","created_at":"2015-08-05T02:10:59Z","updated_at":"2015-08-05T02:11:01Z","pushed_at":"2016-12-07T06:48:58Z","git_url":"git://github.com/mitake/etcd.git","ssh_url":"git@github.com:mitake/etcd.git","clone_url":"https://github.com/mitake/etcd.git","svn_url":"https://github.com/mitake/etcd","homepage":"","size":38772,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"coreos:master","ref":"master","sha":"994e0d218201a68fa5c3908421c40a79e04a0051","user":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"repo":{"id":11225014,"name":"etcd","full_name":"coreos/etcd","owner":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coreos/etcd","description":"Distributed reliable key-value store for the most critical data of a distributed system","fork":false,"url":"https://api.github.com/repos/coreos/etcd","forks_url":"https://api.github.com/repos/coreos/etcd/forks","keys_url":"https://api.github.com/repos/coreos/etcd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coreos/etcd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coreos/etcd/teams","hooks_url":"https://api.github.com/repos/coreos/etcd/hooks","issue_events_url":"https://api.github.com/repos/coreos/etcd/issues/events{/number}","events_url":"https://api.github.com/repos/coreos/etcd/events","assignees_url":"https://api.github.com/repos/coreos/etcd/assignees{/user}","branches_url":"https://api.github.com/repos/coreos/etcd/branches{/branch}","tags_url":"https://api.github.com/repos/coreos/etcd/tags","blobs_url":"https://api.github.com/repos/coreos/etcd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coreos/etcd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coreos/etcd/git/refs{/sha}","trees_url":"https://api.github.com/repos/coreos/etcd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coreos/etcd/statuses/{sha}","languages_url":"https://api.github.com/repos/coreos/etcd/languages","stargazers_url":"https://api.github.com/repos/coreos/etcd/stargazers","contributors_url":"https://api.github.com/repos/coreos/etcd/contributors","subscribers_url":"https://api.github.com/repos/coreos/etcd/subscribers","subscription_url":"https://api.github.com/repos/coreos/etcd/subscription","commits_url":"https://api.github.com/repos/coreos/etcd/commits{/sha}","git_commits_url":"https://api.github.com/repos/coreos/etcd/git/commits{/sha}","comments_url":"https://api.github.com/repos/coreos/etcd/comments{/number}","issue_comment_url":"https://api.github.com/repos/coreos/etcd/issues/comments{/number}","contents_url":"https://api.github.com/repos/coreos/etcd/contents/{+path}","compare_url":"https://api.github.com/repos/coreos/etcd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coreos/etcd/merges","archive_url":"https://api.github.com/repos/coreos/etcd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coreos/etcd/downloads","issues_url":"https://api.github.com/repos/coreos/etcd/issues{/number}","pulls_url":"https://api.github.com/repos/coreos/etcd/pulls{/number}","milestones_url":"https://api.github.com/repos/coreos/etcd/milestones{/number}","notifications_url":"https://api.github.com/repos/coreos/etcd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coreos/etcd/labels{/name}","releases_url":"https://api.github.com/repos/coreos/etcd/releases{/id}","deployments_url":"https://api.github.com/repos/coreos/etcd/deployments","created_at":"2013-07-06T21:57:21Z","updated_at":"2016-12-07T17:33:40Z","pushed_at":"2016-12-07T18:50:51Z","git_url":"git://github.com/coreos/etcd.git","ssh_url":"git@github.com:coreos/etcd.git","clone_url":"https://github.com/coreos/etcd.git","svn_url":"https://github.com/coreos/etcd","homepage":"https://coreos.com/etcd/docs/latest/","size":35996,"stargazers_count":11663,"watchers_count":11663,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2098,"mirror_url":null,"open_issues_count":116,"forks":2098,"open_issues":116,"watchers":11663,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6903"},"html":{"href":"https://github.com/coreos/etcd/pull/6903"},"issue":{"href":"https://api.github.com/repos/coreos/etcd/issues/6903"},"comments":{"href":"https://api.github.com/repos/coreos/etcd/issues/6903/comments"},"review_comments":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6903/comments"},"review_comment":{"href":"https://api.github.com/repos/coreos/etcd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6903/commits"},"statuses":{"href":"https://api.github.com/repos/coreos/etcd/statuses/d3e5e8d46dadcf70fd4a9727a682dd8027be5241"}}}}
{"actor":{"display_login":"heyitsanthony"}}