summaryrefslogtreecommitdiff
path: root/app/controllers/sessions/controller_test.go
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-05-07 09:06:48 -0700
committermo khan <mo@mokhan.ca>2025-05-07 09:06:48 -0700
commitef050c428a0a893607314a4d5d8d441e445e630a (patch)
treee6c7e651f1fa75225053bb3c0f28c29ff15f4306 /app/controllers/sessions/controller_test.go
parent16641c74b7247f5b5c059f5726fbc724fe3858e4 (diff)
refactor: move cookie to web package
Diffstat (limited to 'app/controllers/sessions/controller_test.go')
-rw-r--r--app/controllers/sessions/controller_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/sessions/controller_test.go b/app/controllers/sessions/controller_test.go
index 8efc813..c86f2f8 100644
--- a/app/controllers/sessions/controller_test.go
+++ b/app/controllers/sessions/controller_test.go
@@ -17,7 +17,7 @@ import (
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/oidc"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/pls"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/test"
- "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/web/cookie"
+ "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/web"
)
func TestSessions(t *testing.T) {
@@ -95,7 +95,7 @@ func TestSessions(t *testing.T) {
r, w := test.RequestResponse(
"GET",
"/session/callback?code="+code+"&state=invalid",
- test.WithCookie(cookie.New("oauth_state", nonce)),
+ test.WithCookie(web.NewCookie("oauth_state", nonce)),
)
mux.ServeHTTP(w, r)
@@ -119,7 +119,7 @@ func TestSessions(t *testing.T) {
r, w := test.RequestResponse(
"GET",
"/session/callback?code="+code+"&state="+nonce,
- test.WithCookie(cookie.New("oauth_state", nonce)),
+ test.WithCookie(web.NewCookie("oauth_state", nonce)),
)
mux.ServeHTTP(w, r)
@@ -185,7 +185,7 @@ func TestSessions(t *testing.T) {
t.Run("POST /session/destroy", func(t *testing.T) {
t.Run("clears the session cookie", func(t *testing.T) {
- cookie := cookie.New("session", "value")
+ cookie := web.NewCookie("session", "value")
r, w := test.RequestResponse("POST", "/session/destroy", test.WithCookie(cookie))
mux.ServeHTTP(w, r)