{"action":"created","comment":{"url":"https://api.github.com/repos/coreos/etcd/pulls/comments/77904565","id":77904565,"diff_hunk":"@@ -22,22 +22,53 @@ import (\n \t\"github.com/coreos/etcd/mvcc/backend\"\n )\n \n-// isSubset returns true if a is a subset of b\n+// isSubset returns true if a is a subset of b.\n+// If a is a prefix of b, then a is a subset of b.\n+// Given intervals [a1,a2) and [b1,b2), is\n+// the a interval a subset of b?\n func isSubset(a, b *rangePerm) bool {\n \tswitch {\n \tcase len(a.end) == 0 && len(b.end) == 0:\n \t\t// a, b are both keys\n \t\treturn bytes.Equal(a.begin, b.begin)\n \tcase len(b.end) == 0:\n-\t\t// b is a key, a is a range\n+\t\t// b is a key, a is a range (even a prefix range has infinite membership > 1)\n \t\treturn false\n \tcase len(a.end) == 0:\n-\t\treturn 0 <= bytes.Compare(a.begin, b.begin) && bytes.Compare(a.begin, b.end) <= 0\n+\t\t// a is a key, b is a range. need b1 <= a1 and a1 < b2\n+\t\treturn bytes.Compare(b.begin, a.begin) <= 0 && bytes.Compare(a.begin, b.end) < 0\n \tdefault:\n-\t\treturn 0 <= bytes.Compare(a.begin, b.begin) && bytes.Compare(a.end, b.end) <= 0\n+\t\t// both are ranges. need b1 <= a1 and a2 <= b2\n+\t\treturn bytes.Compare(b.begin, a.begin) <= 0 && bytes.Compare(a.end, b.end) <= 0\n \t}\n }\n \n+func rangeIsPrefix(a *rangePerm) bool {","path":"auth/range_perm_cache.go","position":29,"original_position":29,"commit_id":"8c682b74f8c301131a7a97fa1ed223f1d99a788e","original_commit_id":"8c682b74f8c301131a7a97fa1ed223f1d99a788e","user":{"login":"heyitsanthony","id":16294350,"avatar_url":"https://avatars.githubusercontent.com/u/16294350?v=3","gravatar_id":"","url":"https://api.github.com/users/heyitsanthony","html_url":"https://github.com/heyitsanthony","followers_url":"https://api.github.com/users/heyitsanthony/followers","following_url":"https://api.github.com/users/heyitsanthony/following{/other_user}","gists_url":"https://api.github.com/users/heyitsanthony/gists{/gist_id}","starred_url":"https://api.github.com/users/heyitsanthony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heyitsanthony/subscriptions","organizations_url":"https://api.github.com/users/heyitsanthony/orgs","repos_url":"https://api.github.com/users/heyitsanthony/repos","events_url":"https://api.github.com/users/heyitsanthony/events{/privacy}","received_events_url":"https://api.github.com/users/heyitsanthony/received_events","type":"User","site_admin":false},"body":"where is this called?","created_at":"2016-09-07T21:10:47Z","updated_at":"2016-09-07T21:10:47Z","html_url":"https://github.com/coreos/etcd/pull/6371#discussion_r77904565","pull_request_url":"https://api.github.com/repos/coreos/etcd/pulls/6371","_links":{"self":{"href":"https://api.github.com/repos/coreos/etcd/pulls/comments/77904565"},"html":{"href":"https://github.com/coreos/etcd/pull/6371#discussion_r77904565"},"pull_request":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6371"}}},"pull_request":{"url":"https://api.github.com/repos/coreos/etcd/pulls/6371","id":84230764,"html_url":"https://github.com/coreos/etcd/pull/6371","diff_url":"https://github.com/coreos/etcd/pull/6371.diff","patch_url":"https://github.com/coreos/etcd/pull/6371.patch","issue_url":"https://api.github.com/repos/coreos/etcd/issues/6371","number":6371,"state":"open","locked":false,"title":"etcdctl/ctlv3: auth: wildcard terminated paths specify ranges","user":{"login":"glycerine","id":445247,"avatar_url":"https://avatars.githubusercontent.com/u/445247?v=3","gravatar_id":"","url":"https://api.github.com/users/glycerine","html_url":"https://github.com/glycerine","followers_url":"https://api.github.com/users/glycerine/followers","following_url":"https://api.github.com/users/glycerine/following{/other_user}","gists_url":"https://api.github.com/users/glycerine/gists{/gist_id}","starred_url":"https://api.github.com/users/glycerine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glycerine/subscriptions","organizations_url":"https://api.github.com/users/glycerine/orgs","repos_url":"https://api.github.com/users/glycerine/repos","events_url":"https://api.github.com/users/glycerine/events{/privacy}","received_events_url":"https://api.github.com/users/glycerine/received_events","type":"User","site_admin":false},"body":"Still needs tests, but creating pull request to facilitate the discussion in #6359","created_at":"2016-09-07T03:21:39Z","updated_at":"2016-09-07T21:10:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"caa386519fc51839f5211afc0eba960cbc3f33d4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/coreos/etcd/pulls/6371/commits","review_comments_url":"https://api.github.com/repos/coreos/etcd/pulls/6371/comments","review_comment_url":"https://api.github.com/repos/coreos/etcd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coreos/etcd/issues/6371/comments","statuses_url":"https://api.github.com/repos/coreos/etcd/statuses/8c682b74f8c301131a7a97fa1ed223f1d99a788e","head":{"label":"glycerine:master","ref":"master","sha":"8c682b74f8c301131a7a97fa1ed223f1d99a788e","user":{"login":"glycerine","id":445247,"avatar_url":"https://avatars.githubusercontent.com/u/445247?v=3","gravatar_id":"","url":"https://api.github.com/users/glycerine","html_url":"https://github.com/glycerine","followers_url":"https://api.github.com/users/glycerine/followers","following_url":"https://api.github.com/users/glycerine/following{/other_user}","gists_url":"https://api.github.com/users/glycerine/gists{/gist_id}","starred_url":"https://api.github.com/users/glycerine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glycerine/subscriptions","organizations_url":"https://api.github.com/users/glycerine/orgs","repos_url":"https://api.github.com/users/glycerine/repos","events_url":"https://api.github.com/users/glycerine/events{/privacy}","received_events_url":"https://api.github.com/users/glycerine/received_events","type":"User","site_admin":false},"repo":{"id":14243985,"name":"etcd","full_name":"glycerine/etcd","owner":{"login":"glycerine","id":445247,"avatar_url":"https://avatars.githubusercontent.com/u/445247?v=3","gravatar_id":"","url":"https://api.github.com/users/glycerine","html_url":"https://github.com/glycerine","followers_url":"https://api.github.com/users/glycerine/followers","following_url":"https://api.github.com/users/glycerine/following{/other_user}","gists_url":"https://api.github.com/users/glycerine/gists{/gist_id}","starred_url":"https://api.github.com/users/glycerine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glycerine/subscriptions","organizations_url":"https://api.github.com/users/glycerine/orgs","repos_url":"https://api.github.com/users/glycerine/repos","events_url":"https://api.github.com/users/glycerine/events{/privacy}","received_events_url":"https://api.github.com/users/glycerine/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/glycerine/etcd","description":"A highly-available key value store for shared configuration and service discovery","fork":true,"url":"https://api.github.com/repos/glycerine/etcd","forks_url":"https://api.github.com/repos/glycerine/etcd/forks","keys_url":"https://api.github.com/repos/glycerine/etcd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/glycerine/etcd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/glycerine/etcd/teams","hooks_url":"https://api.github.com/repos/glycerine/etcd/hooks","issue_events_url":"https://api.github.com/repos/glycerine/etcd/issues/events{/number}","events_url":"https://api.github.com/repos/glycerine/etcd/events","assignees_url":"https://api.github.com/repos/glycerine/etcd/assignees{/user}","branches_url":"https://api.github.com/repos/glycerine/etcd/branches{/branch}","tags_url":"https://api.github.com/repos/glycerine/etcd/tags","blobs_url":"https://api.github.com/repos/glycerine/etcd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/glycerine/etcd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/glycerine/etcd/git/refs{/sha}","trees_url":"https://api.github.com/repos/glycerine/etcd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/glycerine/etcd/statuses/{sha}","languages_url":"https://api.github.com/repos/glycerine/etcd/languages","stargazers_url":"https://api.github.com/repos/glycerine/etcd/stargazers","contributors_url":"https://api.github.com/repos/glycerine/etcd/contributors","subscribers_url":"https://api.github.com/repos/glycerine/etcd/subscribers","subscription_url":"https://api.github.com/repos/glycerine/etcd/subscription","commits_url":"https://api.github.com/repos/glycerine/etcd/commits{/sha}","git_commits_url":"https://api.github.com/repos/glycerine/etcd/git/commits{/sha}","comments_url":"https://api.github.com/repos/glycerine/etcd/comments{/number}","issue_comment_url":"https://api.github.com/repos/glycerine/etcd/issues/comments{/number}","contents_url":"https://api.github.com/repos/glycerine/etcd/contents/{+path}","compare_url":"https://api.github.com/repos/glycerine/etcd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/glycerine/etcd/merges","archive_url":"https://api.github.com/repos/glycerine/etcd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/glycerine/etcd/downloads","issues_url":"https://api.github.com/repos/glycerine/etcd/issues{/number}","pulls_url":"https://api.github.com/repos/glycerine/etcd/pulls{/number}","milestones_url":"https://api.github.com/repos/glycerine/etcd/milestones{/number}","notifications_url":"https://api.github.com/repos/glycerine/etcd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/glycerine/etcd/labels{/name}","releases_url":"https://api.github.com/repos/glycerine/etcd/releases{/id}","deployments_url":"https://api.github.com/repos/glycerine/etcd/deployments","created_at":"2013-11-08T20:46:57Z","updated_at":"2016-09-03T17:33:55Z","pushed_at":"2016-09-07T09:21:49Z","git_url":"git://github.com/glycerine/etcd.git","ssh_url":"git@github.com:glycerine/etcd.git","clone_url":"https://github.com/glycerine/etcd.git","svn_url":"https://github.com/glycerine/etcd","homepage":"http://coreos.com/docs/etcd/","size":22831,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"coreos:master","ref":"master","sha":"a6c905ad96d6be470587c0d6914cc00e9fb26760","user":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"repo":{"id":11225014,"name":"etcd","full_name":"coreos/etcd","owner":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coreos/etcd","description":"Distributed reliable key-value store for the most critical data of a distributed system","fork":false,"url":"https://api.github.com/repos/coreos/etcd","forks_url":"https://api.github.com/repos/coreos/etcd/forks","keys_url":"https://api.github.com/repos/coreos/etcd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coreos/etcd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coreos/etcd/teams","hooks_url":"https://api.github.com/repos/coreos/etcd/hooks","issue_events_url":"https://api.github.com/repos/coreos/etcd/issues/events{/number}","events_url":"https://api.github.com/repos/coreos/etcd/events","assignees_url":"https://api.github.com/repos/coreos/etcd/assignees{/user}","branches_url":"https://api.github.com/repos/coreos/etcd/branches{/branch}","tags_url":"https://api.github.com/repos/coreos/etcd/tags","blobs_url":"https://api.github.com/repos/coreos/etcd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coreos/etcd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coreos/etcd/git/refs{/sha}","trees_url":"https://api.github.com/repos/coreos/etcd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coreos/etcd/statuses/{sha}","languages_url":"https://api.github.com/repos/coreos/etcd/languages","stargazers_url":"https://api.github.com/repos/coreos/etcd/stargazers","contributors_url":"https://api.github.com/repos/coreos/etcd/contributors","subscribers_url":"https://api.github.com/repos/coreos/etcd/subscribers","subscription_url":"https://api.github.com/repos/coreos/etcd/subscription","commits_url":"https://api.github.com/repos/coreos/etcd/commits{/sha}","git_commits_url":"https://api.github.com/repos/coreos/etcd/git/commits{/sha}","comments_url":"https://api.github.com/repos/coreos/etcd/comments{/number}","issue_comment_url":"https://api.github.com/repos/coreos/etcd/issues/comments{/number}","contents_url":"https://api.github.com/repos/coreos/etcd/contents/{+path}","compare_url":"https://api.github.com/repos/coreos/etcd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coreos/etcd/merges","archive_url":"https://api.github.com/repos/coreos/etcd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coreos/etcd/downloads","issues_url":"https://api.github.com/repos/coreos/etcd/issues{/number}","pulls_url":"https://api.github.com/repos/coreos/etcd/pulls{/number}","milestones_url":"https://api.github.com/repos/coreos/etcd/milestones{/number}","notifications_url":"https://api.github.com/repos/coreos/etcd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coreos/etcd/labels{/name}","releases_url":"https://api.github.com/repos/coreos/etcd/releases{/id}","deployments_url":"https://api.github.com/repos/coreos/etcd/deployments","created_at":"2013-07-06T21:57:21Z","updated_at":"2016-09-07T19:38:55Z","pushed_at":"2016-09-07T18:24:56Z","git_url":"git://github.com/coreos/etcd.git","ssh_url":"git@github.com:coreos/etcd.git","clone_url":"https://github.com/coreos/etcd.git","svn_url":"https://github.com/coreos/etcd","homepage":"https://coreos.com/etcd/docs/latest/","size":30675,"stargazers_count":10741,"watchers_count":10741,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1882,"mirror_url":null,"open_issues_count":132,"forks":1882,"open_issues":132,"watchers":10741,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6371"},"html":{"href":"https://github.com/coreos/etcd/pull/6371"},"issue":{"href":"https://api.github.com/repos/coreos/etcd/issues/6371"},"comments":{"href":"https://api.github.com/repos/coreos/etcd/issues/6371/comments"},"review_comments":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6371/comments"},"review_comment":{"href":"https://api.github.com/repos/coreos/etcd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coreos/etcd/pulls/6371/commits"},"statuses":{"href":"https://api.github.com/repos/coreos/etcd/statuses/8c682b74f8c301131a7a97fa1ed223f1d99a788e"}}}}
{"actor":{"display_login":"heyitsanthony"}}