*: rename Oauth to OAuth
Be consistent with Go capitalization styling and use a single way of spelling this across the tree.
This commit is contained in:
		
							parent
							
								
									1ff2fce25b
								
							
						
					
					
						commit
						6db18804f3
					
				
							
								
								
									
										6
									
								
								main.go
								
								
								
								
							
							
						
						
									
										6
									
								
								main.go
								
								
								
								
							|  | @ -66,8 +66,8 @@ func main() { | ||||||
| 	flagSet.String("redeem-url", "", "Token redemption endpoint") | 	flagSet.String("redeem-url", "", "Token redemption endpoint") | ||||||
| 	flagSet.String("profile-url", "", "Profile access endpoint") | 	flagSet.String("profile-url", "", "Profile access endpoint") | ||||||
| 	flagSet.String("validate-url", "", "Access token validation endpoint") | 	flagSet.String("validate-url", "", "Access token validation endpoint") | ||||||
| 	flagSet.String("scope", "", "Oauth scope specification") | 	flagSet.String("scope", "", "OAuth scope specification") | ||||||
| 	flagSet.String("approval-prompt", "force", "Oauth approval_prompt") | 	flagSet.String("approval-prompt", "force", "OAuth approval_prompt") | ||||||
| 
 | 
 | ||||||
| 	flagSet.Parse(os.Args[1:]) | 	flagSet.Parse(os.Args[1:]) | ||||||
| 
 | 
 | ||||||
|  | @ -95,7 +95,7 @@ func main() { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	validator := NewValidator(opts.EmailDomains, opts.AuthenticatedEmailsFile) | 	validator := NewValidator(opts.EmailDomains, opts.AuthenticatedEmailsFile) | ||||||
| 	oauthproxy := NewOauthProxy(opts, validator) | 	oauthproxy := NewOAuthProxy(opts, validator) | ||||||
| 
 | 
 | ||||||
| 	if len(opts.EmailDomains) != 0 && opts.AuthenticatedEmailsFile == "" { | 	if len(opts.EmailDomains) != 0 && opts.AuthenticatedEmailsFile == "" { | ||||||
| 		if len(opts.EmailDomains) > 1 { | 		if len(opts.EmailDomains) > 1 { | ||||||
|  |  | ||||||
|  | @ -18,7 +18,7 @@ import ( | ||||||
| 	"github.com/bitly/oauth2_proxy/providers" | 	"github.com/bitly/oauth2_proxy/providers" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| type OauthProxy struct { | type OAuthProxy struct { | ||||||
| 	CookieSeed     string | 	CookieSeed     string | ||||||
| 	CookieName     string | 	CookieName     string | ||||||
| 	CookieDomain   string | 	CookieDomain   string | ||||||
|  | @ -31,8 +31,8 @@ type OauthProxy struct { | ||||||
| 	RobotsPath        string | 	RobotsPath        string | ||||||
| 	PingPath          string | 	PingPath          string | ||||||
| 	SignInPath        string | 	SignInPath        string | ||||||
| 	OauthStartPath    string | 	OAuthStartPath    string | ||||||
| 	OauthCallbackPath string | 	OAuthCallbackPath string | ||||||
| 
 | 
 | ||||||
| 	redirectURL         *url.URL // the url to receive requests at
 | 	redirectURL         *url.URL // the url to receive requests at
 | ||||||
| 	provider            providers.Provider | 	provider            providers.Provider | ||||||
|  | @ -86,7 +86,7 @@ func NewFileServer(path string, filesystemPath string) (proxy http.Handler) { | ||||||
| 	return http.StripPrefix(path, http.FileServer(http.Dir(filesystemPath))) | 	return http.StripPrefix(path, http.FileServer(http.Dir(filesystemPath))) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func NewOauthProxy(opts *Options, validator func(string) bool) *OauthProxy { | func NewOAuthProxy(opts *Options, validator func(string) bool) *OAuthProxy { | ||||||
| 	serveMux := http.NewServeMux() | 	serveMux := http.NewServeMux() | ||||||
| 	for _, u := range opts.proxyURLs { | 	for _, u := range opts.proxyURLs { | ||||||
| 		path := u.Path | 		path := u.Path | ||||||
|  | @ -119,7 +119,7 @@ func NewOauthProxy(opts *Options, validator func(string) bool) *OauthProxy { | ||||||
| 	redirectURL := opts.redirectURL | 	redirectURL := opts.redirectURL | ||||||
| 	redirectURL.Path = fmt.Sprintf("%s/callback", opts.ProxyPrefix) | 	redirectURL.Path = fmt.Sprintf("%s/callback", opts.ProxyPrefix) | ||||||
| 
 | 
 | ||||||
| 	log.Printf("OauthProxy configured for %s Client ID: %s", opts.provider.Data().ProviderName, opts.ClientID) | 	log.Printf("OAuthProxy configured for %s Client ID: %s", opts.provider.Data().ProviderName, opts.ClientID) | ||||||
| 	domain := opts.CookieDomain | 	domain := opts.CookieDomain | ||||||
| 	if domain == "" { | 	if domain == "" { | ||||||
| 		domain = "<default>" | 		domain = "<default>" | ||||||
|  | @ -141,7 +141,7 @@ func NewOauthProxy(opts *Options, validator func(string) bool) *OauthProxy { | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	return &OauthProxy{ | 	return &OAuthProxy{ | ||||||
| 		CookieName:     opts.CookieName, | 		CookieName:     opts.CookieName, | ||||||
| 		CookieSeed:     opts.CookieSecret, | 		CookieSeed:     opts.CookieSecret, | ||||||
| 		CookieDomain:   opts.CookieDomain, | 		CookieDomain:   opts.CookieDomain, | ||||||
|  | @ -154,8 +154,8 @@ func NewOauthProxy(opts *Options, validator func(string) bool) *OauthProxy { | ||||||
| 		RobotsPath:        "/robots.txt", | 		RobotsPath:        "/robots.txt", | ||||||
| 		PingPath:          "/ping", | 		PingPath:          "/ping", | ||||||
| 		SignInPath:        fmt.Sprintf("%s/sign_in", opts.ProxyPrefix), | 		SignInPath:        fmt.Sprintf("%s/sign_in", opts.ProxyPrefix), | ||||||
| 		OauthStartPath:    fmt.Sprintf("%s/start", opts.ProxyPrefix), | 		OAuthStartPath:    fmt.Sprintf("%s/start", opts.ProxyPrefix), | ||||||
| 		OauthCallbackPath: fmt.Sprintf("%s/callback", opts.ProxyPrefix), | 		OAuthCallbackPath: fmt.Sprintf("%s/callback", opts.ProxyPrefix), | ||||||
| 
 | 
 | ||||||
| 		ProxyPrefix:       opts.ProxyPrefix, | 		ProxyPrefix:       opts.ProxyPrefix, | ||||||
| 		provider:          opts.provider, | 		provider:          opts.provider, | ||||||
|  | @ -171,7 +171,7 @@ func NewOauthProxy(opts *Options, validator func(string) bool) *OauthProxy { | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) GetRedirectURI(host string) string { | func (p *OAuthProxy) GetRedirectURI(host string) string { | ||||||
| 	// default to the request Host if not set
 | 	// default to the request Host if not set
 | ||||||
| 	if p.redirectURL.Host != "" { | 	if p.redirectURL.Host != "" { | ||||||
| 		return p.redirectURL.String() | 		return p.redirectURL.String() | ||||||
|  | @ -189,11 +189,11 @@ func (p *OauthProxy) GetRedirectURI(host string) string { | ||||||
| 	return u.String() | 	return u.String() | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) displayCustomLoginForm() bool { | func (p *OAuthProxy) displayCustomLoginForm() bool { | ||||||
| 	return p.HtpasswdFile != nil && p.DisplayHtpasswdForm | 	return p.HtpasswdFile != nil && p.DisplayHtpasswdForm | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) redeemCode(host, code string) (s *providers.SessionState, err error) { | func (p *OAuthProxy) redeemCode(host, code string) (s *providers.SessionState, err error) { | ||||||
| 	if code == "" { | 	if code == "" { | ||||||
| 		return nil, errors.New("missing code") | 		return nil, errors.New("missing code") | ||||||
| 	} | 	} | ||||||
|  | @ -209,7 +209,7 @@ func (p *OauthProxy) redeemCode(host, code string) (s *providers.SessionState, e | ||||||
| 	return | 	return | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) MakeCookie(req *http.Request, value string, expiration time.Duration, now time.Time) *http.Cookie { | func (p *OAuthProxy) MakeCookie(req *http.Request, value string, expiration time.Duration, now time.Time) *http.Cookie { | ||||||
| 	domain := req.Host | 	domain := req.Host | ||||||
| 	if h, _, err := net.SplitHostPort(domain); err == nil { | 	if h, _, err := net.SplitHostPort(domain); err == nil { | ||||||
| 		domain = h | 		domain = h | ||||||
|  | @ -235,15 +235,15 @@ func (p *OauthProxy) MakeCookie(req *http.Request, value string, expiration time | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) ClearCookie(rw http.ResponseWriter, req *http.Request) { | func (p *OAuthProxy) ClearCookie(rw http.ResponseWriter, req *http.Request) { | ||||||
| 	http.SetCookie(rw, p.MakeCookie(req, "", time.Hour*-1, time.Now())) | 	http.SetCookie(rw, p.MakeCookie(req, "", time.Hour*-1, time.Now())) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) SetCookie(rw http.ResponseWriter, req *http.Request, val string) { | func (p *OAuthProxy) SetCookie(rw http.ResponseWriter, req *http.Request, val string) { | ||||||
| 	http.SetCookie(rw, p.MakeCookie(req, val, p.CookieExpire, time.Now())) | 	http.SetCookie(rw, p.MakeCookie(req, val, p.CookieExpire, time.Now())) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) LoadCookiedSession(req *http.Request) (*providers.SessionState, time.Duration, error) { | func (p *OAuthProxy) LoadCookiedSession(req *http.Request) (*providers.SessionState, time.Duration, error) { | ||||||
| 	var age time.Duration | 	var age time.Duration | ||||||
| 	c, err := req.Cookie(p.CookieName) | 	c, err := req.Cookie(p.CookieName) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
|  | @ -264,7 +264,7 @@ func (p *OauthProxy) LoadCookiedSession(req *http.Request) (*providers.SessionSt | ||||||
| 	return session, age, nil | 	return session, age, nil | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) SaveSession(rw http.ResponseWriter, req *http.Request, s *providers.SessionState) error { | func (p *OAuthProxy) SaveSession(rw http.ResponseWriter, req *http.Request, s *providers.SessionState) error { | ||||||
| 	value, err := p.provider.CookieForSession(s, p.CookieCipher) | 	value, err := p.provider.CookieForSession(s, p.CookieCipher) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return err | 		return err | ||||||
|  | @ -273,17 +273,17 @@ func (p *OauthProxy) SaveSession(rw http.ResponseWriter, req *http.Request, s *p | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) RobotsTxt(rw http.ResponseWriter) { | func (p *OAuthProxy) RobotsTxt(rw http.ResponseWriter) { | ||||||
| 	rw.WriteHeader(http.StatusOK) | 	rw.WriteHeader(http.StatusOK) | ||||||
| 	fmt.Fprintf(rw, "User-agent: *\nDisallow: /") | 	fmt.Fprintf(rw, "User-agent: *\nDisallow: /") | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) PingPage(rw http.ResponseWriter) { | func (p *OAuthProxy) PingPage(rw http.ResponseWriter) { | ||||||
| 	rw.WriteHeader(http.StatusOK) | 	rw.WriteHeader(http.StatusOK) | ||||||
| 	fmt.Fprintf(rw, "OK") | 	fmt.Fprintf(rw, "OK") | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) ErrorPage(rw http.ResponseWriter, code int, title string, message string) { | func (p *OAuthProxy) ErrorPage(rw http.ResponseWriter, code int, title string, message string) { | ||||||
| 	log.Printf("ErrorPage %d %s %s", code, title, message) | 	log.Printf("ErrorPage %d %s %s", code, title, message) | ||||||
| 	rw.WriteHeader(code) | 	rw.WriteHeader(code) | ||||||
| 	t := struct { | 	t := struct { | ||||||
|  | @ -298,7 +298,7 @@ func (p *OauthProxy) ErrorPage(rw http.ResponseWriter, code int, title string, m | ||||||
| 	p.templates.ExecuteTemplate(rw, "error.html", t) | 	p.templates.ExecuteTemplate(rw, "error.html", t) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) SignInPage(rw http.ResponseWriter, req *http.Request, code int) { | func (p *OAuthProxy) SignInPage(rw http.ResponseWriter, req *http.Request, code int) { | ||||||
| 	p.ClearCookie(rw, req) | 	p.ClearCookie(rw, req) | ||||||
| 	rw.WriteHeader(code) | 	rw.WriteHeader(code) | ||||||
| 
 | 
 | ||||||
|  | @ -325,7 +325,7 @@ func (p *OauthProxy) SignInPage(rw http.ResponseWriter, req *http.Request, code | ||||||
| 	p.templates.ExecuteTemplate(rw, "sign_in.html", t) | 	p.templates.ExecuteTemplate(rw, "sign_in.html", t) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) ManualSignIn(rw http.ResponseWriter, req *http.Request) (string, bool) { | func (p *OAuthProxy) ManualSignIn(rw http.ResponseWriter, req *http.Request) (string, bool) { | ||||||
| 	if req.Method != "POST" || p.HtpasswdFile == nil { | 	if req.Method != "POST" || p.HtpasswdFile == nil { | ||||||
| 		return "", false | 		return "", false | ||||||
| 	} | 	} | ||||||
|  | @ -342,7 +342,7 @@ func (p *OauthProxy) ManualSignIn(rw http.ResponseWriter, req *http.Request) (st | ||||||
| 	return "", false | 	return "", false | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) GetRedirect(req *http.Request) (string, error) { | func (p *OAuthProxy) GetRedirect(req *http.Request) (string, error) { | ||||||
| 	err := req.ParseForm() | 	err := req.ParseForm() | ||||||
| 
 | 
 | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
|  | @ -358,7 +358,7 @@ func (p *OauthProxy) GetRedirect(req *http.Request) (string, error) { | ||||||
| 	return redirect, err | 	return redirect, err | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) IsWhitelistedPath(path string) (ok bool) { | func (p *OAuthProxy) IsWhitelistedPath(path string) (ok bool) { | ||||||
| 	for _, u := range p.compiledRegex { | 	for _, u := range p.compiledRegex { | ||||||
| 		ok = u.MatchString(path) | 		ok = u.MatchString(path) | ||||||
| 		if ok { | 		if ok { | ||||||
|  | @ -376,7 +376,7 @@ func getRemoteAddr(req *http.Request) (s string) { | ||||||
| 	return | 	return | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { | func (p *OAuthProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { | ||||||
| 	switch path := req.URL.Path; { | 	switch path := req.URL.Path; { | ||||||
| 	case path == p.RobotsPath: | 	case path == p.RobotsPath: | ||||||
| 		p.RobotsTxt(rw) | 		p.RobotsTxt(rw) | ||||||
|  | @ -386,16 +386,16 @@ func (p *OauthProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { | ||||||
| 		p.serveMux.ServeHTTP(rw, req) | 		p.serveMux.ServeHTTP(rw, req) | ||||||
| 	case path == p.SignInPath: | 	case path == p.SignInPath: | ||||||
| 		p.SignIn(rw, req) | 		p.SignIn(rw, req) | ||||||
| 	case path == p.OauthStartPath: | 	case path == p.OAuthStartPath: | ||||||
| 		p.OauthStart(rw, req) | 		p.OAuthStart(rw, req) | ||||||
| 	case path == p.OauthCallbackPath: | 	case path == p.OAuthCallbackPath: | ||||||
| 		p.OauthCallback(rw, req) | 		p.OAuthCallback(rw, req) | ||||||
| 	default: | 	default: | ||||||
| 		p.Proxy(rw, req) | 		p.Proxy(rw, req) | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) SignIn(rw http.ResponseWriter, req *http.Request) { | func (p *OAuthProxy) SignIn(rw http.ResponseWriter, req *http.Request) { | ||||||
| 	redirect, err := p.GetRedirect(req) | 	redirect, err := p.GetRedirect(req) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		p.ErrorPage(rw, 500, "Internal Error", err.Error()) | 		p.ErrorPage(rw, 500, "Internal Error", err.Error()) | ||||||
|  | @ -412,7 +412,7 @@ func (p *OauthProxy) SignIn(rw http.ResponseWriter, req *http.Request) { | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) OauthStart(rw http.ResponseWriter, req *http.Request) { | func (p *OAuthProxy) OAuthStart(rw http.ResponseWriter, req *http.Request) { | ||||||
| 	redirect, err := p.GetRedirect(req) | 	redirect, err := p.GetRedirect(req) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		p.ErrorPage(rw, 500, "Internal Error", err.Error()) | 		p.ErrorPage(rw, 500, "Internal Error", err.Error()) | ||||||
|  | @ -422,7 +422,7 @@ func (p *OauthProxy) OauthStart(rw http.ResponseWriter, req *http.Request) { | ||||||
| 	http.Redirect(rw, req, p.provider.GetLoginURL(redirectURI, redirect), 302) | 	http.Redirect(rw, req, p.provider.GetLoginURL(redirectURI, redirect), 302) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) OauthCallback(rw http.ResponseWriter, req *http.Request) { | func (p *OAuthProxy) OAuthCallback(rw http.ResponseWriter, req *http.Request) { | ||||||
| 	remoteAddr := getRemoteAddr(req) | 	remoteAddr := getRemoteAddr(req) | ||||||
| 
 | 
 | ||||||
| 	// finish the oauth cycle
 | 	// finish the oauth cycle
 | ||||||
|  | @ -465,7 +465,7 @@ func (p *OauthProxy) OauthCallback(rw http.ResponseWriter, req *http.Request) { | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) Proxy(rw http.ResponseWriter, req *http.Request) { | func (p *OAuthProxy) Proxy(rw http.ResponseWriter, req *http.Request) { | ||||||
| 	var saveSession, clearSession, revalidated bool | 	var saveSession, clearSession, revalidated bool | ||||||
| 	remoteAddr := getRemoteAddr(req) | 	remoteAddr := getRemoteAddr(req) | ||||||
| 
 | 
 | ||||||
|  | @ -555,7 +555,7 @@ func (p *OauthProxy) Proxy(rw http.ResponseWriter, req *http.Request) { | ||||||
| 	p.serveMux.ServeHTTP(rw, req) | 	p.serveMux.ServeHTTP(rw, req) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (p *OauthProxy) CheckBasicAuth(req *http.Request) (*providers.SessionState, error) { | func (p *OAuthProxy) CheckBasicAuth(req *http.Request) (*providers.SessionState, error) { | ||||||
| 	if p.HtpasswdFile == nil { | 	if p.HtpasswdFile == nil { | ||||||
| 		return nil, nil | 		return nil, nil | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -80,7 +80,7 @@ func TestRobotsTxt(t *testing.T) { | ||||||
| 	opts.CookieSecret = "xyzzyplugh" | 	opts.CookieSecret = "xyzzyplugh" | ||||||
| 	opts.Validate() | 	opts.Validate() | ||||||
| 
 | 
 | ||||||
| 	proxy := NewOauthProxy(opts, func(string) bool { return true }) | 	proxy := NewOAuthProxy(opts, func(string) bool { return true }) | ||||||
| 	rw := httptest.NewRecorder() | 	rw := httptest.NewRecorder() | ||||||
| 	req, _ := http.NewRequest("GET", "/robots.txt", nil) | 	req, _ := http.NewRequest("GET", "/robots.txt", nil) | ||||||
| 	proxy.ServeHTTP(rw, req) | 	proxy.ServeHTTP(rw, req) | ||||||
|  | @ -144,7 +144,7 @@ func TestBasicAuthPassword(t *testing.T) { | ||||||
| 		EmailAddress: email_address, | 		EmailAddress: email_address, | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	proxy := NewOauthProxy(opts, func(email string) bool { | 	proxy := NewOAuthProxy(opts, func(email string) bool { | ||||||
| 		return email == email_address | 		return email == email_address | ||||||
| 	}) | 	}) | ||||||
| 
 | 
 | ||||||
|  | @ -199,7 +199,7 @@ func (tp *TestProvider) ValidateSessionState(session *providers.SessionState) bo | ||||||
| 
 | 
 | ||||||
| type PassAccessTokenTest struct { | type PassAccessTokenTest struct { | ||||||
| 	provider_server *httptest.Server | 	provider_server *httptest.Server | ||||||
| 	proxy           *OauthProxy | 	proxy           *OAuthProxy | ||||||
| 	opts            *Options | 	opts            *Options | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -265,7 +265,7 @@ func NewPassAccessTokenTest(opts PassAccessTokenTestOptions) *PassAccessTokenTes | ||||||
| 		EmailAddress: email_address, | 		EmailAddress: email_address, | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	t.proxy = NewOauthProxy(t.opts, func(email string) bool { | 	t.proxy = NewOAuthProxy(t.opts, func(email string) bool { | ||||||
| 		return email == email_address | 		return email == email_address | ||||||
| 	}) | 	}) | ||||||
| 	return t | 	return t | ||||||
|  | @ -360,7 +360,7 @@ func TestDoNotForwardAccessTokenUpstream(t *testing.T) { | ||||||
| 
 | 
 | ||||||
| type SignInPageTest struct { | type SignInPageTest struct { | ||||||
| 	opts           *Options | 	opts           *Options | ||||||
| 	proxy          *OauthProxy | 	proxy          *OAuthProxy | ||||||
| 	sign_in_regexp *regexp.Regexp | 	sign_in_regexp *regexp.Regexp | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -375,7 +375,7 @@ func NewSignInPageTest() *SignInPageTest { | ||||||
| 	sip_test.opts.ClientSecret = "xyzzyplugh" | 	sip_test.opts.ClientSecret = "xyzzyplugh" | ||||||
| 	sip_test.opts.Validate() | 	sip_test.opts.Validate() | ||||||
| 
 | 
 | ||||||
| 	sip_test.proxy = NewOauthProxy(sip_test.opts, func(email string) bool { | 	sip_test.proxy = NewOAuthProxy(sip_test.opts, func(email string) bool { | ||||||
| 		return true | 		return true | ||||||
| 	}) | 	}) | ||||||
| 	sip_test.sign_in_regexp = regexp.MustCompile(signInRedirectPattern) | 	sip_test.sign_in_regexp = regexp.MustCompile(signInRedirectPattern) | ||||||
|  | @ -425,7 +425,7 @@ func TestSignInPageDirectAccessRedirectsToRoot(t *testing.T) { | ||||||
| 
 | 
 | ||||||
| type ProcessCookieTest struct { | type ProcessCookieTest struct { | ||||||
| 	opts          *Options | 	opts          *Options | ||||||
| 	proxy         *OauthProxy | 	proxy         *OAuthProxy | ||||||
| 	rw            *httptest.ResponseRecorder | 	rw            *httptest.ResponseRecorder | ||||||
| 	req           *http.Request | 	req           *http.Request | ||||||
| 	provider      TestProvider | 	provider      TestProvider | ||||||
|  | @ -449,7 +449,7 @@ func NewProcessCookieTest(opts ProcessCookieTestOpts) *ProcessCookieTest { | ||||||
| 	pc_test.opts.CookieRefresh = time.Hour | 	pc_test.opts.CookieRefresh = time.Hour | ||||||
| 	pc_test.opts.Validate() | 	pc_test.opts.Validate() | ||||||
| 
 | 
 | ||||||
| 	pc_test.proxy = NewOauthProxy(pc_test.opts, func(email string) bool { | 	pc_test.proxy = NewOAuthProxy(pc_test.opts, func(email string) bool { | ||||||
| 		return pc_test.validate_user | 		return pc_test.validate_user | ||||||
| 	}) | 	}) | ||||||
| 	pc_test.proxy.provider = &TestProvider{ | 	pc_test.proxy.provider = &TestProvider{ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue