{"action":"created","comment":{"url":"https://api.github.com/repos/globalsign/mgo/pulls/comments/147668101","pull_request_review_id":72788970,"id":147668101,"diff_hunk":"@@ -5212,3 +5226,67 @@ func hasErrMsg(d []byte) bool {\n \t}\n \treturn false\n }\n+\n+// getRFC2253NameString converts from an ASN.1 structured representation of the certificate\n+// to a UTF-8 string representation(RDN) and returns it.\n+func getRFC2253NameString(certificate *x509.Certificate) string {\n+\tvar RDNElementsASN1 = pkix.RDNSequence{}\n+\tasn1.Unmarshal(certificate.RawSubject, &RDNElementsASN1)\n+\n+\tvar RDNElementsString = []string{}\n+\tfor i := len(RDNElementsASN1) - 1; i >= 0; i-- {\n+\t\tvar nameAndValueList = []string{}\n+\t\tfor _, attribute := range RDNElementsASN1[i] {\n+\t\t\tvar shortAttributeName = rdnOIDToShortName(attribute.Type)\n+\t\t\tif len(shortAttributeName) > 0 {\n+\t\t\t\tvar attributeValueString = attribute.Value.(string)\n+\t\t\t\t// escape leading space or #\n+\t\t\t\tif strings.IndexAny(attributeValueString, \" #\") == 0 {","path":"session.go","position":54,"original_position":54,"commit_id":"53fe0ae5166934b524779cef7df16920ff1aaab5","original_commit_id":"53fe0ae5166934b524779cef7df16920ff1aaab5","user":{"login":"domodwyer","id":9275968,"avatar_url":"https://avatars1.githubusercontent.com/u/9275968?v=4","gravatar_id":"","url":"https://api.github.com/users/domodwyer","html_url":"https://github.com/domodwyer","followers_url":"https://api.github.com/users/domodwyer/followers","following_url":"https://api.github.com/users/domodwyer/following{/other_user}","gists_url":"https://api.github.com/users/domodwyer/gists{/gist_id}","starred_url":"https://api.github.com/users/domodwyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domodwyer/subscriptions","organizations_url":"https://api.github.com/users/domodwyer/orgs","repos_url":"https://api.github.com/users/domodwyer/repos","events_url":"https://api.github.com/users/domodwyer/events{/privacy}","received_events_url":"https://api.github.com/users/domodwyer/received_events","type":"User","site_admin":false},"body":"`strings.HasPrefix()` would be more efficient here.","created_at":"2017-10-30T10:46:08Z","updated_at":"2017-10-30T10:46:54Z","html_url":"https://github.com/globalsign/mgo/pull/55#discussion_r147668101","pull_request_url":"https://api.github.com/repos/globalsign/mgo/pulls/55","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/globalsign/mgo/pulls/comments/147668101"},"html":{"href":"https://github.com/globalsign/mgo/pull/55#discussion_r147668101"},"pull_request":{"href":"https://api.github.com/repos/globalsign/mgo/pulls/55"}}},"pull_request":{"url":"https://api.github.com/repos/globalsign/mgo/pulls/55","id":149236299,"html_url":"https://github.com/globalsign/mgo/pull/55","diff_url":"https://github.com/globalsign/mgo/pull/55.diff","patch_url":"https://github.com/globalsign/mgo/pull/55.patch","issue_url":"https://api.github.com/repos/globalsign/mgo/issues/55","number":55,"state":"open","locked":false,"title":"Add proper DN construction","user":{"login":"csucu","id":12073471,"avatar_url":"https://avatars3.githubusercontent.com/u/12073471?v=4","gravatar_id":"","url":"https://api.github.com/users/csucu","html_url":"https://github.com/csucu","followers_url":"https://api.github.com/users/csucu/followers","following_url":"https://api.github.com/users/csucu/following{/other_user}","gists_url":"https://api.github.com/users/csucu/gists{/gist_id}","starred_url":"https://api.github.com/users/csucu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csucu/subscriptions","organizations_url":"https://api.github.com/users/csucu/orgs","repos_url":"https://api.github.com/users/csucu/repos","events_url":"https://api.github.com/users/csucu/events{/privacy}","received_events_url":"https://api.github.com/users/csucu/received_events","type":"User","site_admin":false},"body":"Added RDN construction for TLS authentication.","created_at":"2017-10-27T16:46:27Z","updated_at":"2017-10-30T10:46:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"69ac041b6b762296bf09249fda4f1708a4c1e28f","assignee":{"login":"csucu","id":12073471,"avatar_url":"https://avatars3.githubusercontent.com/u/12073471?v=4","gravatar_id":"","url":"https://api.github.com/users/csucu","html_url":"https://github.com/csucu","followers_url":"https://api.github.com/users/csucu/followers","following_url":"https://api.github.com/users/csucu/following{/other_user}","gists_url":"https://api.github.com/users/csucu/gists{/gist_id}","starred_url":"https://api.github.com/users/csucu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csucu/subscriptions","organizations_url":"https://api.github.com/users/csucu/orgs","repos_url":"https://api.github.com/users/csucu/repos","events_url":"https://api.github.com/users/csucu/events{/privacy}","received_events_url":"https://api.github.com/users/csucu/received_events","type":"User","site_admin":false},"assignees":[{"login":"csucu","id":12073471,"avatar_url":"https://avatars3.githubusercontent.com/u/12073471?v=4","gravatar_id":"","url":"https://api.github.com/users/csucu","html_url":"https://github.com/csucu","followers_url":"https://api.github.com/users/csucu/followers","following_url":"https://api.github.com/users/csucu/following{/other_user}","gists_url":"https://api.github.com/users/csucu/gists{/gist_id}","starred_url":"https://api.github.com/users/csucu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csucu/subscriptions","organizations_url":"https://api.github.com/users/csucu/orgs","repos_url":"https://api.github.com/users/csucu/repos","events_url":"https://api.github.com/users/csucu/events{/privacy}","received_events_url":"https://api.github.com/users/csucu/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"szank","id":773802,"avatar_url":"https://avatars3.githubusercontent.com/u/773802?v=4","gravatar_id":"","url":"https://api.github.com/users/szank","html_url":"https://github.com/szank","followers_url":"https://api.github.com/users/szank/followers","following_url":"https://api.github.com/users/szank/following{/other_user}","gists_url":"https://api.github.com/users/szank/gists{/gist_id}","starred_url":"https://api.github.com/users/szank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szank/subscriptions","organizations_url":"https://api.github.com/users/szank/orgs","repos_url":"https://api.github.com/users/szank/repos","events_url":"https://api.github.com/users/szank/events{/privacy}","received_events_url":"https://api.github.com/users/szank/received_events","type":"User","site_admin":false},{"login":"vgalu","id":4678183,"avatar_url":"https://avatars3.githubusercontent.com/u/4678183?v=4","gravatar_id":"","url":"https://api.github.com/users/vgalu","html_url":"https://github.com/vgalu","followers_url":"https://api.github.com/users/vgalu/followers","following_url":"https://api.github.com/users/vgalu/following{/other_user}","gists_url":"https://api.github.com/users/vgalu/gists{/gist_id}","starred_url":"https://api.github.com/users/vgalu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgalu/subscriptions","organizations_url":"https://api.github.com/users/vgalu/orgs","repos_url":"https://api.github.com/users/vgalu/repos","events_url":"https://api.github.com/users/vgalu/events{/privacy}","received_events_url":"https://api.github.com/users/vgalu/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/globalsign/mgo/pulls/55/commits","review_comments_url":"https://api.github.com/repos/globalsign/mgo/pulls/55/comments","review_comment_url":"https://api.github.com/repos/globalsign/mgo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/globalsign/mgo/issues/55/comments","statuses_url":"https://api.github.com/repos/globalsign/mgo/statuses/53fe0ae5166934b524779cef7df16920ff1aaab5","head":{"label":"globalsign:feature/rdnconstruction","ref":"feature/rdnconstruction","sha":"53fe0ae5166934b524779cef7df16920ff1aaab5","user":{"login":"globalsign","id":1440101,"avatar_url":"https://avatars1.githubusercontent.com/u/1440101?v=4","gravatar_id":"","url":"https://api.github.com/users/globalsign","html_url":"https://github.com/globalsign","followers_url":"https://api.github.com/users/globalsign/followers","following_url":"https://api.github.com/users/globalsign/following{/other_user}","gists_url":"https://api.github.com/users/globalsign/gists{/gist_id}","starred_url":"https://api.github.com/users/globalsign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globalsign/subscriptions","organizations_url":"https://api.github.com/users/globalsign/orgs","repos_url":"https://api.github.com/users/globalsign/repos","events_url":"https://api.github.com/users/globalsign/events{/privacy}","received_events_url":"https://api.github.com/users/globalsign/received_events","type":"Organization","site_admin":false},"repo":{"id":88156832,"name":"mgo","full_name":"globalsign/mgo","owner":{"login":"globalsign","id":1440101,"avatar_url":"https://avatars1.githubusercontent.com/u/1440101?v=4","gravatar_id":"","url":"https://api.github.com/users/globalsign","html_url":"https://github.com/globalsign","followers_url":"https://api.github.com/users/globalsign/followers","following_url":"https://api.github.com/users/globalsign/following{/other_user}","gists_url":"https://api.github.com/users/globalsign/gists{/gist_id}","starred_url":"https://api.github.com/users/globalsign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globalsign/subscriptions","organizations_url":"https://api.github.com/users/globalsign/orgs","repos_url":"https://api.github.com/users/globalsign/repos","events_url":"https://api.github.com/users/globalsign/events{/privacy}","received_events_url":"https://api.github.com/users/globalsign/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/globalsign/mgo","description":"The MongoDB driver for Go","fork":true,"url":"https://api.github.com/repos/globalsign/mgo","forks_url":"https://api.github.com/repos/globalsign/mgo/forks","keys_url":"https://api.github.com/repos/globalsign/mgo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/globalsign/mgo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/globalsign/mgo/teams","hooks_url":"https://api.github.com/repos/globalsign/mgo/hooks","issue_events_url":"https://api.github.com/repos/globalsign/mgo/issues/events{/number}","events_url":"https://api.github.com/repos/globalsign/mgo/events","assignees_url":"https://api.github.com/repos/globalsign/mgo/assignees{/user}","branches_url":"https://api.github.com/repos/globalsign/mgo/branches{/branch}","tags_url":"https://api.github.com/repos/globalsign/mgo/tags","blobs_url":"https://api.github.com/repos/globalsign/mgo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/globalsign/mgo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/globalsign/mgo/git/refs{/sha}","trees_url":"https://api.github.com/repos/globalsign/mgo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/globalsign/mgo/statuses/{sha}","languages_url":"https://api.github.com/repos/globalsign/mgo/languages","stargazers_url":"https://api.github.com/repos/globalsign/mgo/stargazers","contributors_url":"https://api.github.com/repos/globalsign/mgo/contributors","subscribers_url":"https://api.github.com/repos/globalsign/mgo/subscribers","subscription_url":"https://api.github.com/repos/globalsign/mgo/subscription","commits_url":"https://api.github.com/repos/globalsign/mgo/commits{/sha}","git_commits_url":"https://api.github.com/repos/globalsign/mgo/git/commits{/sha}","comments_url":"https://api.github.com/repos/globalsign/mgo/comments{/number}","issue_comment_url":"https://api.github.com/repos/globalsign/mgo/issues/comments{/number}","contents_url":"https://api.github.com/repos/globalsign/mgo/contents/{+path}","compare_url":"https://api.github.com/repos/globalsign/mgo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/globalsign/mgo/merges","archive_url":"https://api.github.com/repos/globalsign/mgo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/globalsign/mgo/downloads","issues_url":"https://api.github.com/repos/globalsign/mgo/issues{/number}","pulls_url":"https://api.github.com/repos/globalsign/mgo/pulls{/number}","milestones_url":"https://api.github.com/repos/globalsign/mgo/milestones{/number}","notifications_url":"https://api.github.com/repos/globalsign/mgo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/globalsign/mgo/labels{/name}","releases_url":"https://api.github.com/repos/globalsign/mgo/releases{/id}","deployments_url":"https://api.github.com/repos/globalsign/mgo/deployments","created_at":"2017-04-13T11:14:04Z","updated_at":"2017-10-26T15:43:13Z","pushed_at":"2017-10-29T17:34:01Z","git_url":"git://github.com/globalsign/mgo.git","ssh_url":"git@github.com:globalsign/mgo.git","clone_url":"https://github.com/globalsign/mgo.git","svn_url":"https://github.com/globalsign/mgo","homepage":"","size":6677,"stargazers_count":35,"watchers_count":35,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":35,"default_branch":"master"}},"base":{"label":"globalsign:development","ref":"development","sha":"0454966c021aa1737c9680aceef7e2ba26952fe3","user":{"login":"globalsign","id":1440101,"avatar_url":"https://avatars1.githubusercontent.com/u/1440101?v=4","gravatar_id":"","url":"https://api.github.com/users/globalsign","html_url":"https://github.com/globalsign","followers_url":"https://api.github.com/users/globalsign/followers","following_url":"https://api.github.com/users/globalsign/following{/other_user}","gists_url":"https://api.github.com/users/globalsign/gists{/gist_id}","starred_url":"https://api.github.com/users/globalsign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globalsign/subscriptions","organizations_url":"https://api.github.com/users/globalsign/orgs","repos_url":"https://api.github.com/users/globalsign/repos","events_url":"https://api.github.com/users/globalsign/events{/privacy}","received_events_url":"https://api.github.com/users/globalsign/received_events","type":"Organization","site_admin":false},"repo":{"id":88156832,"name":"mgo","full_name":"globalsign/mgo","owner":{"login":"globalsign","id":1440101,"avatar_url":"https://avatars1.githubusercontent.com/u/1440101?v=4","gravatar_id":"","url":"https://api.github.com/users/globalsign","html_url":"https://github.com/globalsign","followers_url":"https://api.github.com/users/globalsign/followers","following_url":"https://api.github.com/users/globalsign/following{/other_user}","gists_url":"https://api.github.com/users/globalsign/gists{/gist_id}","starred_url":"https://api.github.com/users/globalsign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globalsign/subscriptions","organizations_url":"https://api.github.com/users/globalsign/orgs","repos_url":"https://api.github.com/users/globalsign/repos","events_url":"https://api.github.com/users/globalsign/events{/privacy}","received_events_url":"https://api.github.com/users/globalsign/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/globalsign/mgo","description":"The MongoDB driver for Go","fork":true,"url":"https://api.github.com/repos/globalsign/mgo","forks_url":"https://api.github.com/repos/globalsign/mgo/forks","keys_url":"https://api.github.com/repos/globalsign/mgo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/globalsign/mgo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/globalsign/mgo/teams","hooks_url":"https://api.github.com/repos/globalsign/mgo/hooks","issue_events_url":"https://api.github.com/repos/globalsign/mgo/issues/events{/number}","events_url":"https://api.github.com/repos/globalsign/mgo/events","assignees_url":"https://api.github.com/repos/globalsign/mgo/assignees{/user}","branches_url":"https://api.github.com/repos/globalsign/mgo/branches{/branch}","tags_url":"https://api.github.com/repos/globalsign/mgo/tags","blobs_url":"https://api.github.com/repos/globalsign/mgo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/globalsign/mgo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/globalsign/mgo/git/refs{/sha}","trees_url":"https://api.github.com/repos/globalsign/mgo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/globalsign/mgo/statuses/{sha}","languages_url":"https://api.github.com/repos/globalsign/mgo/languages","stargazers_url":"https://api.github.com/repos/globalsign/mgo/stargazers","contributors_url":"https://api.github.com/repos/globalsign/mgo/contributors","subscribers_url":"https://api.github.com/repos/globalsign/mgo/subscribers","subscription_url":"https://api.github.com/repos/globalsign/mgo/subscription","commits_url":"https://api.github.com/repos/globalsign/mgo/commits{/sha}","git_commits_url":"https://api.github.com/repos/globalsign/mgo/git/commits{/sha}","comments_url":"https://api.github.com/repos/globalsign/mgo/comments{/number}","issue_comment_url":"https://api.github.com/repos/globalsign/mgo/issues/comments{/number}","contents_url":"https://api.github.com/repos/globalsign/mgo/contents/{+path}","compare_url":"https://api.github.com/repos/globalsign/mgo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/globalsign/mgo/merges","archive_url":"https://api.github.com/repos/globalsign/mgo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/globalsign/mgo/downloads","issues_url":"https://api.github.com/repos/globalsign/mgo/issues{/number}","pulls_url":"https://api.github.com/repos/globalsign/mgo/pulls{/number}","milestones_url":"https://api.github.com/repos/globalsign/mgo/milestones{/number}","notifications_url":"https://api.github.com/repos/globalsign/mgo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/globalsign/mgo/labels{/name}","releases_url":"https://api.github.com/repos/globalsign/mgo/releases{/id}","deployments_url":"https://api.github.com/repos/globalsign/mgo/deployments","created_at":"2017-04-13T11:14:04Z","updated_at":"2017-10-26T15:43:13Z","pushed_at":"2017-10-29T17:34:01Z","git_url":"git://github.com/globalsign/mgo.git","ssh_url":"git@github.com:globalsign/mgo.git","clone_url":"https://github.com/globalsign/mgo.git","svn_url":"https://github.com/globalsign/mgo","homepage":"","size":6677,"stargazers_count":35,"watchers_count":35,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/globalsign/mgo/pulls/55"},"html":{"href":"https://github.com/globalsign/mgo/pull/55"},"issue":{"href":"https://api.github.com/repos/globalsign/mgo/issues/55"},"comments":{"href":"https://api.github.com/repos/globalsign/mgo/issues/55/comments"},"review_comments":{"href":"https://api.github.com/repos/globalsign/mgo/pulls/55/comments"},"review_comment":{"href":"https://api.github.com/repos/globalsign/mgo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/globalsign/mgo/pulls/55/commits"},"statuses":{"href":"https://api.github.com/repos/globalsign/mgo/statuses/53fe0ae5166934b524779cef7df16920ff1aaab5"}},"author_association":"NONE"}}
{"actor":{"display_login":"domodwyer"}}