-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Github connector now returns a full group list when no org is specified #1184
Conversation
Looks like I'm using features in httptest server that weren't available in golang 1.8. |
This looks great! I was just about to implement this. |
@ericchiang Can we get this reviewed? |
@@ -596,3 +600,76 @@ func (c *githubConnector) teamsForOrg(ctx context.Context, client *http.Client, | |||
|
|||
return groups, nil | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function comment needed.
return groups, err | ||
} | ||
|
||
func (c *githubConnector) userOrgs(ctx context.Context, client *http.Client) ([]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
|
||
return groups, nil | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
groups = append(groups, org) | ||
} else { | ||
for _, team := range teams { | ||
groups = append(groups, org+":"+team) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to put this and line 357 as a function so formatting is spread out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple suggestions.
@joshadambell updated as per your suggestions. thanks. |
@ericchiang Anything missing on this PR? |
I ended up deleting the branch that this PR points to. We've ended up with a bunch of work on our fork of Dex so I spent a lot of time cleaning things up so that we can at least more easily keep up to date with upstream and keep tabs on any PR-able work on separate branches instead. More info here: concourse#1 We'll probably re-submit this PR (along with our other |
Signed-off-by: Joris Melchior <[email protected]>
Signed-off-by: Joris Melchior <[email protected]>
Signed-off-by: Rui Yang <[email protected]>
Signed-off-by: Ciro S. Costa <[email protected]>
Signed-off-by: Nader Ziada <[email protected]>
- Verifies user is part of orgs and spaces for group claims Signed-off-by: Shash Reddy <[email protected]>
Signed-off-by: Shash Reddy <[email protected]>
Signed-off-by: Shash Reddy <[email protected]>
Signed-off-by: Bishoy Youssef <[email protected]>
…pr/add-oauth-connector', 'origin/pr/add-web-host-url', 'origin/pr/github-teams-no-org-and-slugs', 'origin/pr/gitlab-broken-auth-headers', 'origin/pr/gitlab-include-user-scope-for-groups-inspection', 'origin/pr/oidc-groups-and-tls', 'origin/pr/optional-prometheus-logger', 'origin/pr/postgres-unix-sockets' and 'origin/pr/unset-pg-serializable-transaction-level'
…en no org is specified
Issue #1184 - Github connector now returns a full group list when no org is specified
…en no org is specified
Issue dexidp#1184 - Github connector now returns a full group list when no org is specified
Fixes #1102
If you asked for the
groups
scope but didn't specify any orgs, the github connector would return an empty set of groups. This should now be fixed.Based on this change we now return a list of groups that looks like the following:
If teams exist, they are scoped to an org, otherwise the org is listed on its own.