1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2024-11-28 09:08:44 +02:00
oauth2-proxy/pkg/cookies/cookies_suite_test.go
Koen van Zuijlen 343bd61ebb
chore(deps): Updated to ginkgo v2 (#2459)
* chore(deps): Updated to ginkgo v2

* fix basic auth test suite cleanup

* fix redis store tests

* add changelog entry

---------

Co-authored-by: Jan Larwig <jan@larwig.com>
2024-07-18 22:41:02 +02:00

36 lines
720 B
Go

package cookies
import (
"net/http"
"testing"
"time"
"github.com/oauth2-proxy/oauth2-proxy/v7/pkg/logger"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
const (
csrfState = "1234asdf1234asdf1234asdf"
csrfNonce = "0987lkjh0987lkjh0987lkjh"
cookieName = "cookie_test_12345"
cookieSecret = "3q48hmFH30FJ2HfJF0239UFJCVcl3kj3"
cookieDomain = "o2p.cookies.test"
cookiePath = "/cookie-tests"
nowEpoch = 1609366421
)
func TestProviderSuite(t *testing.T) {
logger.SetOutput(GinkgoWriter)
RegisterFailHandler(Fail)
RunSpecs(t, "Cookies")
}
func testCookieExpires(exp time.Time) string {
var buf [len(http.TimeFormat)]byte
return string(exp.UTC().AppendFormat(buf[:0], http.TimeFormat))
}