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

Side by Side Diff: milo/appengine/common/middleware.go

Issue 2810113002: Milo buildbot builder page: Add pagnation with cursors. (Closed)
Patch Set: train 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package common 5 package common
6 6
7 import ( 7 import (
8 "net/http" 8 "net/http"
9 "strings" 9 "strings"
10 10
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 return templates.Args{ 42 return templates.Args{
43 "AppVersion": strings.Split(info.VersionID(c), ".")[0], 43 "AppVersion": strings.Split(info.VersionID(c), ".")[0],
44 "IsAnonymous": auth.CurrentIdentity(c) == identi ty.AnonymousIdentity, 44 "IsAnonymous": auth.CurrentIdentity(c) == identi ty.AnonymousIdentity,
45 "User": auth.CurrentUser(c), 45 "User": auth.CurrentUser(c),
46 "LoginURL": loginURL, 46 "LoginURL": loginURL,
47 "LogoutURL": logoutURL, 47 "LogoutURL": logoutURL,
48 "CurrentTime": clock.Now(c), 48 "CurrentTime": clock.Now(c),
49 "Analytics": analytics.Snippet(c), 49 "Analytics": analytics.Snippet(c),
50 "RequestID": info.RequestID(c), 50 "RequestID": info.RequestID(c),
51 "Request": r,
51 }, nil 52 }, nil
52 }, 53 },
53 FuncMap: funcMap, 54 FuncMap: funcMap,
54 } 55 }
55 } 56 }
56 57
57 // Base returns the basic LUCI appengine middlewares. 58 // Base returns the basic LUCI appengine middlewares.
58 func Base() router.MiddlewareChain { 59 func Base() router.MiddlewareChain {
59 return gaemiddleware.BaseProd().Extend( 60 return gaemiddleware.BaseProd().Extend(
60 auth.Authenticate(server.CookieAuth), 61 auth.Authenticate(server.CookieAuth),
(...skipping 18 matching lines...) Expand all
79 c.Context = WithRequest(c.Context, c.Request) 80 c.Context = WithRequest(c.Context, c.Request)
80 next(c) 81 next(c)
81 } 82 }
82 83
83 func getRequest(c context.Context) *http.Request { 84 func getRequest(c context.Context) *http.Request {
84 if req, ok := c.Value(&requestKey).(*http.Request); ok { 85 if req, ok := c.Value(&requestKey).(*http.Request); ok {
85 return req 86 return req
86 } 87 }
87 panic("No http.request found in context") 88 panic("No http.request found in context")
88 } 89 }
OLDNEW
« no previous file with comments | « milo/appengine/common/funcs.go ('k') | milo/appengine/frontend/expectations/buildbot.builder-Basic_Test_no_builds.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698