1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-11-27 22:38:39 +02:00

Fix tests broken by security advisory

This commit is contained in:
Joel Speed
2020-06-27 12:41:46 +01:00
parent 25154ede41
commit 6b43b41638
3 changed files with 33 additions and 5 deletions

View File

@@ -437,10 +437,11 @@ func TestIsValidRedirect(t *testing.T) {
}
func TestOpenRedirects(t *testing.T) {
opts := NewOptions()
opts := options.NewOptions()
opts.ClientID = "skdlfj"
opts.ClientSecret = "fgkdsgj"
opts.Cookie.Secret = "ljgiogbj"
opts.Cookie.Secret = rawCookieSecret
opts.EmailDomains = []string{"*"}
// Should match domains that are exactly foo.bar and any subdomain of bar.foo
opts.WhitelistDomains = []string{
"foo.bar",
@@ -451,7 +452,10 @@ func TestOpenRedirects(t *testing.T) {
".sub.anyport.bar:*",
"www.whitelisteddomain.tld",
}
opts.Validate()
err := validation.Validate(opts)
if err != nil {
t.Fatal(err)
}
proxy := NewOAuthProxy(opts, func(string) bool { return true })