@@ -29,6 +29,13 @@ import (
2929 "golang.org/x/net/websocket"
3030)
3131
32+const (
33+ // The rawCookieSecret is 32 bytes and the base64CookieSecret is the base64
34+ // encoded version of this.
35+ rawCookieSecret = "secretthirtytwobytes+abcdefghijk"
36+ base64CookieSecret = "c2VjcmV0dGhpcnR5dHdvYnl0ZXMrYWJjZGVmZ2hpamsK"
37+)
38+
3239func init() {
3340 logger.SetFlags(logger.Lshortfile)
3441
@@ -166,7 +173,7 @@ func TestRobotsTxt(t *testing.T) {
166173 opts := options.NewOptions()
167174 opts.ClientID = "asdlkjx"
168175 opts.ClientSecret = "alkgks"
169− opts.Cookie.Secret = "asdkugkj"
176+ opts.Cookie.Secret = rawCookieSecret
170177 validation.Validate(opts)
171178
172179 proxy := NewOAuthProxy(opts, func(string) bool { return true })
@@ -181,7 +188,7 @@ func TestIsValidRedirect(t *testing.T) {
181188 opts := options.NewOptions()
182189 opts.ClientID = "skdlfj"
183190 opts.ClientSecret = "fgkdsgj"
184− opts.Cookie.Secret = "ljgiogbj"
191+ opts.Cookie.Secret = base64CookieSecret
185192 // Should match domains that are exactly foo.bar and any subdomain of bar.foo
186193 opts.WhitelistDomains = []string{
187194 "foo.bar",
@@ -794,7 +801,7 @@ func NewSignInPageTest(skipProvider bool) *SignInPageTest {
794801 var sipTest SignInPageTest
795802
796803 sipTest.opts = options.NewOptions()
797− sipTest.opts.Cookie.Secret = "adklsj2"
804+ sipTest.opts.Cookie.Secret = rawCookieSecret
798805 sipTest.opts.ClientID = "lkdgj"
799806 sipTest.opts.ClientSecret = "sgiufgoi"
800807 sipTest.opts.SkipProviderButton = skipProvider
@@ -1208,7 +1215,7 @@ func TestAuthSkippedForPreflightRequests(t *testing.T) {
12081215 opts.Upstreams = append(opts.Upstreams, upstream.URL)
12091216 opts.ClientID = "aljsal"
12101217 opts.ClientSecret = "jglkfsdgj"
1211− opts.Cookie.Secret = "dkfjgdls"
1218+ opts.Cookie.Secret = base64CookieSecret
12121219 opts.SkipAuthPreflight = true
12131220 validation.Validate(opts)
12141221
@@ -1255,7 +1262,7 @@ type SignatureTest struct {
12551262
12561263func NewSignatureTest() *SignatureTest {
12571264 opts := options.NewOptions()
1258− opts.Cookie.Secret = "cookie secret"
1265+ opts.Cookie.Secret = rawCookieSecret
12591266 opts.ClientID = "client ID"
12601267 opts.ClientSecret = "client secret"
12611268 opts.EmailDomains = []string{"acm.org"}
@@ -1402,7 +1409,7 @@ type ajaxRequestTest struct {
14021409func newAjaxRequestTest() *ajaxRequestTest {
14031410 test := &ajaxRequestTest{}
14041411 test.opts = options.NewOptions()
1405− test.opts.Cookie.Secret = "sdflsw"
1412+ test.opts.Cookie.Secret = base64CookieSecret
14061413 test.opts.ClientID = "gkljfdl"
14071414 test.opts.ClientSecret = "sdflkjs"
14081415 validation.Validate(test.opts)