{"action":"created","comment":{"url":"https://api.github.com/repos/dexidp/dex/pulls/comments/233920594","pull_request_review_id":175446549,"id":233920594,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzkyMDU5NA==","diff_hunk":"@@ -359,19 +368,94 @@ func (c *githubConnector) groupsForOrgs(ctx context.Context, client *http.Client\n \t\t\tc.logger.Infof(\"github: user %q in org %q but no teams\", userName, org.Name)\n \t\t}\n \n-\t\t// Orgs might have the same team names. We append orgPrefix to team name,\n-\t\t// i.e. \"org:team\", to make team names unique across orgs.\n-\t\torgPrefix := org.Name + \":\"\n \t\tfor _, teamName := range teams {\n-\t\t\tgroups = append(groups, orgPrefix+teamName)\n+\t\t\tgroups = append(groups, formatTeamName(org.Name, teamName))\n \t\t}\n \t}\n \tif inOrgNoTeams || len(groups) > 0 {\n-\t\treturn\n+\t\treturn groups, nil\n \t}\n \treturn groups, fmt.Errorf(\"github: user %q not in required orgs or teams\", userName)\n }\n \n+func (c *githubConnector) userGroups(ctx context.Context, client *http.Client) ([]string, error) {\n+\torgs, err := c.userOrgs(ctx, client)\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\n+\torgTeams, err := c.userOrgTeams(ctx, client)\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\n+\tgroups := make([]string, 0)\n+\tfor _, org := range orgs {","path":"connector/github/github.go","position":74,"original_position":74,"commit_id":"e10b8232d1a368bdaf7b645e776050f677dba27c","original_commit_id":"e10b8232d1a368bdaf7b645e776050f677dba27c","user":{"login":"srenatus","id":870638,"node_id":"MDQ6VXNlcjg3MDYzOA==","avatar_url":"https://avatars3.githubusercontent.com/u/870638?v=4","gravatar_id":"","url":"https://api.github.com/users/srenatus","html_url":"https://github.com/srenatus","followers_url":"https://api.github.com/users/srenatus/followers","following_url":"https://api.github.com/users/srenatus/following{/other_user}","gists_url":"https://api.github.com/users/srenatus/gists{/gist_id}","starred_url":"https://api.github.com/users/srenatus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srenatus/subscriptions","organizations_url":"https://api.github.com/users/srenatus/orgs","repos_url":"https://api.github.com/users/srenatus/repos","events_url":"https://api.github.com/users/srenatus/events{/privacy}","received_events_url":"https://api.github.com/users/srenatus/received_events","type":"User","site_admin":false},"body":"[nit] we're still shadowing org and team here, but it really doesn't matter that much.","created_at":"2018-11-15T16:41:39Z","updated_at":"2018-11-15T16:46:58Z","html_url":"https://github.com/dexidp/dex/pull/1340#discussion_r233920594","pull_request_url":"https://api.github.com/repos/dexidp/dex/pulls/1340","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/dexidp/dex/pulls/comments/233920594"},"html":{"href":"https://github.com/dexidp/dex/pull/1340#discussion_r233920594"},"pull_request":{"href":"https://api.github.com/repos/dexidp/dex/pulls/1340"}}},"pull_request":{"url":"https://api.github.com/repos/dexidp/dex/pulls/1340","id":231021592,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxMDIxNTky","html_url":"https://github.com/dexidp/dex/pull/1340","diff_url":"https://github.com/dexidp/dex/pull/1340.diff","patch_url":"https://github.com/dexidp/dex/pull/1340.patch","issue_url":"https://api.github.com/repos/dexidp/dex/issues/1340","number":1340,"state":"open","locked":false,"title":"Issue #1184 - Github connector now returns a full group list when no org is specified","user":{"login":"alexmt","id":426437,"node_id":"MDQ6VXNlcjQyNjQzNw==","avatar_url":"https://avatars1.githubusercontent.com/u/426437?v=4","gravatar_id":"","url":"https://api.github.com/users/alexmt","html_url":"https://github.com/alexmt","followers_url":"https://api.github.com/users/alexmt/followers","following_url":"https://api.github.com/users/alexmt/following{/other_user}","gists_url":"https://api.github.com/users/alexmt/gists{/gist_id}","starred_url":"https://api.github.com/users/alexmt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexmt/subscriptions","organizations_url":"https://api.github.com/users/alexmt/orgs","repos_url":"https://api.github.com/users/alexmt/repos","events_url":"https://api.github.com/users/alexmt/events{/privacy}","received_events_url":"https://api.github.com/users/alexmt/received_events","type":"User","site_admin":false},"body":"Fixes #1102\r\n\r\nPR contains a subset of changes implemented in https://github.com/dexidp/dex/pull/1184. Original PR had been closed without merging since it accumulated too many changes and authors decided to maintain a fork.\r\n\r\nThis change unblocks an important use case: give read-only access to anyone and give extra privileges to users which belongs to the specified group.","created_at":"2018-11-14T23:47:31Z","updated_at":"2018-11-15T16:46:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"624cb9e0fa0a4556ca5cf17a91d647a9425a85a1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dexidp/dex/pulls/1340/commits","review_comments_url":"https://api.github.com/repos/dexidp/dex/pulls/1340/comments","review_comment_url":"https://api.github.com/repos/dexidp/dex/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dexidp/dex/issues/1340/comments","statuses_url":"https://api.github.com/repos/dexidp/dex/statuses/e10b8232d1a368bdaf7b645e776050f677dba27c","head":{"label":"alexmt:1184-github-groups","ref":"1184-github-groups","sha":"e10b8232d1a368bdaf7b645e776050f677dba27c","user":{"login":"alexmt","id":426437,"node_id":"MDQ6VXNlcjQyNjQzNw==","avatar_url":"https://avatars1.githubusercontent.com/u/426437?v=4","gravatar_id":"","url":"https://api.github.com/users/alexmt","html_url":"https://github.com/alexmt","followers_url":"https://api.github.com/users/alexmt/followers","following_url":"https://api.github.com/users/alexmt/following{/other_user}","gists_url":"https://api.github.com/users/alexmt/gists{/gist_id}","starred_url":"https://api.github.com/users/alexmt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexmt/subscriptions","organizations_url":"https://api.github.com/users/alexmt/orgs","repos_url":"https://api.github.com/users/alexmt/repos","events_url":"https://api.github.com/users/alexmt/events{/privacy}","received_events_url":"https://api.github.com/users/alexmt/received_events","type":"User","site_admin":false},"repo":{"id":157578164,"node_id":"MDEwOlJlcG9zaXRvcnkxNTc1NzgxNjQ=","name":"dex","full_name":"alexmt/dex","private":false,"owner":{"login":"alexmt","id":426437,"node_id":"MDQ6VXNlcjQyNjQzNw==","avatar_url":"https://avatars1.githubusercontent.com/u/426437?v=4","gravatar_id":"","url":"https://api.github.com/users/alexmt","html_url":"https://github.com/alexmt","followers_url":"https://api.github.com/users/alexmt/followers","following_url":"https://api.github.com/users/alexmt/following{/other_user}","gists_url":"https://api.github.com/users/alexmt/gists{/gist_id}","starred_url":"https://api.github.com/users/alexmt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexmt/subscriptions","organizations_url":"https://api.github.com/users/alexmt/orgs","repos_url":"https://api.github.com/users/alexmt/repos","events_url":"https://api.github.com/users/alexmt/events{/privacy}","received_events_url":"https://api.github.com/users/alexmt/received_events","type":"User","site_admin":false},"html_url":"https://github.com/alexmt/dex","description":"OpenID Connect Identity (OIDC) and OAuth 2.0 Provider with Pluggable Connectors","fork":true,"url":"https://api.github.com/repos/alexmt/dex","forks_url":"https://api.github.com/repos/alexmt/dex/forks","keys_url":"https://api.github.com/repos/alexmt/dex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexmt/dex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexmt/dex/teams","hooks_url":"https://api.github.com/repos/alexmt/dex/hooks","issue_events_url":"https://api.github.com/repos/alexmt/dex/issues/events{/number}","events_url":"https://api.github.com/repos/alexmt/dex/events","assignees_url":"https://api.github.com/repos/alexmt/dex/assignees{/user}","branches_url":"https://api.github.com/repos/alexmt/dex/branches{/branch}","tags_url":"https://api.github.com/repos/alexmt/dex/tags","blobs_url":"https://api.github.com/repos/alexmt/dex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexmt/dex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexmt/dex/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexmt/dex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexmt/dex/statuses/{sha}","languages_url":"https://api.github.com/repos/alexmt/dex/languages","stargazers_url":"https://api.github.com/repos/alexmt/dex/stargazers","contributors_url":"https://api.github.com/repos/alexmt/dex/contributors","subscribers_url":"https://api.github.com/repos/alexmt/dex/subscribers","subscription_url":"https://api.github.com/repos/alexmt/dex/subscription","commits_url":"https://api.github.com/repos/alexmt/dex/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexmt/dex/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexmt/dex/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexmt/dex/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexmt/dex/contents/{+path}","compare_url":"https://api.github.com/repos/alexmt/dex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexmt/dex/merges","archive_url":"https://api.github.com/repos/alexmt/dex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexmt/dex/downloads","issues_url":"https://api.github.com/repos/alexmt/dex/issues{/number}","pulls_url":"https://api.github.com/repos/alexmt/dex/pulls{/number}","milestones_url":"https://api.github.com/repos/alexmt/dex/milestones{/number}","notifications_url":"https://api.github.com/repos/alexmt/dex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexmt/dex/labels{/name}","releases_url":"https://api.github.com/repos/alexmt/dex/releases{/id}","deployments_url":"https://api.github.com/repos/alexmt/dex/deployments","created_at":"2018-11-14T16:30:37Z","updated_at":"2018-11-14T16:30:41Z","pushed_at":"2018-11-15T16:17:01Z","git_url":"git://github.com/alexmt/dex.git","ssh_url":"git@github.com:alexmt/dex.git","clone_url":"https://github.com/alexmt/dex.git","svn_url":"https://github.com/alexmt/dex","homepage":"https://coreos.com/blog/announcing-dex.html","size":14282,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dexidp:master","ref":"master","sha":"57b1031352a11789b9f87e95f58f60a46bc611de","user":{"login":"dexidp","id":42422344,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQyNDIyMzQ0","avatar_url":"https://avatars0.githubusercontent.com/u/42422344?v=4","gravatar_id":"","url":"https://api.github.com/users/dexidp","html_url":"https://github.com/dexidp","followers_url":"https://api.github.com/users/dexidp/followers","following_url":"https://api.github.com/users/dexidp/following{/other_user}","gists_url":"https://api.github.com/users/dexidp/gists{/gist_id}","starred_url":"https://api.github.com/users/dexidp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dexidp/subscriptions","organizations_url":"https://api.github.com/users/dexidp/orgs","repos_url":"https://api.github.com/users/dexidp/repos","events_url":"https://api.github.com/users/dexidp/events{/privacy}","received_events_url":"https://api.github.com/users/dexidp/received_events","type":"Organization","site_admin":false},"repo":{"id":40916314,"node_id":"MDEwOlJlcG9zaXRvcnk0MDkxNjMxNA==","name":"dex","full_name":"dexidp/dex","private":false,"owner":{"login":"dexidp","id":42422344,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQyNDIyMzQ0","avatar_url":"https://avatars0.githubusercontent.com/u/42422344?v=4","gravatar_id":"","url":"https://api.github.com/users/dexidp","html_url":"https://github.com/dexidp","followers_url":"https://api.github.com/users/dexidp/followers","following_url":"https://api.github.com/users/dexidp/following{/other_user}","gists_url":"https://api.github.com/users/dexidp/gists{/gist_id}","starred_url":"https://api.github.com/users/dexidp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dexidp/subscriptions","organizations_url":"https://api.github.com/users/dexidp/orgs","repos_url":"https://api.github.com/users/dexidp/repos","events_url":"https://api.github.com/users/dexidp/events{/privacy}","received_events_url":"https://api.github.com/users/dexidp/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dexidp/dex","description":"OpenID Connect Identity (OIDC) and OAuth 2.0 Provider with Pluggable Connectors","fork":false,"url":"https://api.github.com/repos/dexidp/dex","forks_url":"https://api.github.com/repos/dexidp/dex/forks","keys_url":"https://api.github.com/repos/dexidp/dex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dexidp/dex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dexidp/dex/teams","hooks_url":"https://api.github.com/repos/dexidp/dex/hooks","issue_events_url":"https://api.github.com/repos/dexidp/dex/issues/events{/number}","events_url":"https://api.github.com/repos/dexidp/dex/events","assignees_url":"https://api.github.com/repos/dexidp/dex/assignees{/user}","branches_url":"https://api.github.com/repos/dexidp/dex/branches{/branch}","tags_url":"https://api.github.com/repos/dexidp/dex/tags","blobs_url":"https://api.github.com/repos/dexidp/dex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dexidp/dex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dexidp/dex/git/refs{/sha}","trees_url":"https://api.github.com/repos/dexidp/dex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dexidp/dex/statuses/{sha}","languages_url":"https://api.github.com/repos/dexidp/dex/languages","stargazers_url":"https://api.github.com/repos/dexidp/dex/stargazers","contributors_url":"https://api.github.com/repos/dexidp/dex/contributors","subscribers_url":"https://api.github.com/repos/dexidp/dex/subscribers","subscription_url":"https://api.github.com/repos/dexidp/dex/subscription","commits_url":"https://api.github.com/repos/dexidp/dex/commits{/sha}","git_commits_url":"https://api.github.com/repos/dexidp/dex/git/commits{/sha}","comments_url":"https://api.github.com/repos/dexidp/dex/comments{/number}","issue_comment_url":"https://api.github.com/repos/dexidp/dex/issues/comments{/number}","contents_url":"https://api.github.com/repos/dexidp/dex/contents/{+path}","compare_url":"https://api.github.com/repos/dexidp/dex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dexidp/dex/merges","archive_url":"https://api.github.com/repos/dexidp/dex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dexidp/dex/downloads","issues_url":"https://api.github.com/repos/dexidp/dex/issues{/number}","pulls_url":"https://api.github.com/repos/dexidp/dex/pulls{/number}","milestones_url":"https://api.github.com/repos/dexidp/dex/milestones{/number}","notifications_url":"https://api.github.com/repos/dexidp/dex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dexidp/dex/labels{/name}","releases_url":"https://api.github.com/repos/dexidp/dex/releases{/id}","deployments_url":"https://api.github.com/repos/dexidp/dex/deployments","created_at":"2015-08-17T17:57:06Z","updated_at":"2018-11-14T20:17:49Z","pushed_at":"2018-11-15T16:17:03Z","git_url":"git://github.com/dexidp/dex.git","ssh_url":"git@github.com:dexidp/dex.git","clone_url":"https://github.com/dexidp/dex.git","svn_url":"https://github.com/dexidp/dex","homepage":"https://coreos.com/blog/announcing-dex.html","size":14291,"stargazers_count":2651,"watchers_count":2651,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":561,"mirror_url":null,"archived":false,"open_issues_count":170,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":561,"open_issues":170,"watchers":2651,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dexidp/dex/pulls/1340"},"html":{"href":"https://github.com/dexidp/dex/pull/1340"},"issue":{"href":"https://api.github.com/repos/dexidp/dex/issues/1340"},"comments":{"href":"https://api.github.com/repos/dexidp/dex/issues/1340/comments"},"review_comments":{"href":"https://api.github.com/repos/dexidp/dex/pulls/1340/comments"},"review_comment":{"href":"https://api.github.com/repos/dexidp/dex/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dexidp/dex/pulls/1340/commits"},"statuses":{"href":"https://api.github.com/repos/dexidp/dex/statuses/e10b8232d1a368bdaf7b645e776050f677dba27c"}},"author_association":"NONE"}}
{"actor":{"display_login":"srenatus"}}