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

Side by Side Diff: go/login/login.go

Issue 777413002: Add new tests to presubmit, fix errors (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: rebase Created 6 years 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 | « go/gitinfo/gitinfo_test.go ('k') | go/skiaversion/skiaversion.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // login handles logging in users. 1 // login handles logging in users.
2 package login 2 package login
3 3
4 // Theory of operation. 4 // Theory of operation.
5 // 5 //
6 // We use OAuth 2.0 handle authentication. We are essentially doing OpenID 6 // We use OAuth 2.0 handle authentication. We are essentially doing OpenID
7 // Connect, but vastly simplified since we are hardcoded to Google's endpoints. 7 // Connect, but vastly simplified since we are hardcoded to Google's endpoints.
8 // 8 //
9 // We do a simple OAuth 2.0 flow where the user is asked to grant permission to 9 // We do a simple OAuth 2.0 flow where the user is asked to grant permission to
10 // the 'email' scope. See https://developers.google.com/+/api/oauth#email for 10 // the 'email' scope. See https://developers.google.com/+/api/oauth#email for
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 // 255 //
256 func StatusHandler(w http.ResponseWriter, r *http.Request) { 256 func StatusHandler(w http.ResponseWriter, r *http.Request) {
257 glog.Infof("StatusHandler\n") 257 glog.Infof("StatusHandler\n")
258 w.Header().Set("Content-Type", "application/json") 258 w.Header().Set("Content-Type", "application/json")
259 enc := json.NewEncoder(w) 259 enc := json.NewEncoder(w)
260 body := map[string]string{ 260 body := map[string]string{
261 "Email": LoggedInAs(r), 261 "Email": LoggedInAs(r),
262 "LoginURL": LoginURL(w, r), 262 "LoginURL": LoginURL(w, r),
263 } 263 }
264 if err := enc.Encode(body); err != nil { 264 if err := enc.Encode(body); err != nil {
265 » » glog.Errorf("Failed to encode Login status to JSON", err) 265 » » glog.Errorf("Failed to encode Login status to JSON: %s", err)
266 } 266 }
267 } 267 }
OLDNEW
« no previous file with comments | « go/gitinfo/gitinfo_test.go ('k') | go/skiaversion/skiaversion.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698