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

Side by Side Diff: milo/appengine/settings/themes.go

Issue 2271483002: Milo: Add a login url (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: Retrain Created 4 years, 4 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
« no previous file with comments | « milo/appengine/frontend/templates/buildbot/includes/buildbot.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 settings 5 package settings
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "io" 9 "io"
10 "net/http" 10 "net/http"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 panic(fmt.Errorf("Error: Could not load template %s from theme %s", name , theme)) 148 panic(fmt.Errorf("Error: Could not load template %s from theme %s", name , theme))
149 } 149 }
150 150
151 // Base returns the basic luci appengine middlewares. 151 // Base returns the basic luci appengine middlewares.
152 func Base() router.MiddlewareChain { 152 func Base() router.MiddlewareChain {
153 methods := auth.Authenticator{ 153 methods := auth.Authenticator{
154 &server.OAuth2Method{Scopes: []string{server.EmailScope}}, 154 &server.OAuth2Method{Scopes: []string{server.EmailScope}},
155 server.CookieAuth, 155 server.CookieAuth,
156 &server.InboundAppIDAuthMethod{}, 156 &server.InboundAppIDAuthMethod{},
157 } 157 }
158 » m := gaemiddleware.BaseProd().Extend(auth.Use(methods)) 158 » m := gaemiddleware.BaseProd().Extend(auth.Use(methods), auth.Authenticat e)
159 for _, nb := range GetTemplateBundles() { 159 for _, nb := range GetTemplateBundles() {
160 m = m.Extend(withNamedBundle(nb)) 160 m = m.Extend(withNamedBundle(nb))
161 } 161 }
162 return m 162 return m
163 } 163 }
164 164
165 // Wrap adapts a ThemedHandler into a router.Handler. Of note, the 165 // Wrap adapts a ThemedHandler into a router.Handler. Of note, the
166 // Render functions' interface into rendering is purely through a single 166 // Render functions' interface into rendering is purely through a single
167 // templates.Args value which gets rendered here, while the http.ResponseWriter 167 // templates.Args value which gets rendered here, while the http.ResponseWriter
168 // is stripped out. 168 // is stripped out.
(...skipping 15 matching lines...) Expand all
184 http.Error(c.Writer, err.Error(), http.StatusInt ernalServerError) 184 http.Error(c.Writer, err.Error(), http.StatusInt ernalServerError)
185 } 185 }
186 return 186 return
187 } 187 }
188 188
189 // Render the stuff. 189 // Render the stuff.
190 name := fmt.Sprintf("pages/%s", template) 190 name := fmt.Sprintf("pages/%s", template)
191 themedMustRender(c.Context, c.Writer, theme.Name, name, *args) 191 themedMustRender(c.Context, c.Writer, theme.Name, name, *args)
192 } 192 }
193 } 193 }
OLDNEW
« no previous file with comments | « milo/appengine/frontend/templates/buildbot/includes/buildbot.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698