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

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: gaemiddleware: add middleware func for WithProd 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
« no previous file with comments | « appengine/cmd/tokenserver/frontend/main.go ('k') | appengine/gaeauth/server/internal/authdb/handlers.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/gaeauth/server/default.go
diff --git a/appengine/gaeauth/server/default.go b/appengine/gaeauth/server/default.go
index 937f3f23906dc6414d80ca09ab93f4b36f4900f8..ef97197adb2b27b4b16852640ae067314ac0f22f 100644
--- a/appengine/gaeauth/server/default.go
+++ b/appengine/gaeauth/server/default.go
@@ -1,49 +1,45 @@
// Copyright 2015 The LUCI Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
package server
import (
"runtime"
"strings"
- "github.com/julienschmidt/httprouter"
"golang.org/x/net/context"
"google.golang.org/appengine"
gae_info "github.com/luci/gae/service/info"
"github.com/luci/luci-go/server/auth"
"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"
)
// CookieAuth is default cookie-based auth method to use on GAE.
//
// On dev server it is based on dev server cookies, in prod it is based on
// OpenID. Works only if appropriate handlers have been installed into
// the router. See InstallHandlers.
var CookieAuth auth.Method
-// InstallWebHandlers installs HTTP handlers for various default routes related
+// InstallHandlers installs HTTP handlers for various default routes related
// to authentication system.
//
// Must be installed in server HTTP router for authentication to work.
-//
-// 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 InstallHandlers(r *router.Router, base router.MiddlewareChain) {
m := CookieAuth.(cookieAuthMethod)
if oid, ok := m.Method.(*openid.AuthMethod); ok {
oid.InstallHandlers(r, base)
}
auth.InstallHandlers(r, base)
authdb.InstallHandlers(r, base)
info.InstallHandlers(r, base, getServiceInfo)
signing.InstallHandlers(r, base)
}
« no previous file with comments | « appengine/cmd/tokenserver/frontend/main.go ('k') | appengine/gaeauth/server/internal/authdb/handlers.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698