From 982439a8d8a7fa4a19b29781a08042ccd670a644 Mon Sep 17 00:00:00 2001 From: Miouge1 Date: Tue, 12 Sep 2017 23:42:07 +0200 Subject: [PATCH 1/2] Reduce the default GitLab scope --- providers/gitlab.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/gitlab.go b/providers/gitlab.go index 708283a..d036ac7 100644 --- a/providers/gitlab.go +++ b/providers/gitlab.go @@ -36,7 +36,7 @@ func NewGitLabProvider(p *ProviderData) *GitLabProvider { } } if p.Scope == "" { - p.Scope = "api" + p.Scope = "read_user" } return &GitLabProvider{ProviderData: p} } From a32ff08d6865707a437281c54e0f53581138f8eb Mon Sep 17 00:00:00 2001 From: Miouge1 Date: Tue, 12 Sep 2017 23:43:49 +0200 Subject: [PATCH 2/2] Update test for default GitLab scope --- providers/gitlab_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/gitlab_test.go b/providers/gitlab_test.go index 3df001c..54b1052 100644 --- a/providers/gitlab_test.go +++ b/providers/gitlab_test.go @@ -53,7 +53,7 @@ func TestGitLabProviderDefaults(t *testing.T) { p.Data().RedeemURL.String()) assert.Equal(t, "https://gitlab.com/api/v3/user", p.Data().ValidateURL.String()) - assert.Equal(t, "api", p.Data().Scope) + assert.Equal(t, "read_user", p.Data().Scope) } func TestGitLabProviderOverrides(t *testing.T) {