diff options
author | Tuomo Ala-Vannesluoma <tuomoav@gmail.com> | 2018-09-22 14:52:47 +0300 |
---|---|---|
committer | Tuomo Ala-Vannesluoma <tuomoav@gmail.com> | 2018-09-22 14:52:47 +0300 |
commit | 0cb2e9714fc66486b8deaeeb06c60ae7b701698f (patch) | |
tree | db18b677b5bc60582e9ad054e15c270519883eb8 /acceptance_test.go | |
parent | 2c766aba4f008c4a80e328a4eabbaae186276fc9 (diff) |
Add special handling for namespace projects to avoid existence leak
Diffstat (limited to 'acceptance_test.go')
-rw-r--r-- | acceptance_test.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/acceptance_test.go b/acceptance_test.go index f0cdc749..17eb7cb4 100644 --- a/acceptance_test.go +++ b/acceptance_test.go @@ -754,6 +754,31 @@ func TestAccessControlUnderCustomDomain(t *testing.T) { assert.Equal(t, http.StatusOK, authrsp.StatusCode) } +func TestAccessControlGroupDomain404RedirectsAuth(t *testing.T) { + skipUnlessEnabled(t) + teardown := RunPagesProcessWithAuth(t, *pagesBinary, listeners, "") + defer teardown() + + rsp, err := GetRedirectPage(t, httpListener, "group.gitlab-example.com", "/nonexistent/") + require.NoError(t, err) + defer rsp.Body.Close() + assert.Equal(t, http.StatusFound, rsp.StatusCode) + // 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, "projects.gitlab-example.com", url.Host) + assert.Equal(t, "/auth", url.Path) +} +func TestAccessControlProject404DoesNotRedirect(t *testing.T) { + skipUnlessEnabled(t) + teardown := RunPagesProcessWithAuth(t, *pagesBinary, listeners, "") + defer teardown() + + rsp, err := GetRedirectPage(t, httpListener, "group.gitlab-example.com", "/project/nonexistent/") + require.NoError(t, err) + defer rsp.Body.Close() + assert.Equal(t, http.StatusNotFound, rsp.StatusCode) +} func TestAccessControl(t *testing.T) { skipUnlessEnabled(t, "not-inplace-chroot") |