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

Unified Diff: appengine/gaeauth/server/default.go

Issue 2043423004: Make HTTP middleware easier to use (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Update tests Created 4 years, 6 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: appengine/gaeauth/server/default.go
diff --git a/appengine/gaeauth/server/default.go b/appengine/gaeauth/server/default.go
index 937f3f23906dc6414d80ca09ab93f4b36f4900f8..d91520b12e740decfdc39779f5df169de9625006 100644
--- a/appengine/gaeauth/server/default.go
+++ b/appengine/gaeauth/server/default.go
@@ -8,7 +8,6 @@ import (
"runtime"
"strings"
- "github.com/julienschmidt/httprouter"
"golang.org/x/net/context"
"google.golang.org/appengine"
@@ -17,7 +16,7 @@ import (
"github.com/luci/luci-go/server/auth/info"
"github.com/luci/luci-go/server/auth/openid"
"github.com/luci/luci-go/server/auth/signing"
- "github.com/luci/luci-go/server/middleware"
+ "github.com/luci/luci-go/server/router"
"github.com/luci/luci-go/appengine/gaeauth/server/internal/authdb"
)
@@ -36,15 +35,15 @@ var CookieAuth auth.Method
//
// TODO(vadimsh): Rename to InstallHandlers after June 1 2016. It was renamed
// to purposely break code that called it (since its semantics has changed).
-func InstallWebHandlers(r *httprouter.Router, base middleware.Base) {
+func InstallWebHandlers(r *router.Router, handlers []router.Handler) {
m := CookieAuth.(cookieAuthMethod)
if oid, ok := m.Method.(*openid.AuthMethod); ok {
- oid.InstallHandlers(r, base)
+ oid.InstallHandlers(r, handlers)
}
- auth.InstallHandlers(r, base)
- authdb.InstallHandlers(r, base)
- info.InstallHandlers(r, base, getServiceInfo)
- signing.InstallHandlers(r, base)
+ auth.InstallHandlers(r, handlers)
+ authdb.InstallHandlers(r, handlers)
+ info.InstallHandlers(r, handlers, getServiceInfo)
+ signing.InstallHandlers(r, handlers)
}
// Warmup prepares local caches. It's optional.

Powered by Google App Engine
This is Rietveld 408576698