git.iko.soy/typeable/oauth2-proxy
on master help sign in
Documentation updates around Redis and Redis Sentinel use
commitae0258a20385b59a401f64e99d3febd2ff43f179 authorBrian Van Klaveren <bvan@slac.stanford.edu> dateTue 28 May 2019, 13:26 (7 years ago) parent518c1d3
3 files changed+16−4
docs/configuration/configuration.md+4−1 docs/configuration/sessions.md+10−1 main.go+2−2
docs/configuration/configuration.md+4−1
@@ -75,7 +75,10 @@ Usage of oauth2_proxy:
7575 -pubjwk-url string: JWK pubkey access endpoint: required by login.gov
7676 -redeem-url string: Token redemption endpoint
7777 -redirect-url string: the OAuth Redirect URL. ie: "https://internalapp.yourcompany.com/oauth2/callback"
78− -redis-connection-url string: URL of redis server for redis session storage type (eg: redis://HOST[:PORT])
78+ -redis-connection-url string: URL of redis server for redis session storage (eg: redis://HOST[:PORT])
79+ -redis-sentinel-master-name string: Redis sentinel master name. Used in conjuction with --redis-use-sentinel
80+ -redis-sentinel-connection-urls: List of Redis sentinel conneciton URLs (eg redis://HOST[:PORT]). Used in conjuction with --redis-use-sentinel
81+ -redis-use-sentinel: Connect to redis via sentinels. Must set --redis-sentinel-master-name and --redis-sentinel-connection-urls to use this feature (default: false)
7982 -request-logging: Log requests to stdout (default true)
8083 -request-logging-format: Template for request log lines (see "Logging Configuration" paragraph below)
8184 -resource string: The resource that is protected (Azure AD only)
docs/configuration/sessions.md+10−1
@@ -55,4 +55,13 @@ to which the session is stored. The encoded session is encrypted with the secret
5555in redis via the `SETEX` command.
5656
5757Encrypting every session uniquely protects the refresh/access/id tokens stored in the session from
58−disclosure.
58+disclosure.
59+
60+#### Usage
61+
62+When using the redis store, specify `--session-store-type=redis` as well as the Redis connection URL, via
63+`--redis-connection-url=redis://host[:port][/db-number]`.
64+
65+You may also configure the store for Redis Sentinel. In this case, you will want to use the
66+`--redis-use-sentinel=true` flag, as well as configure the flags `--redis-sentinel-master-name`
67+and `--redis-sentinel-connection-urls` appropriately.
main.go+2−2
@@ -78,9 +78,9 @@ func main() {
7878
7979 flagSet.String("session-store-type", "cookie", "the session storage provider to use")
8080 flagSet.String("redis-connection-url", "", "URL of redis server for redis session storage (eg: redis://HOST[:PORT])")
81− flagSet.Bool("redis-use-sentinel", false, "Connect to redis via sentinels. Must set --redis-sentinel-master-name and --redis-sentinel-conneciton-urls to use this feature")
81+ flagSet.Bool("redis-use-sentinel", false, "Connect to redis via sentinels. Must set --redis-sentinel-master-name and --redis-sentinel-connection-urls to use this feature")
8282 flagSet.String("redis-sentinel-master-name", "", "Redis sentinel master name. Used in conjuction with --redis-use-sentinel")
83− flagSet.Var(&redisSentinelConnectionURLs, "redis-sentinel-connection-urls", "List of Redis sentinel conneciton URLs (eg redis://HOST[:PORT]). Used in conjuction with --redis-use-sentinel")
83+ flagSet.Var(&redisSentinelConnectionURLs, "redis-sentinel-connection-urls", "List of Redis sentinel connection URLs (eg redis://HOST[:PORT]). Used in conjuction with --redis-use-sentinel")
8484
8585 flagSet.String("logging-filename", "", "File to log requests to, empty for stdout")
8686 flagSet.Int("logging-max-size", 100, "Maximum size in megabytes of the log file before rotation")