Skip to content
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

Question/Proposal: GitHub orgs without teams are not returned in case of filtering #1551

Open
bonifaido opened this issue Sep 24, 2019 · 0 comments

Comments

@bonifaido
Copy link
Member

bonifaido commented Sep 24, 2019

Currently, when org filtering is enabled in the GitHub connector organizations without teams are skipped from the returned groups scope. Example configuration, which returns (my-org has no teams defined) an empty groups: [] list in the ID token:

   loadAllGroups: true
   orgs:
      - name: my-org

The code which does this filtering:

// User is in at least one org. User is authorized if no teams are specified
// in config; include all teams in the claim. Otherwise, filter out teams not in
// 'teams' list in config.
if len(org.Teams) == 0 {
    inOrgNoTeams = true
} else if teams = groups_pkg.Filter(teams, org.Teams); len(teams) == 0 {
    c.logger.Infof("github: user %q in org %q but no teams", userName, org.Name)
}

for _, teamName := range teams {
    groups = append(groups, formatTeamName(org.Name, teamName))
}

I think it would be a good idea to append the organization without the :teamName suffix as well instead of the inOrgNoTeams = true code block. What is the reason behind this filtering? Any thoughts?

@bonifaido bonifaido changed the title Question/Proposal: GitHub orgs not returned without teams in orgs when filtering Question/Proposal: GitHub orgs without teams are not returned in case of filtering Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant