git.iko.soy/typeable/oauth2-proxy
on master help sign in
Rename cookie-domain config to cookie-domains (#559)

Co-authored-by: Henry Jenkins <henry@henryjenkins.name>

commit810a9e9967e23dfe3ec81000fcb268026d188e5b authorJoel Speed <Joel.speed@hotmail.co.uk> dateSun 24 May 2020, 20:19 (6 years ago) parentfc11d8d
4 files changed+10−5
CHANGELOG.md+5 contrib/local-environment/oauth2-proxy-nginx.cfg+1−1 contrib/oauth2-proxy.cfg.example+3−3 pkg/apis/options/cookie.go+1−1
CHANGELOG.md+5
@@ -39,9 +39,14 @@
3939 reporting an invalid length of 20 or 28 when the user input cookie-secret was not that length.
4040 - Now we will only base64 decode a cookie-secret to raw bytes if it is 16, 24, or 32 bytes long. Otherwise, we will convert
4141 the direct cookie-secret to bytes without silent padding added.
42+- [#412](https://github.com/oauth2-proxy/oauth2-proxy/pull/412)/[#559](https://github.com/oauth2-proxy/oauth2-proxy/pull/559) Allow multiple cookie domains to be specified
43+ - Multiple cookie domains may now be configured. The longest domain that matches will be used.
44+ - The config options `cookie_domain` is now `cookie_domains`
45+ - The environment variable `OAUTH2_PROXY_COOKIE_DOMAIN` is now `OAUTH2_PROXY_COOKIE_DOMAINS`
4246
4347## Changes since v5.1.1
4448
49+- [#559](https://github.com/oauth2-proxy/oauth2-proxy/pull/559) Rename cookie-domain config to cookie-domains (@JoelSpeed)
4550- [#569](https://github.com/oauth2-proxy/oauth2-proxy/pull/569) Updated autocompletion for `--` long options. (@Izzette)
4651- [#489](https://github.com/oauth2-proxy/oauth2-proxy/pull/489) Move Options and Validation to separate packages (@JoelSpeed)
4752- [#556](https://github.com/oauth2-proxy/oauth2-proxy/pull/556) Remove unintentional auto-padding of secrets that were too short (@NickMeves)
contrib/local-environment/oauth2-proxy-nginx.cfg+1−1
@@ -8,5 +8,5 @@ client_id="oauth2-proxy"
88cookie_secure="false"
99
1010redirect_url="http://oauth2-proxy.oauth2-proxy.localhost/oauth2/callback"
11−cookie_domain=".oauth2-proxy.localhost" # Required so cookie can be read on all subdomains.
11+cookie_domains=".oauth2-proxy.localhost" # Required so cookie can be read on all subdomains.
1212whitelist_domains=".oauth2-proxy.localhost" # Required to allow redirection back to original requested target.
contrib/oauth2-proxy.cfg.example+3−3
@@ -39,7 +39,7 @@
3939# pass_user_headers = true
4040## pass the request Host Header to upstream
4141## when disabled the upstream Host is used as the Host Header
42−# pass_host_header = true
42+# pass_host_header = true
4343
4444## Email Domains to allow authentication for (this authorizes any email on this domain)
4545## for more granular authorization use `authenticated_emails_file`
@@ -80,13 +80,13 @@
8080## Expire - (duration) expire timeframe for cookie
8181## Refresh - (duration) refresh the cookie when duration has elapsed after cookie was initially set.
8282## Should be less than cookie_expire; set to 0 to disable.
83−## On refresh, OAuth token is re-validated.
83+## On refresh, OAuth token is re-validated.
8484## (ie: 1h means tokens are refreshed on request 1hr+ after it was set)
8585## Secure - secure cookies are only sent by the browser of a HTTPS connection (recommended)
8686## HttpOnly - httponly cookies are not readable by javascript (recommended)
8787# cookie_name = "_oauth2_proxy"
8888# cookie_secret = ""
89−# cookie_domain = ""
89+# cookie_domains = ""
9090# cookie_expire = "168h"
9191# cookie_refresh = ""
9292# cookie_secure = true
pkg/apis/options/cookie.go+1−1
@@ -6,7 +6,7 @@ import "time"
66type CookieOptions struct {
77 Name string `flag:"cookie-name" cfg:"cookie_name"`
88 Secret string `flag:"cookie-secret" cfg:"cookie_secret"`
9− Domains []string `flag:"cookie-domain" cfg:"cookie_domain"`
9+ Domains []string `flag:"cookie-domain" cfg:"cookie_domains"`
1010 Path string `flag:"cookie-path" cfg:"cookie_path"`
1111 Expire time.Duration `flag:"cookie-expire" cfg:"cookie_expire"`
1212 Refresh time.Duration `flag:"cookie-refresh" cfg:"cookie_refresh"`