@@ -164,7 +164,7 @@ func TestRobotsTxt(t *testing.T) {
164164 opts := NewOptions()
165165 opts.ClientID = "asdlkjx"
166166 opts.ClientSecret = "alkgks"
167− opts.CookieSecret = "asdkugkj"
167+ opts.Cookie.Secret = "asdkugkj"
168168 opts.Validate()
169169
170170 proxy := NewOAuthProxy(opts, func(string) bool { return true })
@@ -179,7 +179,7 @@ func TestIsValidRedirect(t *testing.T) {
179179 opts := NewOptions()
180180 opts.ClientID = "skdlfj"
181181 opts.ClientSecret = "fgkdsgj"
182− opts.CookieSecret = "ljgiogbj"
182+ opts.Cookie.Secret = "ljgiogbj"
183183 // Should match domains that are exactly foo.bar and any subdomain of bar.foo
184184 opts.WhitelistDomains = []string{
185185 "foo.bar",
@@ -398,10 +398,10 @@ func TestBasicAuthPassword(t *testing.T) {
398398 opts.Upstreams = append(opts.Upstreams, providerServer.URL)
399399 // The CookieSecret must be 32 bytes in order to create the AES
400400 // cipher.
401− opts.CookieSecret = "xyzzyplughxyzzyplughxyzzyplughxp"
401+ opts.Cookie.Secret = "xyzzyplughxyzzyplughxyzzyplughxp"
402402 opts.ClientID = "dlgkj"
403403 opts.ClientSecret = "alkgret"
404− opts.CookieSecure = false
404+ opts.Cookie.Secure = false
405405 opts.PassBasicAuth = true
406406 opts.SetBasicAuth = true
407407 opts.PassUserHeaders = true
@@ -582,10 +582,10 @@ func NewPassAccessTokenTest(opts PassAccessTokenTestOptions) *PassAccessTokenTes
582582 }
583583 // The CookieSecret must be 32 bytes in order to create the AES
584584 // cipher.
585− t.opts.CookieSecret = "xyzzyplughxyzzyplughxyzzyplughxp"
585+ t.opts.Cookie.Secret = "xyzzyplughxyzzyplughxyzzyplughxp"
586586 t.opts.ClientID = "slgkj"
587587 t.opts.ClientSecret = "gfjgojl"
588− t.opts.CookieSecure = false
588+ t.opts.Cookie.Secure = false
589589 t.opts.PassAccessToken = opts.PassAccessToken
590590 t.opts.Validate()
591591
@@ -735,7 +735,7 @@ func NewSignInPageTest(skipProvider bool) *SignInPageTest {
735735 var sipTest SignInPageTest
736736
737737 sipTest.opts = NewOptions()
738− sipTest.opts.CookieSecret = "adklsj2"
738+ sipTest.opts.Cookie.Secret = "adklsj2"
739739 sipTest.opts.ClientID = "lkdgj"
740740 sipTest.opts.ClientSecret = "sgiufgoi"
741741 sipTest.opts.SkipProviderButton = skipProvider
@@ -841,10 +841,10 @@ func NewProcessCookieTest(opts ProcessCookieTestOpts, modifiers ...OptionsModifi
841841 }
842842 pcTest.opts.ClientID = "asdfljk"
843843 pcTest.opts.ClientSecret = "lkjfdsig"
844− pcTest.opts.CookieSecret = "0123456789abcdefabcd"
844+ pcTest.opts.Cookie.Secret = "0123456789abcdefabcd"
845845 // First, set the CookieRefresh option so proxy.AesCipher is created,
846846 // needed to encrypt the access_token.
847− pcTest.opts.CookieRefresh = time.Hour
847+ pcTest.opts.Cookie.Refresh = time.Hour
848848 pcTest.opts.Validate()
849849
850850 pcTest.proxy = NewOAuthProxy(pcTest.opts, func(email string) bool {
@@ -915,7 +915,7 @@ func TestProcessCookieNoCookieError(t *testing.T) {
915915
916916func TestProcessCookieRefreshNotSet(t *testing.T) {
917917 pcTest := NewProcessCookieTestWithOptionsModifiers(func(opts *Options) {
918− opts.CookieExpire = time.Duration(23) * time.Hour
918+ opts.Cookie.Expire = time.Duration(23) * time.Hour
919919 })
920920 reference := time.Now().Add(time.Duration(-2) * time.Hour)
921921
@@ -932,7 +932,7 @@ func TestProcessCookieRefreshNotSet(t *testing.T) {
932932
933933func TestProcessCookieFailIfCookieExpired(t *testing.T) {
934934 pcTest := NewProcessCookieTestWithOptionsModifiers(func(opts *Options) {
935− opts.CookieExpire = time.Duration(24) * time.Hour
935+ opts.Cookie.Expire = time.Duration(24) * time.Hour
936936 })
937937 reference := time.Now().Add(time.Duration(25) * time.Hour * -1)
938938 startSession := &sessions.SessionState{Email: "michael.bland@gsa.gov", AccessToken: "my_access_token", CreatedAt: reference}
@@ -947,7 +947,7 @@ func TestProcessCookieFailIfCookieExpired(t *testing.T) {
947947
948948func TestProcessCookieFailIfRefreshSetAndCookieExpired(t *testing.T) {
949949 pcTest := NewProcessCookieTestWithOptionsModifiers(func(opts *Options) {
950− opts.CookieExpire = time.Duration(24) * time.Hour
950+ opts.Cookie.Expire = time.Duration(24) * time.Hour
951951 })
952952 reference := time.Now().Add(time.Duration(25) * time.Hour * -1)
953953 startSession := &sessions.SessionState{Email: "michael.bland@gsa.gov", AccessToken: "my_access_token", CreatedAt: reference}
@@ -1017,7 +1017,7 @@ func TestAuthOnlyEndpointUnauthorizedOnNoCookieSetError(t *testing.T) {
10171017
10181018func TestAuthOnlyEndpointUnauthorizedOnExpiration(t *testing.T) {
10191019 test := NewAuthOnlyEndpointTest(func(opts *Options) {
1020− opts.CookieExpire = time.Duration(24) * time.Hour
1020+ opts.Cookie.Expire = time.Duration(24) * time.Hour
10211021 })
10221022 reference := time.Now().Add(time.Duration(25) * time.Hour * -1)
10231023 startSession := &sessions.SessionState{
@@ -1149,7 +1149,7 @@ func TestAuthSkippedForPreflightRequests(t *testing.T) {
11491149 opts.Upstreams = append(opts.Upstreams, upstream.URL)
11501150 opts.ClientID = "aljsal"
11511151 opts.ClientSecret = "jglkfsdgj"
1152− opts.CookieSecret = "dkfjgdls"
1152+ opts.Cookie.Secret = "dkfjgdls"
11531153 opts.SkipAuthPreflight = true
11541154 opts.Validate()
11551155
@@ -1196,7 +1196,7 @@ type SignatureTest struct {
11961196
11971197func NewSignatureTest() *SignatureTest {
11981198 opts := NewOptions()
1199− opts.CookieSecret = "cookie secret"
1199+ opts.Cookie.Secret = "cookie secret"
12001200 opts.ClientID = "client ID"
12011201 opts.ClientSecret = "client secret"
12021202 opts.EmailDomains = []string{"acm.org"}
@@ -1343,7 +1343,7 @@ type ajaxRequestTest struct {
13431343func newAjaxRequestTest() *ajaxRequestTest {
13441344 test := &ajaxRequestTest{}
13451345 test.opts = NewOptions()
1346− test.opts.CookieSecret = "sdflsw"
1346+ test.opts.Cookie.Secret = "sdflsw"
13471347 test.opts.ClientID = "gkljfdl"
13481348 test.opts.ClientSecret = "sdflkjs"
13491349 test.opts.Validate()
@@ -1401,11 +1401,11 @@ func TestAjaxForbiddendRequest(t *testing.T) {
14011401
14021402func TestClearSplitCookie(t *testing.T) {
14031403 opts := NewOptions()
1404− opts.CookieName = "oauth2"
1405− opts.CookieDomains = []string{"abc"}
1406− store, err := cookie.NewCookieSessionStore(&opts.SessionOptions, &opts.CookieOptions)
1404+ opts.Cookie.Name = "oauth2"
1405+ opts.Cookie.Domains = []string{"abc"}
1406+ store, err := cookie.NewCookieSessionStore(&opts.SessionOptions, &opts.Cookie)
14071407 assert.Equal(t, err, nil)
1408− p := OAuthProxy{CookieName: opts.CookieName, CookieDomains: opts.CookieDomains, sessionStore: store}
1408+ p := OAuthProxy{CookieName: opts.Cookie.Name, CookieDomains: opts.Cookie.Domains, sessionStore: store}
14091409 var rw = httptest.NewRecorder()
14101410 req := httptest.NewRequest("get", "/", nil)
14111411
@@ -1430,11 +1430,11 @@ func TestClearSplitCookie(t *testing.T) {
14301430
14311431func TestClearSingleCookie(t *testing.T) {
14321432 opts := NewOptions()
1433− opts.CookieName = "oauth2"
1434− opts.CookieDomains = []string{"abc"}
1435− store, err := cookie.NewCookieSessionStore(&opts.SessionOptions, &opts.CookieOptions)
1433+ opts.Cookie.Name = "oauth2"
1434+ opts.Cookie.Domains = []string{"abc"}
1435+ store, err := cookie.NewCookieSessionStore(&opts.SessionOptions, &opts.Cookie)
14361436 assert.Equal(t, err, nil)
1437− p := OAuthProxy{CookieName: opts.CookieName, CookieDomains: opts.CookieDomains, sessionStore: store}
1437+ p := OAuthProxy{CookieName: opts.Cookie.Name, CookieDomains: opts.Cookie.Domains, sessionStore: store}
14381438 var rw = httptest.NewRecorder()
14391439 req := httptest.NewRequest("get", "/", nil)
14401440