1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-08-08 22:46:33 +02:00

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>
This commit is contained in:
Koen van Zuijlen
2024-07-18 22:41:02 +02:00
committed by GitHub
parent 211c605875
commit 343bd61ebb
88 changed files with 337 additions and 401 deletions

View File

@ -576,8 +576,11 @@ type SignInPageTest struct {
signInProviderRegexp *regexp.Regexp
}
const signInRedirectPattern = `<input type="hidden" name="rd" value="(.*)">`
const signInSkipProvider = `>Found<`
const (
signInRedirectPattern = `<input type="hidden" name="rd" value="(.*)">`
signInSkipProvider = `>Found<`
patternNotFound = "Did not find pattern in body: "
)
func NewSignInPageTest(skipProvider bool) (*SignInPageTest, error) {
var sipTest SignInPageTest
@ -720,7 +723,7 @@ func TestSignInPageIncludesTargetRedirect(t *testing.T) {
match := sipTest.signInRegexp.FindStringSubmatch(body)
if match == nil {
t.Fatal("Did not find pattern in body: " +
t.Fatal(patternNotFound +
signInRedirectPattern + "\nBody:\n" + body)
}
if match[1] != endpoint {
@ -750,7 +753,7 @@ func TestSignInPageDirectAccessRedirectsToRoot(t *testing.T) {
match := sipTest.signInRegexp.FindStringSubmatch(body)
if match == nil {
t.Fatal("Did not find pattern in body: " +
t.Fatal(patternNotFound +
signInRedirectPattern + "\nBody:\n" + body)
}
if match[1] != "/" {
@ -771,7 +774,7 @@ func TestSignInPageSkipProvider(t *testing.T) {
match := sipTest.signInProviderRegexp.FindStringSubmatch(body)
if match == nil {
t.Fatal("Did not find pattern in body: " +
t.Fatal(patternNotFound +
signInSkipProvider + "\nBody:\n" + body)
}
}
@ -789,7 +792,7 @@ func TestSignInPageSkipProviderDirect(t *testing.T) {
match := sipTest.signInProviderRegexp.FindStringSubmatch(body)
if match == nil {
t.Fatal("Did not find pattern in body: " +
t.Fatal(patternNotFound +
signInSkipProvider + "\nBody:\n" + body)
}
}
@ -1212,7 +1215,7 @@ func TestAuthOnlyEndpointSetXAuthRequestHeaders(t *testing.T) {
pcTest.rw = httptest.NewRecorder()
pcTest.req, _ = http.NewRequest("GET",
pcTest.opts.ProxyPrefix+"/auth", nil)
pcTest.opts.ProxyPrefix+authOnlyPath, nil)
created := time.Now()
startSession := &sessions.SessionState{
@ -1305,7 +1308,7 @@ func TestAuthOnlyEndpointSetBasicAuthTrueRequestHeaders(t *testing.T) {
pcTest.rw = httptest.NewRecorder()
pcTest.req, _ = http.NewRequest("GET",
pcTest.opts.ProxyPrefix+"/auth", nil)
pcTest.opts.ProxyPrefix+authOnlyPath, nil)
created := time.Now()
startSession := &sessions.SessionState{
@ -1385,7 +1388,7 @@ func TestAuthOnlyEndpointSetBasicAuthFalseRequestHeaders(t *testing.T) {
pcTest.rw = httptest.NewRecorder()
pcTest.req, _ = http.NewRequest("GET",
pcTest.opts.ProxyPrefix+"/auth", nil)
pcTest.opts.ProxyPrefix+authOnlyPath, nil)
created := time.Now()
startSession := &sessions.SessionState{