git.iko.soy/typeable/oauth2-proxy
on master help sign in
options bug fixes; set https cookies on by default
commit1f515eba3ca73bdb7ff9a365fdd4ce73e9213f7f authorJehiah Czebotar <jehiah@gmail.com> dateSun 9 Nov 2014, 22:21 (12 years ago) parentba7aee9
3 files changed+12−2
main.go+1−1 oauthproxy.go+5 options.go+6−1
main.go+1−1
@@ -37,7 +37,7 @@ func main() {
3737 flagSet.String("cookie-secret", "", "the seed string for secure cookies")
3838 flagSet.String("cookie-domain", "", "an optional cookie domain to force cookies to (ie: .yourcompany.com)*")
3939 flagSet.Duration("cookie-expire", time.Duration(168)*time.Hour, "expire timeframe for cookie")
40− flagSet.Bool("cookie-https-only", false, "set HTTPS only cookie")
40+ flagSet.Bool("cookie-https-only", true, "set HTTPS only cookie")
4141
4242 flagSet.Parse(os.Args[1:])
4343
oauthproxy.go+5
@@ -55,6 +55,11 @@ func NewOauthProxy(opts *Options, validator func(string) bool) *OauthProxy {
5555 redirectUrl.Path = oauthCallbackPath
5656
5757 log.Printf("OauthProxy configured for %s", opts.ClientID)
58+ domain := opts.CookieDomain
59+ if domain == "" {
60+ domain = "<default>"
61+ }
62+ log.Printf("Cookie settings: https_only: %v expiry: %s domain:%s", opts.CookieHttpsOnly, opts.CookieExpire, domain)
5863 return &OauthProxy{
5964 CookieKey: "_oauthproxy",
6065 CookieSeed: opts.CookieSecret,
options.go+6−1
@@ -29,7 +29,12 @@ type Options struct {
2929}
3030
3131func NewOptions() *Options {
32− return &Options{}
32+ return &Options{
33+ HttpAddress: "127.0.0.1:4180",
34+ CookieHttpsOnly: true,
35+ PassBasicAuth: true,
36+ CookieExpire: time.Duration(168) * time.Hour,
37+ }
3338}
3439
3540func (o *Options) Validate() error {