Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add 'both' option to use team name AND slug in TeamNameField#1345

Merged
srenatus merged 1 commit into
dexidp:masterfrom
concourse:pr/github-team-name-and-slug
Nov 20, 2018
Merged

Add 'both' option to use team name AND slug in TeamNameField#1345
srenatus merged 1 commit into
dexidp:masterfrom
concourse:pr/github-team-name-and-slug

Conversation

@vito
Copy link
Copy Markdown
Contributor

@vito vito commented Nov 16, 2018

This allows the connector to be configured with both so that both team names and slugs can be returned in the groups. This makes configuring teams a bit more foolproof in Concourse; we would often have confusion over whether the team name or slug should be given by the user, so it's easier to just allow both, since collisions shouldn't be possible anyway.

@vito vito force-pushed the pr/github-team-name-and-slug branch from d94387f to 00b9864 Compare November 16, 2018 18:43
Copy link
Copy Markdown
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good code-wise -- could you add something to the connector docs, please?

Have to admit I don't completely understand why you'd want both, but I'm sure you've got reasons.

(💭 Got to be careful, at some point, JWT can be too large to be effectively handled. For example, if nginx is involved, it could spit upstream sent too big header while reading response header from upstream at you when you attempt to pass the giant JWT in a Location: redirect.)

Comment thread connector/github/github.go Outdated
@srenatus
Copy link
Copy Markdown
Contributor

@vito forgot to mention -- thank you for your contribution. 😃 👍

@vito vito force-pushed the pr/github-team-name-and-slug branch from 00b9864 to b051960 Compare November 19, 2018 17:20
@vito
Copy link
Copy Markdown
Contributor Author

vito commented Nov 19, 2018

Updated! And no problem. There should be more to come over the coming weeks as we try and slim down our fork's deltas.

Thanks for the tip re: the header length, I'll keep an eye out for that. The reason we want both is that Concourse's dex integration allows whitelisting GitHub teams for Concourse teams, something like:

fly set-team -n team-name --github-team concourse:Pivotal

Initially we just used the team name, but users kept trying to specify the slug when configuring teams and getting confused as to why auth wouldn't work (just because of a lowercase p). So we figured it's easiest to just allow both.

Copy link
Copy Markdown
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one nitpick 😉

Comment thread connector/github/github.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Would you mind much making this three blocks? Stdlib, third party, and anything starting with github.com/dexidp/dex? goimports has a setting for automatically doing this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure!

this will result in both the team name *and* the team slug being
returned for each team, allowing a bit more flexibility in auth
validation.

Signed-off-by: Topher Bullock <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
@vito vito force-pushed the pr/github-team-name-and-slug branch from 428fe82 to bb11a1e Compare November 20, 2018 15:12
Copy link
Copy Markdown
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 🎉

@srenatus srenatus merged commit d400438 into dexidp:master Nov 20, 2018
@vito vito deleted the pr/github-team-name-and-slug branch November 20, 2018 15:50
mmrath pushed a commit to mmrath/dex that referenced this pull request Sep 2, 2019
…-slug

Add 'both' option to use team name AND slug in TeamNameField

This allows the connector to be configured with both so that both team names and slugs can be returned in the groups. This makes configuring teams in an application a bit more foolproof; we would often have confusion over whether the team name or slug should be given by the user, so it's easier to just allow both, since collisions shouldn't be possible anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants