{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/openshift-azure/pulls/comments/211411306","pull_request_review_id":147826986,"id":211411306,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTQxMTMwNg==","diff_hunk":"@@ -0,0 +1,91 @@\n+package tls\n+\n+import (\n+\t\"crypto/rand\"\n+\t\"crypto/x509\"\n+\t\"crypto/x509/pkix\"\n+\t\"fmt\"\n+\t\"math/big\"\n+\t\"testing\"\n+\t\"time\"\n+)\n+\n+// x509 expects quite a large number so 0xDEADBEEF will not cut it\n+func getSerialNumber() (*big.Int, error) {\n+\tserialNumber, err := rand.Int(rand.Reader, new(big.Int).Lsh(big.NewInt(1), 128))\n+\tif err != nil {\n+\t\tfmt.Errorf(\"failed to create cert serial number\")\n+\t}\n+\treturn serialNumber, nil\n+}\n+func getTemplate() (*x509.Certificate, error) {\n+\tnow := time.Now()\n+\tSN, err := getSerialNumber()\n+\tif err != nil {\n+\t\tfmt.Errorf(\"Failed to create cert serial number\")\n+\t}\n+\n+\ttemplate := &x509.Certificate{\n+\t\tSerialNumber:          SN,\n+\t\tNotBefore:             now,\n+\t\tNotAfter:              now.AddDate(5, 0, 0),\n+\t\tSubject:               pkix.Name{CommonName: cn},\n+\t\tBasicConstraintsValid: true,\n+\t\tKeyUsage:              x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,\n+\t\tIsCA:                  true,\n+\t}\n+\treturn template, nil\n+}\n+\n+var cn = \"dummy-test-certificate.local\"\n+\n+//func NewPrivateKey() (*rsa.PrivateKey, error) {\n+func TestNewPrivateKey(t *testing.T) {\n+\tnewPK, err := NewPrivateKey()\n+\tif err != nil {\n+\t\tt.Errorf(\"failed to create private key\")\n+\t}\n+\tif newPK.Validate() != nil {\n+\t\tt.Errorf(\"Failed to validate private key\")\n+\t}\n+}\n+\n+//func newCert(key *rsa.PrivateKey, template *x509.Certificate,\n+//signingkey *rsa.PrivateKey, signingcert *x509.Certificate)\n+//(*x509.Certificate, error) {\n+func testSelfSignedNewCert(t *testing.T) {\n+\tnewPK, err := NewPrivateKey()\n+\tif err != nil {\n+\t\tt.Errorf(\"failed to create private key\")\n+\t}\n+\ttemplate, err := getTemplate()\n+\tif err != nil {\n+\t\tt.Errorf(\"failed to create template for Cert\")\n+\t}\n+\ttestCert, err := newCert(newPK, template, nil, nil)\n+\tif err != nil {\n+\t\tt.Errorf(\"failed to create test self signed certificate\")\n+\t}\n+\topts := x509.VerifyOptions{DNSName: cn}\n+\tif _, err := testCert.Verify(opts); err != nil {\n+\t\tt.Errorf(\"Failed to verify created self signed certificate\")\n+\t}\n+}\n+\n+//func NewCA(cn string) (*rsa.PrivateKey, *x509.Certificate, error) {\n+func testNewCA(t *testing.T) {\n+\tpk, cert, err := NewCA(cn)\n+\tif err != nil {\n+\t\tt.Errorf(\"failed to create new CA\")\n+\t}\n+\tif pk.Validate() != nil {","path":"pkg/tls/tls_test.go","position":81,"original_position":81,"commit_id":"f8508190d7d0cb34a535b4474745388dd15a62ef","original_commit_id":"f8508190d7d0cb34a535b4474745388dd15a62ef","user":{"login":"jim-minter","id":1038301,"node_id":"MDQ6VXNlcjEwMzgzMDE=","avatar_url":"https://avatars2.githubusercontent.com/u/1038301?v=4","gravatar_id":"","url":"https://api.github.com/users/jim-minter","html_url":"https://github.com/jim-minter","followers_url":"https://api.github.com/users/jim-minter/followers","following_url":"https://api.github.com/users/jim-minter/following{/other_user}","gists_url":"https://api.github.com/users/jim-minter/gists{/gist_id}","starred_url":"https://api.github.com/users/jim-minter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jim-minter/subscriptions","organizations_url":"https://api.github.com/users/jim-minter/orgs","repos_url":"https://api.github.com/users/jim-minter/repos","events_url":"https://api.github.com/users/jim-minter/events{/privacy}","received_events_url":"https://api.github.com/users/jim-minter/received_events","type":"User","site_admin":false},"body":"this is somewhat duplicate.","created_at":"2018-08-20T21:21:28Z","updated_at":"2018-08-20T21:24:49Z","html_url":"https://github.com/openshift/openshift-azure/pull/224#discussion_r211411306","pull_request_url":"https://api.github.com/repos/openshift/openshift-azure/pulls/224","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openshift/openshift-azure/pulls/comments/211411306"},"html":{"href":"https://github.com/openshift/openshift-azure/pull/224#discussion_r211411306"},"pull_request":{"href":"https://api.github.com/repos/openshift/openshift-azure/pulls/224"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/openshift-azure/pulls/224","id":209456230,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5NDU2MjMw","html_url":"https://github.com/openshift/openshift-azure/pull/224","diff_url":"https://github.com/openshift/openshift-azure/pull/224.diff","patch_url":"https://github.com/openshift/openshift-azure/pull/224.patch","issue_url":"https://api.github.com/repos/openshift/openshift-azure/issues/224","number":224,"state":"open","locked":false,"title":"[WiP] extend tls.go unit test coverage","user":{"login":"thanasisk","id":1152970,"node_id":"MDQ6VXNlcjExNTI5NzA=","avatar_url":"https://avatars0.githubusercontent.com/u/1152970?v=4","gravatar_id":"","url":"https://api.github.com/users/thanasisk","html_url":"https://github.com/thanasisk","followers_url":"https://api.github.com/users/thanasisk/followers","following_url":"https://api.github.com/users/thanasisk/following{/other_user}","gists_url":"https://api.github.com/users/thanasisk/gists{/gist_id}","starred_url":"https://api.github.com/users/thanasisk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanasisk/subscriptions","organizations_url":"https://api.github.com/users/thanasisk/orgs","repos_url":"https://api.github.com/users/thanasisk/repos","events_url":"https://api.github.com/users/thanasisk/events{/privacy}","received_events_url":"https://api.github.com/users/thanasisk/received_events","type":"User","site_admin":false},"body":"added partial test coverage for tls.go","created_at":"2018-08-20T09:08:51Z","updated_at":"2018-08-20T21:24:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa1c3089525f63a494ff86442dc5af0dc0c4734e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":984232984,"node_id":"MDU6TGFiZWw5ODQyMzI5ODQ=","url":"https://api.github.com/repos/openshift/openshift-azure/labels/do-not-merge/work-in-progress","name":"do-not-merge/work-in-progress","color":"e11d21","default":false},{"id":1006544745,"node_id":"MDU6TGFiZWwxMDA2NTQ0NzQ1","url":"https://api.github.com/repos/openshift/openshift-azure/labels/size/M","name":"size/M","color":"eebb00","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/openshift/openshift-azure/pulls/224/commits","review_comments_url":"https://api.github.com/repos/openshift/openshift-azure/pulls/224/comments","review_comment_url":"https://api.github.com/repos/openshift/openshift-azure/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/openshift-azure/issues/224/comments","statuses_url":"https://api.github.com/repos/openshift/openshift-azure/statuses/f8508190d7d0cb34a535b4474745388dd15a62ef","head":{"label":"thanasisk:unit-test-extension","ref":"unit-test-extension","sha":"f8508190d7d0cb34a535b4474745388dd15a62ef","user":{"login":"thanasisk","id":1152970,"node_id":"MDQ6VXNlcjExNTI5NzA=","avatar_url":"https://avatars0.githubusercontent.com/u/1152970?v=4","gravatar_id":"","url":"https://api.github.com/users/thanasisk","html_url":"https://github.com/thanasisk","followers_url":"https://api.github.com/users/thanasisk/followers","following_url":"https://api.github.com/users/thanasisk/following{/other_user}","gists_url":"https://api.github.com/users/thanasisk/gists{/gist_id}","starred_url":"https://api.github.com/users/thanasisk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanasisk/subscriptions","organizations_url":"https://api.github.com/users/thanasisk/orgs","repos_url":"https://api.github.com/users/thanasisk/repos","events_url":"https://api.github.com/users/thanasisk/events{/privacy}","received_events_url":"https://api.github.com/users/thanasisk/received_events","type":"User","site_admin":false},"repo":{"id":145105331,"node_id":"MDEwOlJlcG9zaXRvcnkxNDUxMDUzMzE=","name":"openshift-azure","full_name":"thanasisk/openshift-azure","owner":{"login":"thanasisk","id":1152970,"node_id":"MDQ6VXNlcjExNTI5NzA=","avatar_url":"https://avatars0.githubusercontent.com/u/1152970?v=4","gravatar_id":"","url":"https://api.github.com/users/thanasisk","html_url":"https://github.com/thanasisk","followers_url":"https://api.github.com/users/thanasisk/followers","following_url":"https://api.github.com/users/thanasisk/following{/other_user}","gists_url":"https://api.github.com/users/thanasisk/gists{/gist_id}","starred_url":"https://api.github.com/users/thanasisk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanasisk/subscriptions","organizations_url":"https://api.github.com/users/thanasisk/orgs","repos_url":"https://api.github.com/users/thanasisk/repos","events_url":"https://api.github.com/users/thanasisk/events{/privacy}","received_events_url":"https://api.github.com/users/thanasisk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thanasisk/openshift-azure","description":null,"fork":true,"url":"https://api.github.com/repos/thanasisk/openshift-azure","forks_url":"https://api.github.com/repos/thanasisk/openshift-azure/forks","keys_url":"https://api.github.com/repos/thanasisk/openshift-azure/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thanasisk/openshift-azure/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thanasisk/openshift-azure/teams","hooks_url":"https://api.github.com/repos/thanasisk/openshift-azure/hooks","issue_events_url":"https://api.github.com/repos/thanasisk/openshift-azure/issues/events{/number}","events_url":"https://api.github.com/repos/thanasisk/openshift-azure/events","assignees_url":"https://api.github.com/repos/thanasisk/openshift-azure/assignees{/user}","branches_url":"https://api.github.com/repos/thanasisk/openshift-azure/branches{/branch}","tags_url":"https://api.github.com/repos/thanasisk/openshift-azure/tags","blobs_url":"https://api.github.com/repos/thanasisk/openshift-azure/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thanasisk/openshift-azure/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thanasisk/openshift-azure/git/refs{/sha}","trees_url":"https://api.github.com/repos/thanasisk/openshift-azure/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thanasisk/openshift-azure/statuses/{sha}","languages_url":"https://api.github.com/repos/thanasisk/openshift-azure/languages","stargazers_url":"https://api.github.com/repos/thanasisk/openshift-azure/stargazers","contributors_url":"https://api.github.com/repos/thanasisk/openshift-azure/contributors","subscribers_url":"https://api.github.com/repos/thanasisk/openshift-azure/subscribers","subscription_url":"https://api.github.com/repos/thanasisk/openshift-azure/subscription","commits_url":"https://api.github.com/repos/thanasisk/openshift-azure/commits{/sha}","git_commits_url":"https://api.github.com/repos/thanasisk/openshift-azure/git/commits{/sha}","comments_url":"https://api.github.com/repos/thanasisk/openshift-azure/comments{/number}","issue_comment_url":"https://api.github.com/repos/thanasisk/openshift-azure/issues/comments{/number}","contents_url":"https://api.github.com/repos/thanasisk/openshift-azure/contents/{+path}","compare_url":"https://api.github.com/repos/thanasisk/openshift-azure/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thanasisk/openshift-azure/merges","archive_url":"https://api.github.com/repos/thanasisk/openshift-azure/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thanasisk/openshift-azure/downloads","issues_url":"https://api.github.com/repos/thanasisk/openshift-azure/issues{/number}","pulls_url":"https://api.github.com/repos/thanasisk/openshift-azure/pulls{/number}","milestones_url":"https://api.github.com/repos/thanasisk/openshift-azure/milestones{/number}","notifications_url":"https://api.github.com/repos/thanasisk/openshift-azure/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thanasisk/openshift-azure/labels{/name}","releases_url":"https://api.github.com/repos/thanasisk/openshift-azure/releases{/id}","deployments_url":"https://api.github.com/repos/thanasisk/openshift-azure/deployments","created_at":"2018-08-17T10:08:37Z","updated_at":"2018-08-20T10:44:44Z","pushed_at":"2018-08-20T10:44:42Z","git_url":"git://github.com/thanasisk/openshift-azure.git","ssh_url":"git@github.com:thanasisk/openshift-azure.git","clone_url":"https://github.com/thanasisk/openshift-azure.git","svn_url":"https://github.com/thanasisk/openshift-azure","homepage":null,"size":26203,"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":0,"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":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"9827e0ce7562ac4d60eead684666f4c5da562c3a","user":{"login":"openshift","id":792337,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MjMzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/792337?v=4","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":137828518,"node_id":"MDEwOlJlcG9zaXRvcnkxMzc4Mjg1MTg=","name":"openshift-azure","full_name":"openshift/openshift-azure","owner":{"login":"openshift","id":792337,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MjMzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/792337?v=4","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/openshift-azure","description":null,"fork":false,"url":"https://api.github.com/repos/openshift/openshift-azure","forks_url":"https://api.github.com/repos/openshift/openshift-azure/forks","keys_url":"https://api.github.com/repos/openshift/openshift-azure/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/openshift-azure/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/openshift-azure/teams","hooks_url":"https://api.github.com/repos/openshift/openshift-azure/hooks","issue_events_url":"https://api.github.com/repos/openshift/openshift-azure/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/openshift-azure/events","assignees_url":"https://api.github.com/repos/openshift/openshift-azure/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/openshift-azure/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/openshift-azure/tags","blobs_url":"https://api.github.com/repos/openshift/openshift-azure/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/openshift-azure/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/openshift-azure/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/openshift-azure/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/openshift-azure/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/openshift-azure/languages","stargazers_url":"https://api.github.com/repos/openshift/openshift-azure/stargazers","contributors_url":"https://api.github.com/repos/openshift/openshift-azure/contributors","subscribers_url":"https://api.github.com/repos/openshift/openshift-azure/subscribers","subscription_url":"https://api.github.com/repos/openshift/openshift-azure/subscription","commits_url":"https://api.github.com/repos/openshift/openshift-azure/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/openshift-azure/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/openshift-azure/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/openshift-azure/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/openshift-azure/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/openshift-azure/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/openshift-azure/merges","archive_url":"https://api.github.com/repos/openshift/openshift-azure/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/openshift-azure/downloads","issues_url":"https://api.github.com/repos/openshift/openshift-azure/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/openshift-azure/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/openshift-azure/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/openshift-azure/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/openshift-azure/labels{/name}","releases_url":"https://api.github.com/repos/openshift/openshift-azure/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/openshift-azure/deployments","created_at":"2018-06-19T02:11:07Z","updated_at":"2018-08-19T05:18:29Z","pushed_at":"2018-08-20T18:38:58Z","git_url":"git://github.com/openshift/openshift-azure.git","ssh_url":"git@github.com:openshift/openshift-azure.git","clone_url":"https://github.com/openshift/openshift-azure.git","svn_url":"https://github.com/openshift/openshift-azure","homepage":null,"size":26202,"stargazers_count":3,"watchers_count":3,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":27,"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":9,"open_issues":27,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/openshift-azure/pulls/224"},"html":{"href":"https://github.com/openshift/openshift-azure/pull/224"},"issue":{"href":"https://api.github.com/repos/openshift/openshift-azure/issues/224"},"comments":{"href":"https://api.github.com/repos/openshift/openshift-azure/issues/224/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/openshift-azure/pulls/224/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/openshift-azure/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/openshift-azure/pulls/224/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/openshift-azure/statuses/f8508190d7d0cb34a535b4474745388dd15a62ef"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jim-minter"}}