git.iko.soy/typeable/oauth2-proxy
on master help sign in
Merge pull request #496 from talam/update_gitlab_api_endpoint

providers: update gitlab api endpoint to use latest version, v4

commit28e217dc8fd8f4b41db662f49add4f6cd5069038 authorJehiah Czebotar <jehiah@gmail.com> dateMon 6 Nov 2017, 13:15 (9 years ago) parentbfda078f2a995b
3 files changed+6−6
README.md+1−1 providers/gitlab.go+1−1 providers/gitlab_test.go+4−4
README.md+1−1
@@ -114,7 +114,7 @@ If you are using self-hosted GitLab, make sure you set the following to the appr
114114
115115 -login-url="<your gitlab url>/oauth/authorize"
116116 -redeem-url="<your gitlab url>/oauth/token"
117− -validate-url="<your gitlab url>/api/v3/user"
117+ -validate-url="<your gitlab url>/api/v4/user"
118118
119119
120120### LinkedIn Auth Provider
providers/gitlab.go+1−1
@@ -32,7 +32,7 @@ func NewGitLabProvider(p *ProviderData) *GitLabProvider {
3232 p.ValidateURL = &url.URL{
3333 Scheme: "https",
3434 Host: "gitlab.com",
35− Path: "/api/v3/user",
35+ Path: "/api/v4/user",
3636 }
3737 }
3838 if p.Scope == "" {
providers/gitlab_test.go+4−4
@@ -28,7 +28,7 @@ func testGitLabProvider(hostname string) *GitLabProvider {
2828}
2929
3030func testGitLabBackend(payload string) *httptest.Server {
31− path := "/api/v3/user"
31+ path := "/api/v4/user"
3232 query := "access_token=imaginary_access_token"
3333
3434 return httptest.NewServer(http.HandlerFunc(
@@ -51,7 +51,7 @@ func TestGitLabProviderDefaults(t *testing.T) {
5151 p.Data().LoginURL.String())
5252 assert.Equal(t, "https://gitlab.com/oauth/token",
5353 p.Data().RedeemURL.String())
54− assert.Equal(t, "https://gitlab.com/api/v3/user",
54+ assert.Equal(t, "https://gitlab.com/api/v4/user",
5555 p.Data().ValidateURL.String())
5656 assert.Equal(t, "read_user", p.Data().Scope)
5757}
@@ -70,7 +70,7 @@ func TestGitLabProviderOverrides(t *testing.T) {
7070 ValidateURL: &url.URL{
7171 Scheme: "https",
7272 Host: "example.com",
73− Path: "/api/v3/user"},
73+ Path: "/api/v4/user"},
7474 Scope: "profile"})
7575 assert.NotEqual(t, nil, p)
7676 assert.Equal(t, "GitLab", p.Data().ProviderName)
@@ -78,7 +78,7 @@ func TestGitLabProviderOverrides(t *testing.T) {
7878 p.Data().LoginURL.String())
7979 assert.Equal(t, "https://example.com/oauth/token",
8080 p.Data().RedeemURL.String())
81− assert.Equal(t, "https://example.com/api/v3/user",
81+ assert.Equal(t, "https://example.com/api/v4/user",
8282 p.Data().ValidateURL.String())
8383 assert.Equal(t, "profile", p.Data().Scope)
8484}