diff options
| author | mo khan <mo@mokhan.ca> | 2025-05-28 18:31:00 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-05-28 18:31:00 -0600 |
| commit | cf1050dba0f0b0b26d18ce45ae2c8821153759bd (patch) | |
| tree | e3f67d0f2c47015d48f725cb9afb55282b5617c2 /pkg/web/cookie_test.go | |
| parent | 6951a69bff4d633b7fa8805e916c25b204373d9d (diff) | |
| parent | e5bc1eb2b71d46958088f1c62e69e1074e9f8026 (diff) | |
Merge branch '11/x-jwt-payload' into 'main'
Read trusted identity information from envoy headers
See merge request gitlab-org/software-supply-chain-security/authorization/sparkled!14
Diffstat (limited to 'pkg/web/cookie_test.go')
| -rw-r--r-- | pkg/web/cookie_test.go | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/pkg/web/cookie_test.go b/pkg/web/cookie_test.go deleted file mode 100644 index 1a3bfb0..0000000 --- a/pkg/web/cookie_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package web - -import ( - "net/http" - "net/http/httptest" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestNewCookie(t *testing.T) { - cookie := NewCookie("name", "value") - assert.True(t, cookie.HttpOnly) - assert.True(t, cookie.Secure) -} - -func TestExpireCookie(t *testing.T) { - w := httptest.NewRecorder() - - ExpireCookie(w, "example") - - result, err := http.ParseSetCookie(w.Header().Get("Set-Cookie")) - require.NoError(t, err) - - assert.Empty(t, result.Value) - assert.Equal(t, -1, result.MaxAge) - assert.Equal(t, time.Unix(0, 0).Unix(), result.Expires.Unix()) - assert.True(t, result.HttpOnly) - assert.True(t, result.Secure) - assert.Zero(t, result.SameSite) -} |
