{"action":"created","comment":{"url":"https://api.github.com/repos/ipfs/go-cid/pulls/comments/197647763","pull_request_review_id":131431380,"id":197647763,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzY0Nzc2Mw==","diff_hunk":"@@ -0,0 +1,61 @@\n+package cid\n+\n+import (\n+\t\"fmt\"\n+\n+\tmh \"github.com/multiformats/go-multihash\"\n+)\n+\n+var ErrPossiblyInsecureHashFunction = fmt.Errorf(\"potentially insecure hash functions not allowed\")\n+var ErrBelowMinimumHashLength = fmt.Errorf(\"hashes must be at least bytes long\")\n+\n+const minimumHashLength = 20\n+\n+var goodset = map[uint64]bool{\n+\tmh.SHA2_256:     true,\n+\tmh.SHA2_512:     true,\n+\tmh.SHA3_224:     true,\n+\tmh.SHA3_256:     true,\n+\tmh.SHA3_384:     true,\n+\tmh.SHA3_512:     true,\n+\tmh.SHAKE_256:    true,\n+\tmh.DBL_SHA2_256: true,\n+\tmh.KECCAK_224:   true,\n+\tmh.KECCAK_256:   true,\n+\tmh.KECCAK_384:   true,\n+\tmh.KECCAK_512:   true,\n+\tmh.ID:           true,\n+\n+\tmh.SHA1: true, // not really secure but still useful","path":"validate.go","position":29,"original_position":29,"commit_id":"2f731f06e4566de92d0dbf753fd4fcc2ea5dcc1a","original_commit_id":"2f731f06e4566de92d0dbf753fd4fcc2ea5dcc1a","user":{"login":"kevina","id":1271492,"node_id":"MDQ6VXNlcjEyNzE0OTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1271492?v=4","gravatar_id":"","url":"https://api.github.com/users/kevina","html_url":"https://github.com/kevina","followers_url":"https://api.github.com/users/kevina/followers","following_url":"https://api.github.com/users/kevina/following{/other_user}","gists_url":"https://api.github.com/users/kevina/gists{/gist_id}","starred_url":"https://api.github.com/users/kevina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevina/subscriptions","organizations_url":"https://api.github.com/users/kevina/orgs","repos_url":"https://api.github.com/users/kevina/repos","events_url":"https://api.github.com/users/kevina/events{/privacy}","received_events_url":"https://api.github.com/users/kevina/received_events","type":"User","site_admin":false},"body":"I don't necessary agree with this unless we are 100% sure SHA-1 are not used anywhere outside of git.  Otherwise we could break things, badly.\r\n","created_at":"2018-06-24T17:55:08Z","updated_at":"2018-06-24T17:55:08Z","html_url":"https://github.com/ipfs/go-cid/pull/40#discussion_r197647763","pull_request_url":"https://api.github.com/repos/ipfs/go-cid/pulls/40","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ipfs/go-cid/pulls/comments/197647763"},"html":{"href":"https://github.com/ipfs/go-cid/pull/40#discussion_r197647763"},"pull_request":{"href":"https://api.github.com/repos/ipfs/go-cid/pulls/40"}},"in_reply_to_id":195894053},"pull_request":{"url":"https://api.github.com/repos/ipfs/go-cid/pulls/40","id":170872957,"node_id":"MDExOlB1bGxSZXF1ZXN0MTcwODcyOTU3","html_url":"https://github.com/ipfs/go-cid/pull/40","diff_url":"https://github.com/ipfs/go-cid/pull/40.diff","patch_url":"https://github.com/ipfs/go-cid/pull/40.patch","issue_url":"https://api.github.com/repos/ipfs/go-cid/issues/40","number":40,"state":"open","locked":false,"title":"Only allow crypto-safe hashes to be used in CIDs","user":{"login":"whyrusleeping","id":1243164,"node_id":"MDQ6VXNlcjEyNDMxNjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1243164?v=4","gravatar_id":"","url":"https://api.github.com/users/whyrusleeping","html_url":"https://github.com/whyrusleeping","followers_url":"https://api.github.com/users/whyrusleeping/followers","following_url":"https://api.github.com/users/whyrusleeping/following{/other_user}","gists_url":"https://api.github.com/users/whyrusleeping/gists{/gist_id}","starred_url":"https://api.github.com/users/whyrusleeping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whyrusleeping/subscriptions","organizations_url":"https://api.github.com/users/whyrusleeping/orgs","repos_url":"https://api.github.com/users/whyrusleeping/repos","events_url":"https://api.github.com/users/whyrusleeping/events{/privacy}","received_events_url":"https://api.github.com/users/whyrusleeping/received_events","type":"User","site_admin":false},"body":"This is a WIP solution to go-ipfs#4371","created_at":"2018-02-22T21:38:03Z","updated_at":"2018-06-24T17:55:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00cd928a375a40900d10fadd6f3c37a459c3bc40","assignee":{"login":"whyrusleeping","id":1243164,"node_id":"MDQ6VXNlcjEyNDMxNjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1243164?v=4","gravatar_id":"","url":"https://api.github.com/users/whyrusleeping","html_url":"https://github.com/whyrusleeping","followers_url":"https://api.github.com/users/whyrusleeping/followers","following_url":"https://api.github.com/users/whyrusleeping/following{/other_user}","gists_url":"https://api.github.com/users/whyrusleeping/gists{/gist_id}","starred_url":"https://api.github.com/users/whyrusleeping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whyrusleeping/subscriptions","organizations_url":"https://api.github.com/users/whyrusleeping/orgs","repos_url":"https://api.github.com/users/whyrusleeping/repos","events_url":"https://api.github.com/users/whyrusleeping/events{/privacy}","received_events_url":"https://api.github.com/users/whyrusleeping/received_events","type":"User","site_admin":false},"assignees":[{"login":"whyrusleeping","id":1243164,"node_id":"MDQ6VXNlcjEyNDMxNjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1243164?v=4","gravatar_id":"","url":"https://api.github.com/users/whyrusleeping","html_url":"https://github.com/whyrusleeping","followers_url":"https://api.github.com/users/whyrusleeping/followers","following_url":"https://api.github.com/users/whyrusleeping/following{/other_user}","gists_url":"https://api.github.com/users/whyrusleeping/gists{/gist_id}","starred_url":"https://api.github.com/users/whyrusleeping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whyrusleeping/subscriptions","organizations_url":"https://api.github.com/users/whyrusleeping/orgs","repos_url":"https://api.github.com/users/whyrusleeping/repos","events_url":"https://api.github.com/users/whyrusleeping/events{/privacy}","received_events_url":"https://api.github.com/users/whyrusleeping/received_events","type":"User","site_admin":false},{"login":"Kubuxu","id":2259282,"node_id":"MDQ6VXNlcjIyNTkyODI=","avatar_url":"https://avatars3.githubusercontent.com/u/2259282?v=4","gravatar_id":"","url":"https://api.github.com/users/Kubuxu","html_url":"https://github.com/Kubuxu","followers_url":"https://api.github.com/users/Kubuxu/followers","following_url":"https://api.github.com/users/Kubuxu/following{/other_user}","gists_url":"https://api.github.com/users/Kubuxu/gists{/gist_id}","starred_url":"https://api.github.com/users/Kubuxu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kubuxu/subscriptions","organizations_url":"https://api.github.com/users/Kubuxu/orgs","repos_url":"https://api.github.com/users/Kubuxu/repos","events_url":"https://api.github.com/users/Kubuxu/events{/privacy}","received_events_url":"https://api.github.com/users/Kubuxu/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"kevina","id":1271492,"node_id":"MDQ6VXNlcjEyNzE0OTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1271492?v=4","gravatar_id":"","url":"https://api.github.com/users/kevina","html_url":"https://github.com/kevina","followers_url":"https://api.github.com/users/kevina/followers","following_url":"https://api.github.com/users/kevina/following{/other_user}","gists_url":"https://api.github.com/users/kevina/gists{/gist_id}","starred_url":"https://api.github.com/users/kevina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevina/subscriptions","organizations_url":"https://api.github.com/users/kevina/orgs","repos_url":"https://api.github.com/users/kevina/repos","events_url":"https://api.github.com/users/kevina/events{/privacy}","received_events_url":"https://api.github.com/users/kevina/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":483558964,"node_id":"MDU6TGFiZWw0ODM1NTg5NjQ=","url":"https://api.github.com/repos/ipfs/go-cid/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ipfs/go-cid/pulls/40/commits","review_comments_url":"https://api.github.com/repos/ipfs/go-cid/pulls/40/comments","review_comment_url":"https://api.github.com/repos/ipfs/go-cid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ipfs/go-cid/issues/40/comments","statuses_url":"https://api.github.com/repos/ipfs/go-cid/statuses/2f731f06e4566de92d0dbf753fd4fcc2ea5dcc1a","head":{"label":"ipfs:feat/safe-hash-whitelist","ref":"feat/safe-hash-whitelist","sha":"2f731f06e4566de92d0dbf753fd4fcc2ea5dcc1a","user":{"login":"ipfs","id":10536621,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTM2NjIx","avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":66386779,"node_id":"MDEwOlJlcG9zaXRvcnk2NjM4Njc3OQ==","name":"go-cid","full_name":"ipfs/go-cid","owner":{"login":"ipfs","id":10536621,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTM2NjIx","avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/go-cid","description":"Content ID v1 implemented in go","fork":false,"url":"https://api.github.com/repos/ipfs/go-cid","forks_url":"https://api.github.com/repos/ipfs/go-cid/forks","keys_url":"https://api.github.com/repos/ipfs/go-cid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/go-cid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/go-cid/teams","hooks_url":"https://api.github.com/repos/ipfs/go-cid/hooks","issue_events_url":"https://api.github.com/repos/ipfs/go-cid/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/go-cid/events","assignees_url":"https://api.github.com/repos/ipfs/go-cid/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/go-cid/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/go-cid/tags","blobs_url":"https://api.github.com/repos/ipfs/go-cid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/go-cid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/go-cid/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/go-cid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/go-cid/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/go-cid/languages","stargazers_url":"https://api.github.com/repos/ipfs/go-cid/stargazers","contributors_url":"https://api.github.com/repos/ipfs/go-cid/contributors","subscribers_url":"https://api.github.com/repos/ipfs/go-cid/subscribers","subscription_url":"https://api.github.com/repos/ipfs/go-cid/subscription","commits_url":"https://api.github.com/repos/ipfs/go-cid/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/go-cid/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/go-cid/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/go-cid/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/go-cid/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/go-cid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/go-cid/merges","archive_url":"https://api.github.com/repos/ipfs/go-cid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/go-cid/downloads","issues_url":"https://api.github.com/repos/ipfs/go-cid/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/go-cid/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/go-cid/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/go-cid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/go-cid/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/go-cid/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/go-cid/deployments","created_at":"2016-08-23T17:05:22Z","updated_at":"2018-06-09T03:36:01Z","pushed_at":"2018-06-22T18:32:30Z","git_url":"git://github.com/ipfs/go-cid.git","ssh_url":"git@github.com:ipfs/go-cid.git","clone_url":"https://github.com/ipfs/go-cid.git","svn_url":"https://github.com/ipfs/go-cid","homepage":null,"size":93,"stargazers_count":13,"watchers_count":13,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":8,"open_issues":15,"watchers":13,"default_branch":"master"}},"base":{"label":"ipfs:master","ref":"master","sha":"078355866b1dda1658b5fdc5496ed7e25fdcf883","user":{"login":"ipfs","id":10536621,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTM2NjIx","avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":66386779,"node_id":"MDEwOlJlcG9zaXRvcnk2NjM4Njc3OQ==","name":"go-cid","full_name":"ipfs/go-cid","owner":{"login":"ipfs","id":10536621,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTM2NjIx","avatar_url":"https://avatars0.githubusercontent.com/u/10536621?v=4","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/go-cid","description":"Content ID v1 implemented in go","fork":false,"url":"https://api.github.com/repos/ipfs/go-cid","forks_url":"https://api.github.com/repos/ipfs/go-cid/forks","keys_url":"https://api.github.com/repos/ipfs/go-cid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/go-cid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/go-cid/teams","hooks_url":"https://api.github.com/repos/ipfs/go-cid/hooks","issue_events_url":"https://api.github.com/repos/ipfs/go-cid/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/go-cid/events","assignees_url":"https://api.github.com/repos/ipfs/go-cid/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/go-cid/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/go-cid/tags","blobs_url":"https://api.github.com/repos/ipfs/go-cid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/go-cid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/go-cid/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/go-cid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/go-cid/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/go-cid/languages","stargazers_url":"https://api.github.com/repos/ipfs/go-cid/stargazers","contributors_url":"https://api.github.com/repos/ipfs/go-cid/contributors","subscribers_url":"https://api.github.com/repos/ipfs/go-cid/subscribers","subscription_url":"https://api.github.com/repos/ipfs/go-cid/subscription","commits_url":"https://api.github.com/repos/ipfs/go-cid/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/go-cid/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/go-cid/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/go-cid/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/go-cid/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/go-cid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/go-cid/merges","archive_url":"https://api.github.com/repos/ipfs/go-cid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/go-cid/downloads","issues_url":"https://api.github.com/repos/ipfs/go-cid/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/go-cid/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/go-cid/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/go-cid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/go-cid/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/go-cid/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/go-cid/deployments","created_at":"2016-08-23T17:05:22Z","updated_at":"2018-06-09T03:36:01Z","pushed_at":"2018-06-22T18:32:30Z","git_url":"git://github.com/ipfs/go-cid.git","ssh_url":"git@github.com:ipfs/go-cid.git","clone_url":"https://github.com/ipfs/go-cid.git","svn_url":"https://github.com/ipfs/go-cid","homepage":null,"size":93,"stargazers_count":13,"watchers_count":13,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":8,"open_issues":15,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ipfs/go-cid/pulls/40"},"html":{"href":"https://github.com/ipfs/go-cid/pull/40"},"issue":{"href":"https://api.github.com/repos/ipfs/go-cid/issues/40"},"comments":{"href":"https://api.github.com/repos/ipfs/go-cid/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/ipfs/go-cid/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/ipfs/go-cid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ipfs/go-cid/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/ipfs/go-cid/statuses/2f731f06e4566de92d0dbf753fd4fcc2ea5dcc1a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"kevina"}}