Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(750)

Unified Diff: milo/appengine/common/middleware.go

Issue 2830443003: auth: Refactor how authentication methods are passed to server/auth library. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: milo/appengine/common/middleware.go
diff --git a/milo/appengine/common/middleware.go b/milo/appengine/common/middleware.go
index daef78d87690eb9cab334f9cff9f673c2a3beeb2..6b1d48875ac27fe2d527fbddf27d510d50957f2e 100644
--- a/milo/appengine/common/middleware.go
+++ b/milo/appengine/common/middleware.go
@@ -56,12 +56,13 @@ func GetTemplateBundle() *templates.Bundle {
// Base returns the basic LUCI appengine middlewares.
func Base() router.MiddlewareChain {
- methods := auth.Authenticator{
- &server.OAuth2Method{Scopes: []string{server.EmailScope}},
- server.CookieAuth,
- &server.InboundAppIDAuthMethod{},
- }
- m := gaemiddleware.BaseProd().Extend(auth.Use(methods), auth.Authenticate)
+ m := gaemiddleware.BaseProd().Extend(auth.Authenticate(&auth.Authenticator{
+ Methods: []auth.Method{
+ &server.OAuth2Method{Scopes: []string{server.EmailScope}},
+ server.CookieAuth,
+ &server.InboundAppIDAuthMethod{},
+ },
+ }))
m = m.Extend(withRequestMiddleware)
m = m.Extend(templates.WithTemplates(GetTemplateBundle()))
return m

Powered by Google App Engine
This is Rietveld 408576698