Move cipher creation to options and away from oauth2_proxy.go

This commit is contained in:
Joel Speed
2019-05-20 11:26:13 +02:00
parent 76bd23738f
commit 093f9da881
7 changed files with 30 additions and 52 deletions
+7 -5
View File
@@ -1,9 +1,13 @@
package options
import (
"github.com/pusher/oauth2_proxy/cookie"
)
// SessionOptions contains configuration options for the SessionStore providers.
type SessionOptions struct {
Type string `flag:"session-store-type" cfg:"session_store_type" env:"OAUTH2_PROXY_SESSION_STORE_TYPE"`
EnableCipher bool // Allow the user to choose encryption or not
Type string `flag:"session-store-type" cfg:"session_store_type" env:"OAUTH2_PROXY_SESSION_STORE_TYPE"`
Cipher *cookie.Cipher
CookieStoreOptions
}
@@ -12,6 +16,4 @@ type SessionOptions struct {
var CookieSessionStoreType = "cookie"
// CookieStoreOptions contains configuration options for the CookieSessionStore.
type CookieStoreOptions struct {
EnableCipher bool // Allow the user to choose encryption or not
}
type CookieStoreOptions struct{}