{"action":"closed","number":1,"pull_request":{"url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/pulls/1","id":41488057,"html_url":"https://github.com/taskcluster/taskcluster-base-go/pull/1","diff_url":"https://github.com/taskcluster/taskcluster-base-go/pull/1.diff","patch_url":"https://github.com/taskcluster/taskcluster-base-go/pull/1.patch","issue_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/issues/1","number":1,"state":"closed","locked":false,"title":"[Bug 1184044] Check whether a set of given scopes satisfies required scopes","user":{"login":"petemoore","id":190790,"avatar_url":"https://avatars.githubusercontent.com/u/190790?v=3","gravatar_id":"","url":"https://api.github.com/users/petemoore","html_url":"https://github.com/petemoore","followers_url":"https://api.github.com/users/petemoore/followers","following_url":"https://api.github.com/users/petemoore/following{/other_user}","gists_url":"https://api.github.com/users/petemoore/gists{/gist_id}","starred_url":"https://api.github.com/users/petemoore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petemoore/subscriptions","organizations_url":"https://api.github.com/users/petemoore/orgs","repos_url":"https://api.github.com/users/petemoore/repos","events_url":"https://api.github.com/users/petemoore/events{/privacy}","received_events_url":"https://api.github.com/users/petemoore/received_events","type":"User","site_admin":false},"body":"@jonasfj \r\n@djmitche\r\n\r\nThis PR replaces https://github.com/taskcluster/taskcluster-client-go/pull/2 which was for taskcluster-client-go project.\r\n\r\nPlease note I've kept `Required` as `[][]string` rather than `[]ScopeSet` since a set of scopes is treated differently if it is a given set of scopes, or a required set of scopes (e.g. trailing `*` has significance for given scopes but not for required scopes). Also note I'm using the name `Required` and `Given` rather than e.g. `RequiredScopes` and `GivenScopes` since the package name already contains this information.\r\n\r\nFor example, when using the package, you would write:\r\n\r\n```go\r\nmyScopes := scopes.Given{\"some\", \"scopes\", \"for\", \"me\"}\r\nneeded := scopes.Required{{\"a\", \"bit\"}, {\"of\"}, {\"this\", \"would\", \"do nicely:sir\"}, {}}\r\n```\r\n\r\nThis is in accordance with guidance on http://blog.golang.org/package-names.\r\n\r\nI've added some tests and renamed them to clarify their function.\r\n\r\nPlease also note, https://github.com/taskcluster/taskcluster-base-go/blob/ac4b45e749443f10e2b757230248c64b5dfa4384/scopes/scopes_test.go#L219-L250 will get compiled directly into the go docs, to serve as part of documentation, as well as to act as a unit test. See https://blog.golang.org/examples for more information.","created_at":"2015-08-03T17:04:47Z","updated_at":"2015-08-04T18:39:18Z","closed_at":"2015-08-04T18:39:18Z","merged_at":"2015-08-04T18:39:18Z","merge_commit_sha":"11f29ad5905d3d46c344d6da5a5ff4b238509663","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/pulls/1/commits","review_comments_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/pulls/1/comments","review_comment_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/issues/1/comments","statuses_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/statuses/0f445e2e81fb90c9da41fabd4b07d5eb61919b0c","head":{"label":"taskcluster:bug1184044","ref":"bug1184044","sha":"0f445e2e81fb90c9da41fabd4b07d5eb61919b0c","user":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"repo":{"id":40124015,"name":"taskcluster-base-go","full_name":"taskcluster/taskcluster-base-go","owner":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taskcluster/taskcluster-base-go","description":"taskcluster-base-go contains go ports of code/utilities from taskcluster-base (node.js) repository","fork":false,"url":"https://api.github.com/repos/taskcluster/taskcluster-base-go","forks_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/forks","keys_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/teams","hooks_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/hooks","issue_events_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/issues/events{/number}","events_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/events","assignees_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/assignees{/user}","branches_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/branches{/branch}","tags_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/tags","blobs_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/statuses/{sha}","languages_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/languages","stargazers_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/stargazers","contributors_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/contributors","subscribers_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/subscribers","subscription_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/subscription","commits_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/contents/{+path}","compare_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/merges","archive_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/downloads","issues_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/issues{/number}","pulls_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/pulls{/number}","milestones_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/milestones{/number}","notifications_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/labels{/name}","releases_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/releases{/id}","created_at":"2015-08-03T12:41:11Z","updated_at":"2015-08-03T12:41:11Z","pushed_at":"2015-08-04T18:39:18Z","git_url":"git://github.com/taskcluster/taskcluster-base-go.git","ssh_url":"git@github.com:taskcluster/taskcluster-base-go.git","clone_url":"https://github.com/taskcluster/taskcluster-base-go.git","svn_url":"https://github.com/taskcluster/taskcluster-base-go","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"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":"taskcluster:master","ref":"master","sha":"069fd6b3d00bc8144d0b0685cc543eaef03162b1","user":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"repo":{"id":40124015,"name":"taskcluster-base-go","full_name":"taskcluster/taskcluster-base-go","owner":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taskcluster/taskcluster-base-go","description":"taskcluster-base-go contains go ports of code/utilities from taskcluster-base (node.js) repository","fork":false,"url":"https://api.github.com/repos/taskcluster/taskcluster-base-go","forks_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/forks","keys_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/teams","hooks_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/hooks","issue_events_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/issues/events{/number}","events_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/events","assignees_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/assignees{/user}","branches_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/branches{/branch}","tags_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/tags","blobs_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/statuses/{sha}","languages_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/languages","stargazers_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/stargazers","contributors_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/contributors","subscribers_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/subscribers","subscription_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/subscription","commits_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/contents/{+path}","compare_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/merges","archive_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/downloads","issues_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/issues{/number}","pulls_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/pulls{/number}","milestones_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/milestones{/number}","notifications_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/labels{/name}","releases_url":"https://api.github.com/repos/taskcluster/taskcluster-base-go/releases{/id}","created_at":"2015-08-03T12:41:11Z","updated_at":"2015-08-03T12:41:11Z","pushed_at":"2015-08-04T18:39:18Z","git_url":"git://github.com/taskcluster/taskcluster-base-go.git","ssh_url":"git@github.com:taskcluster/taskcluster-base-go.git","clone_url":"https://github.com/taskcluster/taskcluster-base-go.git","svn_url":"https://github.com/taskcluster/taskcluster-base-go","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/taskcluster/taskcluster-base-go/pulls/1"},"html":{"href":"https://github.com/taskcluster/taskcluster-base-go/pull/1"},"issue":{"href":"https://api.github.com/repos/taskcluster/taskcluster-base-go/issues/1"},"comments":{"href":"https://api.github.com/repos/taskcluster/taskcluster-base-go/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/taskcluster/taskcluster-base-go/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/taskcluster/taskcluster-base-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/taskcluster/taskcluster-base-go/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/taskcluster/taskcluster-base-go/statuses/0f445e2e81fb90c9da41fabd4b07d5eb61919b0c"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"petemoore","id":190790,"avatar_url":"https://avatars.githubusercontent.com/u/190790?v=3","gravatar_id":"","url":"https://api.github.com/users/petemoore","html_url":"https://github.com/petemoore","followers_url":"https://api.github.com/users/petemoore/followers","following_url":"https://api.github.com/users/petemoore/following{/other_user}","gists_url":"https://api.github.com/users/petemoore/gists{/gist_id}","starred_url":"https://api.github.com/users/petemoore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petemoore/subscriptions","organizations_url":"https://api.github.com/users/petemoore/orgs","repos_url":"https://api.github.com/users/petemoore/repos","events_url":"https://api.github.com/users/petemoore/events{/privacy}","received_events_url":"https://api.github.com/users/petemoore/received_events","type":"User","site_admin":false},"comments":2,"review_comments":3,"commits":8,"additions":490,"deletions":0,"changed_files":7}}