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

Unified Diff: appengine/cmd/logdog_coordinator/backend/main.go

Issue 1910633006: LogDog: Support per-namespace expired archival. (Closed) Base URL: https://github.com/luci/luci-go@logdog-coordinator-svcdec
Patch Set: Update another test. Created 4 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
« no previous file with comments | « appengine/cmd/cron/engine/engine_test.go ('k') | appengine/cmd/logdog_coordinator/vmuser/cron.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/cmd/logdog_coordinator/backend/main.go
diff --git a/appengine/cmd/logdog_coordinator/backend/main.go b/appengine/cmd/logdog_coordinator/backend/main.go
index 1275d39d73c754b869fd732283e38413b1349eff..1c2f7d255d8b1a7d265ecb8810b95548d81456a3 100644
--- a/appengine/cmd/logdog_coordinator/backend/main.go
+++ b/appengine/cmd/logdog_coordinator/backend/main.go
@@ -7,44 +7,28 @@ package module
import (
"net/http"
+ "golang.org/x/net/context"
+
"github.com/julienschmidt/httprouter"
- gaeauthServer "github.com/luci/luci-go/appengine/gaeauth/server"
- "github.com/luci/luci-go/appengine/gaemiddleware"
"github.com/luci/luci-go/appengine/logdog/coordinator"
- "github.com/luci/luci-go/appengine/logdog/coordinator/backend"
"github.com/luci/luci-go/appengine/logdog/coordinator/config"
"github.com/luci/luci-go/appengine/tumble"
- "github.com/luci/luci-go/server/auth"
- "github.com/luci/luci-go/server/middleware"
// Include mutations package so its Mutations will register with tumble via
// init().
_ "github.com/luci/luci-go/appengine/logdog/coordinator/mutations"
)
-func authenticator(scopes ...string) auth.Authenticator {
- return auth.Authenticator{
- &gaeauthServer.OAuth2Method{Scopes: scopes},
- gaeauthServer.CookieAuth,
- &gaeauthServer.InboundAppIDAuthMethod{},
- }
-}
-
-// base is the root of the middleware chain.
-func base(h middleware.Handler) httprouter.Handle {
- a := authenticator(gaeauthServer.EmailScope)
- h = auth.Use(h, a)
- h = config.WithConfig(h)
- h = coordinator.WithProdServices(h)
- return gaemiddleware.BaseProd(h)
-}
-
func init() {
- b := backend.Backend{}
- tmb := tumble.Service{}
+ tmb := tumble.Service{
+ Middleware: func(c context.Context) context.Context {
+ c = config.UseConfig(c)
+ c = coordinator.UseProdServices(c)
+ return c
+ },
+ }
router := httprouter.New()
- b.InstallHandlers(router, base)
tmb.InstallHandlers(router)
http.Handle("/", router)
« no previous file with comments | « appengine/cmd/cron/engine/engine_test.go ('k') | appengine/cmd/logdog_coordinator/vmuser/cron.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698