2019-05-06 14:33:33 +01:00
|
|
|
package options
|
|
|
|
|
2019-05-24 17:06:48 +01:00
|
|
|
import "github.com/pusher/oauth2_proxy/pkg/encryption"
|
2019-05-15 16:56:05 +01:00
|
|
|
|
2019-05-06 14:33:33 +01:00
|
|
|
// SessionOptions contains configuration options for the SessionStore providers.
|
|
|
|
type SessionOptions struct {
|
2019-05-15 16:56:05 +01:00
|
|
|
Type string `flag:"session-store-type" cfg:"session_store_type" env:"OAUTH2_PROXY_SESSION_STORE_TYPE"`
|
2019-05-24 17:06:48 +01:00
|
|
|
Cipher *encryption.Cipher
|
2019-05-06 14:33:33 +01:00
|
|
|
CookieStoreOptions
|
2019-05-09 16:09:22 -07:00
|
|
|
RedisStoreOptions
|
2019-05-06 14:33:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// CookieSessionStoreType is used to indicate the CookieSessionStore should be
|
|
|
|
// used for storing sessions.
|
|
|
|
var CookieSessionStoreType = "cookie"
|
|
|
|
|
|
|
|
// CookieStoreOptions contains configuration options for the CookieSessionStore.
|
2019-05-15 16:56:05 +01:00
|
|
|
type CookieStoreOptions struct{}
|
2019-05-09 16:09:22 -07:00
|
|
|
|
2019-05-16 17:03:38 +01:00
|
|
|
// RedisSessionStoreType is used to indicate the RedisSessionStore should be
|
2019-05-09 16:09:22 -07:00
|
|
|
// used for storing sessions.
|
|
|
|
var RedisSessionStoreType = "redis"
|
|
|
|
|
2019-05-16 17:03:38 +01:00
|
|
|
// RedisStoreOptions contains configuration options for the RedisSessionStore.
|
2019-05-09 16:09:22 -07:00
|
|
|
type RedisStoreOptions struct {
|
2019-05-24 17:32:55 +01:00
|
|
|
RedisConnectionURL string `flag:"redis-connection-url" cfg:"redis_connection_url" env:"OAUTH2_PROXY_REDIS_CONNECTION_URL"`
|
|
|
|
UseSentinel bool `flag:"redis-use-sentinel" cfg:"redis_use_sentinel" env:"OAUTH2_PROXY_REDIS_USE_SENTINEL"`
|
|
|
|
SentinelMasterName string `flag:"redis-sentinel-master-name" cfg:"redis_sentinel_master_name" env:"OAUTH2_PROXY_REDIS_SENTINEL_MASTER_NAME"`
|
|
|
|
SentinelConnectionURLs []string `flag:"redis-sentinel-connection-urls" cfg:"redis_sentinel_connection_urls" env:"OAUTH2_PROXY_REDIS_SENTINEL_CONNECTION_URLS"`
|
2020-02-06 09:59:12 -08:00
|
|
|
UseCluster bool `flag:"redis-use-cluster" cfg:"redis_use_cluster" env:"OAUTH2_PROXY_REDIS_USE_CLUSTER"`
|
|
|
|
ClusterConnectionURLs []string `flag:"redis-cluster-connection-urls" cfg:"redis_cluster_connection_urls" env:"OAUTH2_PROXY_REDIS_CLUSTER_CONNECTION_URLS"`
|
2019-11-07 11:04:40 +01:00
|
|
|
RedisCAPath string `flag:"redis-ca-path" cfg:"redis_ca_path" env:"OAUTH2_PROXY_REDIS_CA_PATH"`
|
2019-11-12 16:11:27 +01:00
|
|
|
RedisInsecureTLS bool `flag:"redis-insecure-skip-tls-verify" cfg:"redis_insecure_skip_tls_verify" env:"OAUTH2_PROXY_REDIS_INSECURE_SKIP_TLS_VERIFY"`
|
2019-05-09 16:09:22 -07:00
|
|
|
}
|