@@ -21,7 +21,7 @@ import (
22type OauthProxy struct {
22type OauthProxy struct {
23 CookieSeed string
23 CookieSeed string
24− CookieKey string
24+ CookieName string
25 CookieDomain string
25 CookieDomain string
26 CookieSecure bool
26 CookieSecure bool
27 CookieHttpOnly bool
27 CookieHttpOnly bool
@@ -109,12 +109,8 @@ func NewOauthProxy(opts *Options, validator func(string) bool) *OauthProxy {
109 if domain == "" {
109 if domain == "" {
110 domain = "<default>"
110 domain = "<default>"
112− if !opts.CookieHttpsOnly {
113− log.Printf("Warning: cookie-https-only setting is deprecated and will be removed in a future version. use cookie-secure")
114− opts.CookieSecure = opts.CookieHttpsOnly
117− log.Printf("Cookie settings: name:%s secure (https):%v httponly:%v expiry:%s domain:%s", opts.CookieKey, opts.CookieSecure, opts.CookieHttpOnly, opts.CookieExpire, domain)
113+ log.Printf("Cookie settings: name:%s secure(https):%v httponly:%v expiry:%s domain:%s", opts.CookieName, opts.CookieSecure, opts.CookieHttpOnly, opts.CookieExpire, domain)
119 var aes_cipher cipher.Block
115 var aes_cipher cipher.Block
120 if opts.PassAccessToken || (opts.CookieRefresh != time.Duration(0)) {
116 if opts.PassAccessToken || (opts.CookieRefresh != time.Duration(0)) {
@@ -127,7 +123,7 @@ func NewOauthProxy(opts *Options, validator func(string) bool) *OauthProxy {
129 return &OauthProxy{
125 return &OauthProxy{
130− CookieKey: opts.CookieKey,
126+ CookieName: opts.CookieName,
131 CookieSeed: opts.CookieSecret,
127 CookieSeed: opts.CookieSecret,
132 CookieDomain: opts.CookieDomain,
128 CookieDomain: opts.CookieDomain,
133 CookieSecure: opts.CookieSecure,
129 CookieSecure: opts.CookieSecure,
@@ -208,11 +204,11 @@ func (p *OauthProxy) MakeCookie(req *http.Request, value string, expiration time
210 if value != "" {
206 if value != "" {
211− value = signedCookieValue(p.CookieSeed, p.CookieKey, value)
207+ value = signedCookieValue(p.CookieSeed, p.CookieName, value)
214 return &http.Cookie{
210 return &http.Cookie{
215− Name: p.CookieKey,
211+ Name: p.CookieName,
216 Value: value,
212 Value: value,
217 Path: "/",
213 Path: "/",
218 Domain: domain,
214 Domain: domain,
@@ -233,7 +229,7 @@ func (p *OauthProxy) SetCookie(rw http.ResponseWriter, req *http.Request, val st
233func (p *OauthProxy) ProcessCookie(rw http.ResponseWriter, req *http.Request) (email, user, access_token string, ok bool) {
229func (p *OauthProxy) ProcessCookie(rw http.ResponseWriter, req *http.Request) (email, user, access_token string, ok bool) {
234 var value string
230 var value string
235 var timestamp time.Time
231 var timestamp time.Time
236− cookie, err := req.Cookie(p.CookieKey)
232+ cookie, err := req.Cookie(p.CookieName)
237 if err == nil {
233 if err == nil {
238 value, timestamp, ok = validateCookie(cookie, p.CookieSeed)
234 value, timestamp, ok = validateCookie(cookie, p.CookieSeed)