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

Gitlab provider: Allow restriction by groups. #4

Merged
merged 2 commits into from
Nov 26, 2018
Merged

Conversation

ploxiln
Copy link
Owner

@ploxiln ploxiln commented Nov 25, 2018

rebase of bitly#637

patrickcjh and others added 2 commits November 25, 2018 14:54
instead of using a comma-separated value
to match the convention of other multi-value options
@ploxiln ploxiln merged commit dbe4613 into master Nov 26, 2018
@vishalg
Copy link

vishalg commented Dec 27, 2018

This seems to have broken the gitlab authentication. gitlab scope now defaults to api even when no groups are given in the configuration.

@ploxiln
Copy link
Owner Author

ploxiln commented Dec 30, 2018

Thanks for the report. Might you be able to submit a pull request with the appropriate adjustment?

In the meantime, the v2.3 release should work as before regarding the gitlab provider.

@vishalg
Copy link

vishalg commented Dec 31, 2018

v2.3 works perfectly. I think the following fix in main.go should do the trick, it's a really small change and not sure if its worth a pull request

diff --git a/main.go b/main.go
index fb9b61c..cb720ac 100644
--- a/main.go
+++ b/main.go
@@ -22,6 +22,7 @@ func main() {
        upstreams := StringArray{}
        skipAuthRegex := StringArray{}
        googleGroups := StringArray{}
+       gitlabGroups := StringArray{}
 
        config := flagSet.String("config", "", "path to config file")
        showVersion := flagSet.Bool("version", false, "print version string")
@@ -48,7 +49,7 @@ func main() {
        flagSet.String("azure-tenant", "common", "go to a tenant-specific or common (tenant-independent) endpoint.")
        flagSet.String("github-org", "", "restrict logins to members of this organisation")
        flagSet.String("github-team", "", "restrict logins to members of this team")
-       flagSet.String("gitlab-group", "", "restrict logins to members of this group (full path) (may be given multiple times)")
+       flagSet.Var(&gitlabGroups, "gitlab-group", "restrict logins to members of this group (full path) (may be given multiple times)")
        flagSet.Var(&googleGroups, "google-group", "restrict logins to members of this google group (may be given multiple times).")
        flagSet.String("google-admin-email", "", "the google admin to impersonate for api calls")
        flagSet.String("google-service-account-json", "", "the path to the service account json credentials")

@ploxiln
Copy link
Owner Author

ploxiln commented Dec 31, 2018

It is worth a pull request 😄 - I'll go ahead and open it, but I don't know the email address to put for you as the commit author.

@ploxiln ploxiln mentioned this pull request Dec 31, 2018
@ploxiln
Copy link
Owner Author

ploxiln commented Dec 31, 2018

(about the email address - I figured out I could use vishalg@users.noreply.github.com and it links to your github account)

@vishalg
Copy link

vishalg commented Dec 31, 2018

Great! Thanks for the credit.

@ploxiln ploxiln deleted the bitly_pull_637 branch January 6, 2019 13:14
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.

3 participants