{"action":"created","comment":{"url":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/comments/195815008","pull_request_review_id":129259624,"id":195815008,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTgxNTAwOA==","diff_hunk":"@@ -0,0 +1,138 @@\n+package main\n+\n+import (\n+\t\"bytes\"\n+\t\"crypto/rand\"\n+\t\"crypto/rsa\"\n+\t\"encoding/binary\"\n+\t\"flag\"\n+\t\"fmt\"\n+\t\"io\"\n+\t\"log\"\n+\t\"net\"\n+\t\"os\"\n+\t\"os/exec\"\n+\n+\t\"github.com/kr/pty\"\n+\t\"golang.org/x/crypto/ssh\"\n+)\n+\n+var (\n+\tport = flag.Uint(\"port\", uint(22), \"the port to listen on\")\n+)\n+\n+func main() {\n+\tflag.Parse()\n+\n+\tconfig, listener, err := startServer(*port)\n+\tif err != nil {\n+\t\tlog.Fatalf(\"Failed to start server: %v\", err)\n+\t}\n+\tlog.Printf(\"Listening on %s...\", listener.Addr())\n+\n+\tfor {\n+\t\tconnection, err := listener.Accept()\n+\t\tif err != nil {\n+\t\t\tlog.Fatalf(\"Failed to accept incoming connection: %v\", err)\n+\t\t}\n+\n+\t\tgo func() {\n+\t\t\thandleConnection(connection, config)\n+\t\t}()\n+\t}\n+}\n+\n+func startServer(port uint) (*ssh.ServerConfig, net.Listener, error) {\n+\tconfig, err := getConfiguration()\n+\tif err != nil {\n+\t\treturn nil, nil, fmt.Errorf(\"getting configuration: %v\", err)\n+\t}\n+\n+\tlistener, err := net.Listen(\"tcp\", fmt.Sprintf(\":%d\", port))\n+\tif err != nil {\n+\t\treturn nil, nil, fmt.Errorf(\"listen: %v\", err)\n+\t}\n+\treturn config, listener, nil\n+}\n+\n+func getConfiguration() (*ssh.ServerConfig, error) {\n+\tconfig := &ssh.ServerConfig{NoClientAuth: true}\n+\n+\tkey, err := rsa.GenerateKey(rand.Reader, 2048)\n+\tif err != nil {\n+\t\treturn nil, fmt.Errorf(\"generating server key pair: %v\", err)\n+\t}\n+\n+\tsigner, err := ssh.NewSignerFromKey(key)\n+\tif err != nil {\n+\t\treturn nil, fmt.Errorf(\"generating crypto signer: %v\", err)","path":"ssh-server/main.go","position":68,"original_position":68,"commit_id":"cb2269a6b0e419826f8ad87b2454a96a887cfdd4","original_commit_id":"cb2269a6b0e419826f8ad87b2454a96a887cfdd4","user":{"login":"anamanolache","id":23612578,"node_id":"MDQ6VXNlcjIzNjEyNTc4","avatar_url":"https://avatars1.githubusercontent.com/u/23612578?v=4","gravatar_id":"","url":"https://api.github.com/users/anamanolache","html_url":"https://github.com/anamanolache","followers_url":"https://api.github.com/users/anamanolache/followers","following_url":"https://api.github.com/users/anamanolache/following{/other_user}","gists_url":"https://api.github.com/users/anamanolache/gists{/gist_id}","starred_url":"https://api.github.com/users/anamanolache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anamanolache/subscriptions","organizations_url":"https://api.github.com/users/anamanolache/orgs","repos_url":"https://api.github.com/users/anamanolache/repos","events_url":"https://api.github.com/users/anamanolache/events{/privacy}","received_events_url":"https://api.github.com/users/anamanolache/received_events","type":"User","site_admin":false},"body":"done","created_at":"2018-06-15T17:38:59Z","updated_at":"2018-06-15T17:38:59Z","html_url":"https://github.com/googlegenomics/pipelines-tools/pull/46#discussion_r195815008","pull_request_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/46","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/comments/195815008"},"html":{"href":"https://github.com/googlegenomics/pipelines-tools/pull/46#discussion_r195815008"},"pull_request":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/46"}},"in_reply_to_id":195526894},"pull_request":{"url":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/46","id":190979358,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkwOTc5MzU4","html_url":"https://github.com/googlegenomics/pipelines-tools/pull/46","diff_url":"https://github.com/googlegenomics/pipelines-tools/pull/46.diff","patch_url":"https://github.com/googlegenomics/pipelines-tools/pull/46.patch","issue_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/issues/46","number":46,"state":"open","locked":false,"title":"Add SSH server and support to pipelines tool","user":{"login":"anamanolache","id":23612578,"node_id":"MDQ6VXNlcjIzNjEyNTc4","avatar_url":"https://avatars1.githubusercontent.com/u/23612578?v=4","gravatar_id":"","url":"https://api.github.com/users/anamanolache","html_url":"https://github.com/anamanolache","followers_url":"https://api.github.com/users/anamanolache/followers","following_url":"https://api.github.com/users/anamanolache/following{/other_user}","gists_url":"https://api.github.com/users/anamanolache/gists{/gist_id}","starred_url":"https://api.github.com/users/anamanolache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anamanolache/subscriptions","organizations_url":"https://api.github.com/users/anamanolache/orgs","repos_url":"https://api.github.com/users/anamanolache/repos","events_url":"https://api.github.com/users/anamanolache/events{/privacy}","received_events_url":"https://api.github.com/users/anamanolache/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-28T18:25:37Z","updated_at":"2018-06-15T17:38:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c15d4597fb32ca13920b0deda251f4d6110c1721","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/46/commits","review_comments_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/46/comments","review_comment_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/issues/46/comments","statuses_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/statuses/cb2269a6b0e419826f8ad87b2454a96a887cfdd4","head":{"label":"anamanolache:master","ref":"master","sha":"cb2269a6b0e419826f8ad87b2454a96a887cfdd4","user":{"login":"anamanolache","id":23612578,"node_id":"MDQ6VXNlcjIzNjEyNTc4","avatar_url":"https://avatars1.githubusercontent.com/u/23612578?v=4","gravatar_id":"","url":"https://api.github.com/users/anamanolache","html_url":"https://github.com/anamanolache","followers_url":"https://api.github.com/users/anamanolache/followers","following_url":"https://api.github.com/users/anamanolache/following{/other_user}","gists_url":"https://api.github.com/users/anamanolache/gists{/gist_id}","starred_url":"https://api.github.com/users/anamanolache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anamanolache/subscriptions","organizations_url":"https://api.github.com/users/anamanolache/orgs","repos_url":"https://api.github.com/users/anamanolache/repos","events_url":"https://api.github.com/users/anamanolache/events{/privacy}","received_events_url":"https://api.github.com/users/anamanolache/received_events","type":"User","site_admin":false},"repo":{"id":130226215,"node_id":"MDEwOlJlcG9zaXRvcnkxMzAyMjYyMTU=","name":"pipelines-tools","full_name":"anamanolache/pipelines-tools","owner":{"login":"anamanolache","id":23612578,"node_id":"MDQ6VXNlcjIzNjEyNTc4","avatar_url":"https://avatars1.githubusercontent.com/u/23612578?v=4","gravatar_id":"","url":"https://api.github.com/users/anamanolache","html_url":"https://github.com/anamanolache","followers_url":"https://api.github.com/users/anamanolache/followers","following_url":"https://api.github.com/users/anamanolache/following{/other_user}","gists_url":"https://api.github.com/users/anamanolache/gists{/gist_id}","starred_url":"https://api.github.com/users/anamanolache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anamanolache/subscriptions","organizations_url":"https://api.github.com/users/anamanolache/orgs","repos_url":"https://api.github.com/users/anamanolache/repos","events_url":"https://api.github.com/users/anamanolache/events{/privacy}","received_events_url":"https://api.github.com/users/anamanolache/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anamanolache/pipelines-tools","description":"Tools for developing and running pipelines with the Genomics API","fork":true,"url":"https://api.github.com/repos/anamanolache/pipelines-tools","forks_url":"https://api.github.com/repos/anamanolache/pipelines-tools/forks","keys_url":"https://api.github.com/repos/anamanolache/pipelines-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anamanolache/pipelines-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anamanolache/pipelines-tools/teams","hooks_url":"https://api.github.com/repos/anamanolache/pipelines-tools/hooks","issue_events_url":"https://api.github.com/repos/anamanolache/pipelines-tools/issues/events{/number}","events_url":"https://api.github.com/repos/anamanolache/pipelines-tools/events","assignees_url":"https://api.github.com/repos/anamanolache/pipelines-tools/assignees{/user}","branches_url":"https://api.github.com/repos/anamanolache/pipelines-tools/branches{/branch}","tags_url":"https://api.github.com/repos/anamanolache/pipelines-tools/tags","blobs_url":"https://api.github.com/repos/anamanolache/pipelines-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anamanolache/pipelines-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anamanolache/pipelines-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/anamanolache/pipelines-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anamanolache/pipelines-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/anamanolache/pipelines-tools/languages","stargazers_url":"https://api.github.com/repos/anamanolache/pipelines-tools/stargazers","contributors_url":"https://api.github.com/repos/anamanolache/pipelines-tools/contributors","subscribers_url":"https://api.github.com/repos/anamanolache/pipelines-tools/subscribers","subscription_url":"https://api.github.com/repos/anamanolache/pipelines-tools/subscription","commits_url":"https://api.github.com/repos/anamanolache/pipelines-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/anamanolache/pipelines-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/anamanolache/pipelines-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/anamanolache/pipelines-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/anamanolache/pipelines-tools/contents/{+path}","compare_url":"https://api.github.com/repos/anamanolache/pipelines-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anamanolache/pipelines-tools/merges","archive_url":"https://api.github.com/repos/anamanolache/pipelines-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anamanolache/pipelines-tools/downloads","issues_url":"https://api.github.com/repos/anamanolache/pipelines-tools/issues{/number}","pulls_url":"https://api.github.com/repos/anamanolache/pipelines-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/anamanolache/pipelines-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/anamanolache/pipelines-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anamanolache/pipelines-tools/labels{/name}","releases_url":"https://api.github.com/repos/anamanolache/pipelines-tools/releases{/id}","deployments_url":"https://api.github.com/repos/anamanolache/pipelines-tools/deployments","created_at":"2018-04-19T14:15:14Z","updated_at":"2018-06-13T21:22:02Z","pushed_at":"2018-06-13T21:22:00Z","git_url":"git://github.com/anamanolache/pipelines-tools.git","ssh_url":"git@github.com:anamanolache/pipelines-tools.git","clone_url":"https://github.com/anamanolache/pipelines-tools.git","svn_url":"https://github.com/anamanolache/pipelines-tools","homepage":null,"size":111,"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":1,"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":1,"watchers":0,"default_branch":"master"}},"base":{"label":"googlegenomics:master","ref":"master","sha":"e09767dfa9268c88ecbb5814ee85d909975ce405","user":{"login":"googlegenomics","id":7434120,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0MzQxMjA=","avatar_url":"https://avatars2.githubusercontent.com/u/7434120?v=4","gravatar_id":"","url":"https://api.github.com/users/googlegenomics","html_url":"https://github.com/googlegenomics","followers_url":"https://api.github.com/users/googlegenomics/followers","following_url":"https://api.github.com/users/googlegenomics/following{/other_user}","gists_url":"https://api.github.com/users/googlegenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/googlegenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlegenomics/subscriptions","organizations_url":"https://api.github.com/users/googlegenomics/orgs","repos_url":"https://api.github.com/users/googlegenomics/repos","events_url":"https://api.github.com/users/googlegenomics/events{/privacy}","received_events_url":"https://api.github.com/users/googlegenomics/received_events","type":"Organization","site_admin":false},"repo":{"id":123620762,"node_id":"MDEwOlJlcG9zaXRvcnkxMjM2MjA3NjI=","name":"pipelines-tools","full_name":"googlegenomics/pipelines-tools","owner":{"login":"googlegenomics","id":7434120,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0MzQxMjA=","avatar_url":"https://avatars2.githubusercontent.com/u/7434120?v=4","gravatar_id":"","url":"https://api.github.com/users/googlegenomics","html_url":"https://github.com/googlegenomics","followers_url":"https://api.github.com/users/googlegenomics/followers","following_url":"https://api.github.com/users/googlegenomics/following{/other_user}","gists_url":"https://api.github.com/users/googlegenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/googlegenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlegenomics/subscriptions","organizations_url":"https://api.github.com/users/googlegenomics/orgs","repos_url":"https://api.github.com/users/googlegenomics/repos","events_url":"https://api.github.com/users/googlegenomics/events{/privacy}","received_events_url":"https://api.github.com/users/googlegenomics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/googlegenomics/pipelines-tools","description":"Tools for developing and running pipelines with the Genomics API","fork":false,"url":"https://api.github.com/repos/googlegenomics/pipelines-tools","forks_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/forks","keys_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/teams","hooks_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/hooks","issue_events_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/issues/events{/number}","events_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/events","assignees_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/assignees{/user}","branches_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/branches{/branch}","tags_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/tags","blobs_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/languages","stargazers_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/stargazers","contributors_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/contributors","subscribers_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/subscribers","subscription_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/subscription","commits_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/contents/{+path}","compare_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/merges","archive_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/downloads","issues_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/issues{/number}","pulls_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/labels{/name}","releases_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/releases{/id}","deployments_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/deployments","created_at":"2018-03-02T19:20:13Z","updated_at":"2018-06-15T15:18:26Z","pushed_at":"2018-06-15T15:28:08Z","git_url":"git://github.com/googlegenomics/pipelines-tools.git","ssh_url":"git@github.com:googlegenomics/pipelines-tools.git","clone_url":"https://github.com/googlegenomics/pipelines-tools.git","svn_url":"https://github.com/googlegenomics/pipelines-tools","homepage":null,"size":82,"stargazers_count":5,"watchers_count":5,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":9,"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":5,"open_issues":9,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/46"},"html":{"href":"https://github.com/googlegenomics/pipelines-tools/pull/46"},"issue":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/issues/46"},"comments":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/statuses/cb2269a6b0e419826f8ad87b2454a96a887cfdd4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"anamanolache"}}