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

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

Issue 2830443003: auth: Refactor how authentication methods are passed to server/auth library. (Closed)
Patch Set: simplify public API more 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..1a71768fc6196e545de59d5155774379d5377f52 100644
--- a/milo/appengine/common/middleware.go
+++ b/milo/appengine/common/middleware.go
@@ -56,15 +56,11 @@ 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 = m.Extend(withRequestMiddleware)
- m = m.Extend(templates.WithTemplates(GetTemplateBundle()))
- return m
+ return gaemiddleware.BaseProd().Extend(
+ auth.Authenticate(server.CookieAuth),
Vadim Sh. 2017/04/19 02:40:12 I think this should be fine: 1. I removed OAuth2Me
hinoka 2017/04/19 18:37:10 Acknowledged. That sounds right.
+ withRequestMiddleware,
+ templates.WithTemplates(GetTemplateBundle()),
+ )
}
// The context key, so that we can embed the http.Request object into

Powered by Google App Engine
This is Rietveld 408576698