diff options
author | Tuomo Ala-Vannesluoma <tuomoav@gmail.com> | 2018-08-12 12:36:10 +0300 |
---|---|---|
committer | Tuomo Ala-Vannesluoma <tuomoav@gmail.com> | 2018-08-12 12:36:10 +0300 |
commit | 1966ab9bf8592a32a7ff88e1d1439ed80f7f65bb (patch) | |
tree | 67050bfeab8865fd3b4db2746fa403932157c992 /acceptance_test.go | |
parent | 3425634584820837fd88d14b944bbdc391823936 (diff) |
Use reserved namespace 'projects' for the redirect uri to handle situation where root pages domain is not handled with pages daemon
Diffstat (limited to 'acceptance_test.go')
-rw-r--r-- | acceptance_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/acceptance_test.go b/acceptance_test.go index 516b90d2..98db0203 100644 --- a/acceptance_test.go +++ b/acceptance_test.go @@ -614,7 +614,7 @@ func TestWhenAuthIsEnabledPrivateWillRedirectToAuthorize(t *testing.T) { assert.Equal(t, "gitlab-auth.com", url.Host) assert.Equal(t, "/oauth/authorize", url.Path) assert.Equal(t, "1", url.Query().Get("client_id")) - assert.Equal(t, "https://gitlab-example.com/auth", url.Query().Get("redirect_uri")) + assert.Equal(t, "https://projects.gitlab-example.com/auth", url.Query().Get("redirect_uri")) assert.NotEqual(t, "", url.Query().Get("state")) } @@ -623,7 +623,7 @@ func TestWhenAuthDeniedWillCauseUnauthorized(t *testing.T) { teardown := RunPagesProcessWithAuth(t, *pagesBinary, listeners, "") defer teardown() - rsp, err := GetPageFromListener(t, httpsListener, "gitlab-example.com", "/auth?error=access_denied") + rsp, err := GetPageFromListener(t, httpsListener, "projects.gitlab-example.com", "/auth?error=access_denied") require.NoError(t, err) defer rsp.Body.Close() @@ -641,7 +641,7 @@ func TestWhenLoginCallbackWithWrongStateShouldFail(t *testing.T) { defer rsp.Body.Close() // Go to auth page with wrong state will cause failure - authrsp, err := GetPageFromListener(t, httpsListener, "gitlab-example.com", "/auth?code=0&state=0") + authrsp, err := GetPageFromListener(t, httpsListener, "projects.gitlab-example.com", "/auth?code=0&state=0") require.NoError(t, err) defer authrsp.Body.Close() @@ -665,7 +665,7 @@ func TestWhenLoginCallbackWithCorrectStateWithoutEndpoint(t *testing.T) { require.NoError(t, err) // Go to auth page with correct state will cause fetching the token - authrsp, err := GetPageFromListenerWithCookie(t, httpsListener, "gitlab-example.com", "/auth?code=1&state="+ + authrsp, err := GetPageFromListenerWithCookie(t, httpsListener, "projects.gitlab-example.com", "/auth?code=1&state="+ url.Query().Get("state"), cookie) require.NoError(t, err) @@ -718,7 +718,7 @@ func TestAccessControlUnderCustomDomain(t *testing.T) { pagescookie := pagesrsp.Header.Get("Set-Cookie") // Go to auth page with correct state will cause fetching the token - authrsp, err := GetRedirectPageWithCookie(t, httpListener, "gitlab-example.com", "/auth?code=1&state="+ + authrsp, err := GetRedirectPageWithCookie(t, httpListener, "projects.gitlab-example.com", "/auth?code=1&state="+ state, pagescookie) require.NoError(t, err) @@ -857,10 +857,10 @@ func TestAccessControl(t *testing.T) { assert.Equal(t, http.StatusFound, rsp.StatusCode) cookie := rsp.Header.Get("Set-Cookie") - // Redirects to the gitlab pages root domain for authentication flow + // Redirects to the projects under gitlab pages domain for authentication flow url, err := url.Parse(rsp.Header.Get("Location")) require.NoError(t, err) - assert.Equal(t, "gitlab-example.com", url.Host) + assert.Equal(t, "projects.gitlab-example.com", url.Host) assert.Equal(t, "/auth", url.Path) state := url.Query().Get("state") @@ -873,7 +873,7 @@ func TestAccessControl(t *testing.T) { pagesDomainCookie := rsp.Header.Get("Set-Cookie") // Go to auth page with correct state will cause fetching the token - authrsp, err := GetRedirectPageWithCookie(t, httpsListener, "gitlab-example.com", "/auth?code=1&state="+ + authrsp, err := GetRedirectPageWithCookie(t, httpsListener, "projects.gitlab-example.com", "/auth?code=1&state="+ state, pagesDomainCookie) require.NoError(t, err) |