{"action":"created","comment":{"url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/pulls/comments/201973424","pull_request_review_id":136576181,"id":201973424,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTk3MzQyNA==","diff_hunk":"@@ -40,22 +41,17 @@ func main() {\n \t\treturn\n \t}\n \n-\tlistener, err := auditexporter.Listen(network, address)\n+\tlistener, err := net.Listen(network, address)\n \tif err != nil {\n \t\tlog.Fatal(\"Error listening for connections\", err)\n \t}\n-\tdefer func() {\n-\t\terr := listener.Close()\n-\t\tif err != nil {\n-\t\t\tlog.Warn(\"Error closing listener\", err)\n-\t\t}\n-\t}()","path":"cmd/vault-audit-exporter/main.go","position":22,"original_position":22,"commit_id":"1efdb96c3dfca7dfce4bf0ac034b66e2288f2486","original_commit_id":"f97348d13f91cbc11855d0225bf6641f6aee5fcc","user":{"login":"JayH5","id":1748643,"node_id":"MDQ6VXNlcjE3NDg2NDM=","avatar_url":"https://avatars3.githubusercontent.com/u/1748643?v=4","gravatar_id":"","url":"https://api.github.com/users/JayH5","html_url":"https://github.com/JayH5","followers_url":"https://api.github.com/users/JayH5/followers","following_url":"https://api.github.com/users/JayH5/following{/other_user}","gists_url":"https://api.github.com/users/JayH5/gists{/gist_id}","starred_url":"https://api.github.com/users/JayH5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JayH5/subscriptions","organizations_url":"https://api.github.com/users/JayH5/orgs","repos_url":"https://api.github.com/users/JayH5/repos","events_url":"https://api.github.com/users/JayH5/events{/privacy}","received_events_url":"https://api.github.com/users/JayH5/received_events","type":"User","site_admin":false},"body":"Since `handleConnection` also closes the connection it is passed, this somehow seems the most consistent way to do it :/","created_at":"2018-07-12T09:44:19Z","updated_at":"2018-07-12T09:44:19Z","html_url":"https://github.com/praekeltfoundation/vault-audit-exporter/pull/2#discussion_r201973424","pull_request_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/pulls/2","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/pulls/comments/201973424"},"html":{"href":"https://github.com/praekeltfoundation/vault-audit-exporter/pull/2#discussion_r201973424"},"pull_request":{"href":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/pulls/2"}},"in_reply_to_id":201621342},"pull_request":{"url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/pulls/2","id":200381076,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwMzgxMDc2","html_url":"https://github.com/praekeltfoundation/vault-audit-exporter/pull/2","diff_url":"https://github.com/praekeltfoundation/vault-audit-exporter/pull/2.diff","patch_url":"https://github.com/praekeltfoundation/vault-audit-exporter/pull/2.patch","issue_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/issues/2","number":2,"state":"open","locked":false,"title":"Server improvements","user":{"login":"JayH5","id":1748643,"node_id":"MDQ6VXNlcjE3NDg2NDM=","avatar_url":"https://avatars3.githubusercontent.com/u/1748643?v=4","gravatar_id":"","url":"https://api.github.com/users/JayH5","html_url":"https://github.com/JayH5","followers_url":"https://api.github.com/users/JayH5/followers","following_url":"https://api.github.com/users/JayH5/following{/other_user}","gists_url":"https://api.github.com/users/JayH5/gists{/gist_id}","starred_url":"https://api.github.com/users/JayH5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JayH5/subscriptions","organizations_url":"https://api.github.com/users/JayH5/orgs","repos_url":"https://api.github.com/users/JayH5/repos","events_url":"https://api.github.com/users/JayH5/events{/privacy}","received_events_url":"https://api.github.com/users/JayH5/received_events","type":"User","site_admin":false},"body":"- [x] Make the server have a similar interface to the net/http server (`Serve(net.Listener, Handler)`, `ListenAndServe(string, Handler)`.\r\n- [x] Improve handling of errors when accepting connections (copy net/http)\r\n- [x] Test unknown audit entry type\r\n- [x] Test invalid lines\r\n- [x] Handle Scanner errors\r\n- [x] Test Serve/ListenAndServe","created_at":"2018-07-10T12:35:55Z","updated_at":"2018-07-12T09:44:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dcf08f3da05ba7025b309b8157adeb883200f03d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/pulls/2/commits","review_comments_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/pulls/2/comments","review_comment_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/issues/2/comments","statuses_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/statuses/1efdb96c3dfca7dfce4bf0ac034b66e2288f2486","head":{"label":"praekeltfoundation:server-improvements","ref":"server-improvements","sha":"1efdb96c3dfca7dfce4bf0ac034b66e2288f2486","user":{"login":"praekeltfoundation","id":15786759,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1Nzg2NzU5","avatar_url":"https://avatars3.githubusercontent.com/u/15786759?v=4","gravatar_id":"","url":"https://api.github.com/users/praekeltfoundation","html_url":"https://github.com/praekeltfoundation","followers_url":"https://api.github.com/users/praekeltfoundation/followers","following_url":"https://api.github.com/users/praekeltfoundation/following{/other_user}","gists_url":"https://api.github.com/users/praekeltfoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/praekeltfoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekeltfoundation/subscriptions","organizations_url":"https://api.github.com/users/praekeltfoundation/orgs","repos_url":"https://api.github.com/users/praekeltfoundation/repos","events_url":"https://api.github.com/users/praekeltfoundation/events{/privacy}","received_events_url":"https://api.github.com/users/praekeltfoundation/received_events","type":"Organization","site_admin":false},"repo":{"id":139143084,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkxNDMwODQ=","name":"vault-audit-exporter","full_name":"praekeltfoundation/vault-audit-exporter","owner":{"login":"praekeltfoundation","id":15786759,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1Nzg2NzU5","avatar_url":"https://avatars3.githubusercontent.com/u/15786759?v=4","gravatar_id":"","url":"https://api.github.com/users/praekeltfoundation","html_url":"https://github.com/praekeltfoundation","followers_url":"https://api.github.com/users/praekeltfoundation/followers","following_url":"https://api.github.com/users/praekeltfoundation/following{/other_user}","gists_url":"https://api.github.com/users/praekeltfoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/praekeltfoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekeltfoundation/subscriptions","organizations_url":"https://api.github.com/users/praekeltfoundation/orgs","repos_url":"https://api.github.com/users/praekeltfoundation/repos","events_url":"https://api.github.com/users/praekeltfoundation/events{/privacy}","received_events_url":"https://api.github.com/users/praekeltfoundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/praekeltfoundation/vault-audit-exporter","description":"Socket audit device for HashiCorp Vault that exports audit logs to services such as SumoLogic","fork":false,"url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter","forks_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/forks","keys_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/teams","hooks_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/hooks","issue_events_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/issues/events{/number}","events_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/events","assignees_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/assignees{/user}","branches_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/branches{/branch}","tags_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/tags","blobs_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/git/refs{/sha}","trees_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/statuses/{sha}","languages_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/languages","stargazers_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/stargazers","contributors_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/contributors","subscribers_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/subscribers","subscription_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/subscription","commits_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/commits{/sha}","git_commits_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/git/commits{/sha}","comments_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/comments{/number}","issue_comment_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/issues/comments{/number}","contents_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/contents/{+path}","compare_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/merges","archive_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/downloads","issues_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/issues{/number}","pulls_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/pulls{/number}","milestones_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/milestones{/number}","notifications_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/labels{/name}","releases_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/releases{/id}","deployments_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/deployments","created_at":"2018-06-29T11:48:03Z","updated_at":"2018-07-09T14:34:32Z","pushed_at":"2018-07-12T09:31:13Z","git_url":"git://github.com/praekeltfoundation/vault-audit-exporter.git","ssh_url":"git@github.com:praekeltfoundation/vault-audit-exporter.git","clone_url":"https://github.com/praekeltfoundation/vault-audit-exporter.git","svn_url":"https://github.com/praekeltfoundation/vault-audit-exporter","homepage":null,"size":52,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"praekeltfoundation:master","ref":"master","sha":"0243ee0df5581a9be1b99655df33ffcc25e13f96","user":{"login":"praekeltfoundation","id":15786759,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1Nzg2NzU5","avatar_url":"https://avatars3.githubusercontent.com/u/15786759?v=4","gravatar_id":"","url":"https://api.github.com/users/praekeltfoundation","html_url":"https://github.com/praekeltfoundation","followers_url":"https://api.github.com/users/praekeltfoundation/followers","following_url":"https://api.github.com/users/praekeltfoundation/following{/other_user}","gists_url":"https://api.github.com/users/praekeltfoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/praekeltfoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekeltfoundation/subscriptions","organizations_url":"https://api.github.com/users/praekeltfoundation/orgs","repos_url":"https://api.github.com/users/praekeltfoundation/repos","events_url":"https://api.github.com/users/praekeltfoundation/events{/privacy}","received_events_url":"https://api.github.com/users/praekeltfoundation/received_events","type":"Organization","site_admin":false},"repo":{"id":139143084,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkxNDMwODQ=","name":"vault-audit-exporter","full_name":"praekeltfoundation/vault-audit-exporter","owner":{"login":"praekeltfoundation","id":15786759,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1Nzg2NzU5","avatar_url":"https://avatars3.githubusercontent.com/u/15786759?v=4","gravatar_id":"","url":"https://api.github.com/users/praekeltfoundation","html_url":"https://github.com/praekeltfoundation","followers_url":"https://api.github.com/users/praekeltfoundation/followers","following_url":"https://api.github.com/users/praekeltfoundation/following{/other_user}","gists_url":"https://api.github.com/users/praekeltfoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/praekeltfoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekeltfoundation/subscriptions","organizations_url":"https://api.github.com/users/praekeltfoundation/orgs","repos_url":"https://api.github.com/users/praekeltfoundation/repos","events_url":"https://api.github.com/users/praekeltfoundation/events{/privacy}","received_events_url":"https://api.github.com/users/praekeltfoundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/praekeltfoundation/vault-audit-exporter","description":"Socket audit device for HashiCorp Vault that exports audit logs to services such as SumoLogic","fork":false,"url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter","forks_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/forks","keys_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/teams","hooks_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/hooks","issue_events_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/issues/events{/number}","events_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/events","assignees_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/assignees{/user}","branches_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/branches{/branch}","tags_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/tags","blobs_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/git/refs{/sha}","trees_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/statuses/{sha}","languages_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/languages","stargazers_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/stargazers","contributors_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/contributors","subscribers_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/subscribers","subscription_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/subscription","commits_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/commits{/sha}","git_commits_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/git/commits{/sha}","comments_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/comments{/number}","issue_comment_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/issues/comments{/number}","contents_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/contents/{+path}","compare_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/merges","archive_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/downloads","issues_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/issues{/number}","pulls_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/pulls{/number}","milestones_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/milestones{/number}","notifications_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/labels{/name}","releases_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/releases{/id}","deployments_url":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/deployments","created_at":"2018-06-29T11:48:03Z","updated_at":"2018-07-09T14:34:32Z","pushed_at":"2018-07-12T09:31:13Z","git_url":"git://github.com/praekeltfoundation/vault-audit-exporter.git","ssh_url":"git@github.com:praekeltfoundation/vault-audit-exporter.git","clone_url":"https://github.com/praekeltfoundation/vault-audit-exporter.git","svn_url":"https://github.com/praekeltfoundation/vault-audit-exporter","homepage":null,"size":52,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/pulls/2"},"html":{"href":"https://github.com/praekeltfoundation/vault-audit-exporter/pull/2"},"issue":{"href":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/issues/2"},"comments":{"href":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/praekeltfoundation/vault-audit-exporter/statuses/1efdb96c3dfca7dfce4bf0ac034b66e2288f2486"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"JayH5"}}