{"action":"created","comment":{"url":"https://api.github.com/repos/coniks-sys/coniks-go/pulls/comments/74177673","id":74177673,"diff_hunk":"@@ -0,0 +1,48 @@\n+package protocol\n+\n+import (\n+\t\"log\"\n+\n+\t\"github.com/coniks-sys/coniks-go/crypto/sign\"\n+\t\"github.com/coniks-sys/coniks-go/merkletree\"\n+)\n+\n+type ConiksUserPolicies struct {\n+\tUsername               string\n+\tAllowUnsignedKeychange bool\n+\tAllowPublicLookup      bool\n+}\n+\n+type ConiksDirectory struct {\n+\t*merkletree.PAD\n+}\n+\n+func InitDirectory(policies merkletree.Policies, signKey sign.PrivateKey,\n+\tdirSize uint64) *ConiksDirectory {\n+\tpad, err := merkletree.NewPAD(policies, signKey, dirSize)\n+\tif err != nil {\n+\t\tpanic(err)\n+\t}\n+\treturn &ConiksDirectory{pad}\n+}\n+\n+func (d *ConiksDirectory) Register(uname string, key []byte) (\n+\t*merkletree.AuthenticationPath, *merkletree.TemporaryBinding, ErrorCode) {\n+\t// check whether the name already exists\n+\t// in the directory before we register\n+\tap, err := d.Lookup(uname)\n+\tif err != nil {\n+\t\treturn nil, nil, ErrorInternalServer\n+\t}\n+\tif ap.Leaf.Value() != nil {","path":"protocol/directory.go","position":null,"original_position":37,"commit_id":"afdf484cd1557ef90587c225fb69f37f5167ee65","original_commit_id":"2f65e19f294b9530bd2307f46a1ea83389a641aa","user":{"login":"arlolra","id":123708,"avatar_url":"https://avatars.githubusercontent.com/u/123708?v=3","gravatar_id":"","url":"https://api.github.com/users/arlolra","html_url":"https://github.com/arlolra","followers_url":"https://api.github.com/users/arlolra/followers","following_url":"https://api.github.com/users/arlolra/following{/other_user}","gists_url":"https://api.github.com/users/arlolra/gists{/gist_id}","starred_url":"https://api.github.com/users/arlolra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arlolra/subscriptions","organizations_url":"https://api.github.com/users/arlolra/orgs","repos_url":"https://api.github.com/users/arlolra/repos","events_url":"https://api.github.com/users/arlolra/events{/privacy}","received_events_url":"https://api.github.com/users/arlolra/received_events","type":"User","site_admin":false},"body":"Unique **to the `uname`**, yes.  Your comment says,\r\n\r\n> check whether the name already exists\r\n\r\nIt's not enough to check that the `Value()` is `nil`, because the `ap.Leaf` can be one of three things,\r\n\r\n - empty\r\n - another leaf with a shared prefix, but `i != j`\r\n - a leaf with `i == j`  // the error case\r\n\r\nThis is the same as the proof of absence / inclusion, but we don't need to verify the auth path, because we're the directory here, not a client, so we trust ourself.\r\n\r\n","created_at":"2016-08-10T02:35:59Z","updated_at":"2016-08-10T02:35:59Z","html_url":"https://github.com/coniks-sys/coniks-go/pull/29#discussion_r74177673","pull_request_url":"https://api.github.com/repos/coniks-sys/coniks-go/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/coniks-sys/coniks-go/pulls/comments/74177673"},"html":{"href":"https://github.com/coniks-sys/coniks-go/pull/29#discussion_r74177673"},"pull_request":{"href":"https://api.github.com/repos/coniks-sys/coniks-go/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/coniks-sys/coniks-go/pulls/29","id":78448807,"html_url":"https://github.com/coniks-sys/coniks-go/pull/29","diff_url":"https://github.com/coniks-sys/coniks-go/pull/29.diff","patch_url":"https://github.com/coniks-sys/coniks-go/pull/29.patch","issue_url":"https://api.github.com/repos/coniks-sys/coniks-go/issues/29","number":29,"state":"open","locked":false,"title":"Implement registration function","user":{"login":"c633","id":5112602,"avatar_url":"https://avatars.githubusercontent.com/u/5112602?v=3","gravatar_id":"","url":"https://api.github.com/users/c633","html_url":"https://github.com/c633","followers_url":"https://api.github.com/users/c633/followers","following_url":"https://api.github.com/users/c633/following{/other_user}","gists_url":"https://api.github.com/users/c633/gists{/gist_id}","starred_url":"https://api.github.com/users/c633/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c633/subscriptions","organizations_url":"https://api.github.com/users/c633/orgs","repos_url":"https://api.github.com/users/c633/repos","events_url":"https://api.github.com/users/c633/events{/privacy}","received_events_url":"https://api.github.com/users/c633/received_events","type":"User","site_admin":false},"body":"* Should resolve #28 ","created_at":"2016-07-22T09:28:25Z","updated_at":"2016-08-10T02:35:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"706c39872fdff2a1251878a74ccc789d2dc60b74","assignee":{"login":"c633","id":5112602,"avatar_url":"https://avatars.githubusercontent.com/u/5112602?v=3","gravatar_id":"","url":"https://api.github.com/users/c633","html_url":"https://github.com/c633","followers_url":"https://api.github.com/users/c633/followers","following_url":"https://api.github.com/users/c633/following{/other_user}","gists_url":"https://api.github.com/users/c633/gists{/gist_id}","starred_url":"https://api.github.com/users/c633/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c633/subscriptions","organizations_url":"https://api.github.com/users/c633/orgs","repos_url":"https://api.github.com/users/c633/repos","events_url":"https://api.github.com/users/c633/events{/privacy}","received_events_url":"https://api.github.com/users/c633/received_events","type":"User","site_admin":false},"assignees":[{"login":"c633","id":5112602,"avatar_url":"https://avatars.githubusercontent.com/u/5112602?v=3","gravatar_id":"","url":"https://api.github.com/users/c633","html_url":"https://github.com/c633","followers_url":"https://api.github.com/users/c633/followers","following_url":"https://api.github.com/users/c633/following{/other_user}","gists_url":"https://api.github.com/users/c633/gists{/gist_id}","starred_url":"https://api.github.com/users/c633/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c633/subscriptions","organizations_url":"https://api.github.com/users/c633/orgs","repos_url":"https://api.github.com/users/c633/repos","events_url":"https://api.github.com/users/c633/events{/privacy}","received_events_url":"https://api.github.com/users/c633/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/coniks-sys/coniks-go/pulls/29/commits","review_comments_url":"https://api.github.com/repos/coniks-sys/coniks-go/pulls/29/comments","review_comment_url":"https://api.github.com/repos/coniks-sys/coniks-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coniks-sys/coniks-go/issues/29/comments","statuses_url":"https://api.github.com/repos/coniks-sys/coniks-go/statuses/afdf484cd1557ef90587c225fb69f37f5167ee65","head":{"label":"coniks-sys:server-registration","ref":"server-registration","sha":"afdf484cd1557ef90587c225fb69f37f5167ee65","user":{"login":"coniks-sys","id":11236504,"avatar_url":"https://avatars.githubusercontent.com/u/11236504?v=3","gravatar_id":"","url":"https://api.github.com/users/coniks-sys","html_url":"https://github.com/coniks-sys","followers_url":"https://api.github.com/users/coniks-sys/followers","following_url":"https://api.github.com/users/coniks-sys/following{/other_user}","gists_url":"https://api.github.com/users/coniks-sys/gists{/gist_id}","starred_url":"https://api.github.com/users/coniks-sys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coniks-sys/subscriptions","organizations_url":"https://api.github.com/users/coniks-sys/orgs","repos_url":"https://api.github.com/users/coniks-sys/repos","events_url":"https://api.github.com/users/coniks-sys/events{/privacy}","received_events_url":"https://api.github.com/users/coniks-sys/received_events","type":"Organization","site_admin":false},"repo":{"id":60117979,"name":"coniks-go","full_name":"coniks-sys/coniks-go","owner":{"login":"coniks-sys","id":11236504,"avatar_url":"https://avatars.githubusercontent.com/u/11236504?v=3","gravatar_id":"","url":"https://api.github.com/users/coniks-sys","html_url":"https://github.com/coniks-sys","followers_url":"https://api.github.com/users/coniks-sys/followers","following_url":"https://api.github.com/users/coniks-sys/following{/other_user}","gists_url":"https://api.github.com/users/coniks-sys/gists{/gist_id}","starred_url":"https://api.github.com/users/coniks-sys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coniks-sys/subscriptions","organizations_url":"https://api.github.com/users/coniks-sys/orgs","repos_url":"https://api.github.com/users/coniks-sys/repos","events_url":"https://api.github.com/users/coniks-sys/events{/privacy}","received_events_url":"https://api.github.com/users/coniks-sys/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coniks-sys/coniks-go","description":"A CONIKS implementation in Golang","fork":false,"url":"https://api.github.com/repos/coniks-sys/coniks-go","forks_url":"https://api.github.com/repos/coniks-sys/coniks-go/forks","keys_url":"https://api.github.com/repos/coniks-sys/coniks-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coniks-sys/coniks-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coniks-sys/coniks-go/teams","hooks_url":"https://api.github.com/repos/coniks-sys/coniks-go/hooks","issue_events_url":"https://api.github.com/repos/coniks-sys/coniks-go/issues/events{/number}","events_url":"https://api.github.com/repos/coniks-sys/coniks-go/events","assignees_url":"https://api.github.com/repos/coniks-sys/coniks-go/assignees{/user}","branches_url":"https://api.github.com/repos/coniks-sys/coniks-go/branches{/branch}","tags_url":"https://api.github.com/repos/coniks-sys/coniks-go/tags","blobs_url":"https://api.github.com/repos/coniks-sys/coniks-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coniks-sys/coniks-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coniks-sys/coniks-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/coniks-sys/coniks-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coniks-sys/coniks-go/statuses/{sha}","languages_url":"https://api.github.com/repos/coniks-sys/coniks-go/languages","stargazers_url":"https://api.github.com/repos/coniks-sys/coniks-go/stargazers","contributors_url":"https://api.github.com/repos/coniks-sys/coniks-go/contributors","subscribers_url":"https://api.github.com/repos/coniks-sys/coniks-go/subscribers","subscription_url":"https://api.github.com/repos/coniks-sys/coniks-go/subscription","commits_url":"https://api.github.com/repos/coniks-sys/coniks-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/coniks-sys/coniks-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/coniks-sys/coniks-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/coniks-sys/coniks-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/coniks-sys/coniks-go/contents/{+path}","compare_url":"https://api.github.com/repos/coniks-sys/coniks-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coniks-sys/coniks-go/merges","archive_url":"https://api.github.com/repos/coniks-sys/coniks-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coniks-sys/coniks-go/downloads","issues_url":"https://api.github.com/repos/coniks-sys/coniks-go/issues{/number}","pulls_url":"https://api.github.com/repos/coniks-sys/coniks-go/pulls{/number}","milestones_url":"https://api.github.com/repos/coniks-sys/coniks-go/milestones{/number}","notifications_url":"https://api.github.com/repos/coniks-sys/coniks-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coniks-sys/coniks-go/labels{/name}","releases_url":"https://api.github.com/repos/coniks-sys/coniks-go/releases{/id}","deployments_url":"https://api.github.com/repos/coniks-sys/coniks-go/deployments","created_at":"2016-05-31T19:37:35Z","updated_at":"2016-08-01T23:04:58Z","pushed_at":"2016-08-10T02:05:05Z","git_url":"git://github.com/coniks-sys/coniks-go.git","ssh_url":"git@github.com:coniks-sys/coniks-go.git","clone_url":"https://github.com/coniks-sys/coniks-go.git","svn_url":"https://github.com/coniks-sys/coniks-go","homepage":"http://coniks.org","size":298,"stargazers_count":8,"watchers_count":8,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":22,"forks":0,"open_issues":22,"watchers":8,"default_branch":"master"}},"base":{"label":"coniks-sys:master","ref":"master","sha":"c66c8b1090e8f0e0ca6d726ca2aba4e30d27b966","user":{"login":"coniks-sys","id":11236504,"avatar_url":"https://avatars.githubusercontent.com/u/11236504?v=3","gravatar_id":"","url":"https://api.github.com/users/coniks-sys","html_url":"https://github.com/coniks-sys","followers_url":"https://api.github.com/users/coniks-sys/followers","following_url":"https://api.github.com/users/coniks-sys/following{/other_user}","gists_url":"https://api.github.com/users/coniks-sys/gists{/gist_id}","starred_url":"https://api.github.com/users/coniks-sys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coniks-sys/subscriptions","organizations_url":"https://api.github.com/users/coniks-sys/orgs","repos_url":"https://api.github.com/users/coniks-sys/repos","events_url":"https://api.github.com/users/coniks-sys/events{/privacy}","received_events_url":"https://api.github.com/users/coniks-sys/received_events","type":"Organization","site_admin":false},"repo":{"id":60117979,"name":"coniks-go","full_name":"coniks-sys/coniks-go","owner":{"login":"coniks-sys","id":11236504,"avatar_url":"https://avatars.githubusercontent.com/u/11236504?v=3","gravatar_id":"","url":"https://api.github.com/users/coniks-sys","html_url":"https://github.com/coniks-sys","followers_url":"https://api.github.com/users/coniks-sys/followers","following_url":"https://api.github.com/users/coniks-sys/following{/other_user}","gists_url":"https://api.github.com/users/coniks-sys/gists{/gist_id}","starred_url":"https://api.github.com/users/coniks-sys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coniks-sys/subscriptions","organizations_url":"https://api.github.com/users/coniks-sys/orgs","repos_url":"https://api.github.com/users/coniks-sys/repos","events_url":"https://api.github.com/users/coniks-sys/events{/privacy}","received_events_url":"https://api.github.com/users/coniks-sys/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coniks-sys/coniks-go","description":"A CONIKS implementation in Golang","fork":false,"url":"https://api.github.com/repos/coniks-sys/coniks-go","forks_url":"https://api.github.com/repos/coniks-sys/coniks-go/forks","keys_url":"https://api.github.com/repos/coniks-sys/coniks-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coniks-sys/coniks-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coniks-sys/coniks-go/teams","hooks_url":"https://api.github.com/repos/coniks-sys/coniks-go/hooks","issue_events_url":"https://api.github.com/repos/coniks-sys/coniks-go/issues/events{/number}","events_url":"https://api.github.com/repos/coniks-sys/coniks-go/events","assignees_url":"https://api.github.com/repos/coniks-sys/coniks-go/assignees{/user}","branches_url":"https://api.github.com/repos/coniks-sys/coniks-go/branches{/branch}","tags_url":"https://api.github.com/repos/coniks-sys/coniks-go/tags","blobs_url":"https://api.github.com/repos/coniks-sys/coniks-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coniks-sys/coniks-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coniks-sys/coniks-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/coniks-sys/coniks-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coniks-sys/coniks-go/statuses/{sha}","languages_url":"https://api.github.com/repos/coniks-sys/coniks-go/languages","stargazers_url":"https://api.github.com/repos/coniks-sys/coniks-go/stargazers","contributors_url":"https://api.github.com/repos/coniks-sys/coniks-go/contributors","subscribers_url":"https://api.github.com/repos/coniks-sys/coniks-go/subscribers","subscription_url":"https://api.github.com/repos/coniks-sys/coniks-go/subscription","commits_url":"https://api.github.com/repos/coniks-sys/coniks-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/coniks-sys/coniks-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/coniks-sys/coniks-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/coniks-sys/coniks-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/coniks-sys/coniks-go/contents/{+path}","compare_url":"https://api.github.com/repos/coniks-sys/coniks-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coniks-sys/coniks-go/merges","archive_url":"https://api.github.com/repos/coniks-sys/coniks-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coniks-sys/coniks-go/downloads","issues_url":"https://api.github.com/repos/coniks-sys/coniks-go/issues{/number}","pulls_url":"https://api.github.com/repos/coniks-sys/coniks-go/pulls{/number}","milestones_url":"https://api.github.com/repos/coniks-sys/coniks-go/milestones{/number}","notifications_url":"https://api.github.com/repos/coniks-sys/coniks-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coniks-sys/coniks-go/labels{/name}","releases_url":"https://api.github.com/repos/coniks-sys/coniks-go/releases{/id}","deployments_url":"https://api.github.com/repos/coniks-sys/coniks-go/deployments","created_at":"2016-05-31T19:37:35Z","updated_at":"2016-08-01T23:04:58Z","pushed_at":"2016-08-10T02:05:05Z","git_url":"git://github.com/coniks-sys/coniks-go.git","ssh_url":"git@github.com:coniks-sys/coniks-go.git","clone_url":"https://github.com/coniks-sys/coniks-go.git","svn_url":"https://github.com/coniks-sys/coniks-go","homepage":"http://coniks.org","size":298,"stargazers_count":8,"watchers_count":8,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":22,"forks":0,"open_issues":22,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coniks-sys/coniks-go/pulls/29"},"html":{"href":"https://github.com/coniks-sys/coniks-go/pull/29"},"issue":{"href":"https://api.github.com/repos/coniks-sys/coniks-go/issues/29"},"comments":{"href":"https://api.github.com/repos/coniks-sys/coniks-go/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/coniks-sys/coniks-go/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/coniks-sys/coniks-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coniks-sys/coniks-go/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/coniks-sys/coniks-go/statuses/afdf484cd1557ef90587c225fb69f37f5167ee65"}}}}
{"actor":{"display_login":"arlolra"}}