{"action":"created","comment":{"url":"https://api.github.com/repos/cybozu-go/etcdpasswd/pulls/comments/194284422","pull_request_review_id":127425379,"id":194284422,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDI4NDQyMg==","diff_hunk":"@@ -0,0 +1,39 @@\n+package etcdpasswd\n+\n+//go:generate mockgen -destination=mocks/auth.go -package=mocks github.com/cybozu-go/etcdpasswd Auth\n+\n+import (\n+\t\"context\"\n+\t\"os/user\"\n+\n+\t\"github.com/cybozu-go/cmd\"\n+)\n+\n+// Auth is an interface for the target of auth operations.\n+type Auth interface {\n+\tDeleteUser(context.Context, string) error\n+}\n+\n+var auth Auth\n+\n+func setupAuth(a Auth) {\n+\tauth = a\n+}\n+\n+// AuthLinux implements Auth for a real Linux server.\n+type AuthLinux struct {\n+}\n+\n+// DeleteUser deletes a Linux user.\n+func (a AuthLinux) DeleteUser(ctx context.Context, username string) error {\n+\t_, err := user.Lookup(username)\n+\tif err != nil {\n+\t\tif _, ok := err.(user.UnknownUserError); ok {\n+\t\t\t// already deleted\n+\t\t\treturn nil\n+\t\t}\n+\t\treturn err\n+\t}\n+\n+\treturn cmd.CommandContext(ctx, \"userdel\", \"--force\", username).Run()\n+}","path":"auth.go","position":39,"original_position":39,"commit_id":"1d0012c1112c49344855fc8dbfcf536dc9fdf360","original_commit_id":"531dd9eb0488b4639e289474657e065b371e8a54","user":{"login":"morimoto-cybozu","id":4961073,"node_id":"MDQ6VXNlcjQ5NjEwNzM=","avatar_url":"https://avatars3.githubusercontent.com/u/4961073?v=4","gravatar_id":"","url":"https://api.github.com/users/morimoto-cybozu","html_url":"https://github.com/morimoto-cybozu","followers_url":"https://api.github.com/users/morimoto-cybozu/followers","following_url":"https://api.github.com/users/morimoto-cybozu/following{/other_user}","gists_url":"https://api.github.com/users/morimoto-cybozu/gists{/gist_id}","starred_url":"https://api.github.com/users/morimoto-cybozu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morimoto-cybozu/subscriptions","organizations_url":"https://api.github.com/users/morimoto-cybozu/orgs","repos_url":"https://api.github.com/users/morimoto-cybozu/repos","events_url":"https://api.github.com/users/morimoto-cybozu/events{/privacy}","received_events_url":"https://api.github.com/users/morimoto-cybozu/received_events","type":"User","site_admin":false},"body":"ファイルごと消してくだち。","created_at":"2018-06-11T03:00:43Z","updated_at":"2018-06-11T03:00:44Z","html_url":"https://github.com/cybozu-go/etcdpasswd/pull/1#discussion_r194284422","pull_request_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/pulls/1","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/cybozu-go/etcdpasswd/pulls/comments/194284422"},"html":{"href":"https://github.com/cybozu-go/etcdpasswd/pull/1#discussion_r194284422"},"pull_request":{"href":"https://api.github.com/repos/cybozu-go/etcdpasswd/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/cybozu-go/etcdpasswd/pulls/1","id":193856506,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzODU2NTA2","html_url":"https://github.com/cybozu-go/etcdpasswd/pull/1","diff_url":"https://github.com/cybozu-go/etcdpasswd/pull/1.diff","patch_url":"https://github.com/cybozu-go/etcdpasswd/pull/1.patch","issue_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/issues/1","number":1,"state":"open","locked":false,"title":"Implement planned features","user":{"login":"ymmt2005","id":1461515,"node_id":"MDQ6VXNlcjE0NjE1MTU=","avatar_url":"https://avatars3.githubusercontent.com/u/1461515?v=4","gravatar_id":"","url":"https://api.github.com/users/ymmt2005","html_url":"https://github.com/ymmt2005","followers_url":"https://api.github.com/users/ymmt2005/followers","following_url":"https://api.github.com/users/ymmt2005/following{/other_user}","gists_url":"https://api.github.com/users/ymmt2005/gists{/gist_id}","starred_url":"https://api.github.com/users/ymmt2005/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ymmt2005/subscriptions","organizations_url":"https://api.github.com/users/ymmt2005/orgs","repos_url":"https://api.github.com/users/ymmt2005/repos","events_url":"https://api.github.com/users/ymmt2005/events{/privacy}","received_events_url":"https://api.github.com/users/ymmt2005/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-11T01:09:59Z","updated_at":"2018-06-11T03:00:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac2ba26d9f2c0716fdeb18fbeaca285f623e6cd9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/pulls/1/commits","review_comments_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/pulls/1/comments","review_comment_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/issues/1/comments","statuses_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/statuses/1d0012c1112c49344855fc8dbfcf536dc9fdf360","head":{"label":"cybozu-go:dev","ref":"dev","sha":"1d0012c1112c49344855fc8dbfcf536dc9fdf360","user":{"login":"cybozu-go","id":17453711,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NDUzNzEx","avatar_url":"https://avatars1.githubusercontent.com/u/17453711?v=4","gravatar_id":"","url":"https://api.github.com/users/cybozu-go","html_url":"https://github.com/cybozu-go","followers_url":"https://api.github.com/users/cybozu-go/followers","following_url":"https://api.github.com/users/cybozu-go/following{/other_user}","gists_url":"https://api.github.com/users/cybozu-go/gists{/gist_id}","starred_url":"https://api.github.com/users/cybozu-go/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cybozu-go/subscriptions","organizations_url":"https://api.github.com/users/cybozu-go/orgs","repos_url":"https://api.github.com/users/cybozu-go/repos","events_url":"https://api.github.com/users/cybozu-go/events{/privacy}","received_events_url":"https://api.github.com/users/cybozu-go/received_events","type":"Organization","site_admin":false},"repo":{"id":136422362,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY0MjIzNjI=","name":"etcdpasswd","full_name":"cybozu-go/etcdpasswd","owner":{"login":"cybozu-go","id":17453711,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NDUzNzEx","avatar_url":"https://avatars1.githubusercontent.com/u/17453711?v=4","gravatar_id":"","url":"https://api.github.com/users/cybozu-go","html_url":"https://github.com/cybozu-go","followers_url":"https://api.github.com/users/cybozu-go/followers","following_url":"https://api.github.com/users/cybozu-go/following{/other_user}","gists_url":"https://api.github.com/users/cybozu-go/gists{/gist_id}","starred_url":"https://api.github.com/users/cybozu-go/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cybozu-go/subscriptions","organizations_url":"https://api.github.com/users/cybozu-go/orgs","repos_url":"https://api.github.com/users/cybozu-go/repos","events_url":"https://api.github.com/users/cybozu-go/events{/privacy}","received_events_url":"https://api.github.com/users/cybozu-go/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cybozu-go/etcdpasswd","description":"Distributed Linux user management using etcd","fork":false,"url":"https://api.github.com/repos/cybozu-go/etcdpasswd","forks_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/forks","keys_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/teams","hooks_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/hooks","issue_events_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/issues/events{/number}","events_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/events","assignees_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/assignees{/user}","branches_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/branches{/branch}","tags_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/tags","blobs_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/git/refs{/sha}","trees_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/statuses/{sha}","languages_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/languages","stargazers_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/stargazers","contributors_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/contributors","subscribers_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/subscribers","subscription_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/subscription","commits_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/commits{/sha}","git_commits_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/git/commits{/sha}","comments_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/comments{/number}","issue_comment_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/issues/comments{/number}","contents_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/contents/{+path}","compare_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/merges","archive_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/downloads","issues_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/issues{/number}","pulls_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/pulls{/number}","milestones_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/milestones{/number}","notifications_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/labels{/name}","releases_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/releases{/id}","deployments_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/deployments","created_at":"2018-06-07T04:37:13Z","updated_at":"2018-06-07T06:05:30Z","pushed_at":"2018-06-11T02:53:46Z","git_url":"git://github.com/cybozu-go/etcdpasswd.git","ssh_url":"git@github.com:cybozu-go/etcdpasswd.git","clone_url":"https://github.com/cybozu-go/etcdpasswd.git","svn_url":"https://github.com/cybozu-go/etcdpasswd","homepage":null,"size":59,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"cybozu-go:master","ref":"master","sha":"0368a04bea5536662a9f7fec5740e0012a15c318","user":{"login":"cybozu-go","id":17453711,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NDUzNzEx","avatar_url":"https://avatars1.githubusercontent.com/u/17453711?v=4","gravatar_id":"","url":"https://api.github.com/users/cybozu-go","html_url":"https://github.com/cybozu-go","followers_url":"https://api.github.com/users/cybozu-go/followers","following_url":"https://api.github.com/users/cybozu-go/following{/other_user}","gists_url":"https://api.github.com/users/cybozu-go/gists{/gist_id}","starred_url":"https://api.github.com/users/cybozu-go/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cybozu-go/subscriptions","organizations_url":"https://api.github.com/users/cybozu-go/orgs","repos_url":"https://api.github.com/users/cybozu-go/repos","events_url":"https://api.github.com/users/cybozu-go/events{/privacy}","received_events_url":"https://api.github.com/users/cybozu-go/received_events","type":"Organization","site_admin":false},"repo":{"id":136422362,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY0MjIzNjI=","name":"etcdpasswd","full_name":"cybozu-go/etcdpasswd","owner":{"login":"cybozu-go","id":17453711,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NDUzNzEx","avatar_url":"https://avatars1.githubusercontent.com/u/17453711?v=4","gravatar_id":"","url":"https://api.github.com/users/cybozu-go","html_url":"https://github.com/cybozu-go","followers_url":"https://api.github.com/users/cybozu-go/followers","following_url":"https://api.github.com/users/cybozu-go/following{/other_user}","gists_url":"https://api.github.com/users/cybozu-go/gists{/gist_id}","starred_url":"https://api.github.com/users/cybozu-go/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cybozu-go/subscriptions","organizations_url":"https://api.github.com/users/cybozu-go/orgs","repos_url":"https://api.github.com/users/cybozu-go/repos","events_url":"https://api.github.com/users/cybozu-go/events{/privacy}","received_events_url":"https://api.github.com/users/cybozu-go/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cybozu-go/etcdpasswd","description":"Distributed Linux user management using etcd","fork":false,"url":"https://api.github.com/repos/cybozu-go/etcdpasswd","forks_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/forks","keys_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/teams","hooks_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/hooks","issue_events_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/issues/events{/number}","events_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/events","assignees_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/assignees{/user}","branches_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/branches{/branch}","tags_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/tags","blobs_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/git/refs{/sha}","trees_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/statuses/{sha}","languages_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/languages","stargazers_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/stargazers","contributors_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/contributors","subscribers_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/subscribers","subscription_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/subscription","commits_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/commits{/sha}","git_commits_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/git/commits{/sha}","comments_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/comments{/number}","issue_comment_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/issues/comments{/number}","contents_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/contents/{+path}","compare_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/merges","archive_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/downloads","issues_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/issues{/number}","pulls_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/pulls{/number}","milestones_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/milestones{/number}","notifications_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/labels{/name}","releases_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/releases{/id}","deployments_url":"https://api.github.com/repos/cybozu-go/etcdpasswd/deployments","created_at":"2018-06-07T04:37:13Z","updated_at":"2018-06-07T06:05:30Z","pushed_at":"2018-06-11T02:53:46Z","git_url":"git://github.com/cybozu-go/etcdpasswd.git","ssh_url":"git@github.com:cybozu-go/etcdpasswd.git","clone_url":"https://github.com/cybozu-go/etcdpasswd.git","svn_url":"https://github.com/cybozu-go/etcdpasswd","homepage":null,"size":59,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cybozu-go/etcdpasswd/pulls/1"},"html":{"href":"https://github.com/cybozu-go/etcdpasswd/pull/1"},"issue":{"href":"https://api.github.com/repos/cybozu-go/etcdpasswd/issues/1"},"comments":{"href":"https://api.github.com/repos/cybozu-go/etcdpasswd/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/cybozu-go/etcdpasswd/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/cybozu-go/etcdpasswd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cybozu-go/etcdpasswd/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/cybozu-go/etcdpasswd/statuses/1d0012c1112c49344855fc8dbfcf536dc9fdf360"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"morimoto-cybozu"}}