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

Side by Side Diff: impl/prod/info.go

Issue 2220193002: Implement info.ServiceAccount() on devserver via info.AccessToken(...). (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: 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 | « impl/prod/devserver.go ('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 prod 5 package prod
6 6
7 import ( 7 import (
8 "time" 8 "time"
9 9
10 "github.com/luci/gae/service/info" 10 "github.com/luci/gae/service/info"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 } 92 }
93 return ret, nil 93 return ret, nil
94 } 94 }
95 func (g giImpl) RequestID() string { 95 func (g giImpl) RequestID() string {
96 return appengine.RequestID(g.aeCtx) 96 return appengine.RequestID(g.aeCtx)
97 } 97 }
98 func (g giImpl) ServerSoftware() string { 98 func (g giImpl) ServerSoftware() string {
99 return appengine.ServerSoftware() 99 return appengine.ServerSoftware()
100 } 100 }
101 func (g giImpl) ServiceAccount() (string, error) { 101 func (g giImpl) ServiceAccount() (string, error) {
102 if appengine.IsDevAppServer() {
103 // On devserver ServiceAccount returns empty string, but AccessT oken works.
104 // We use it to grab developer's email.
105 return developerAccount(g.aeCtx)
106 }
102 return appengine.ServiceAccount(g.aeCtx) 107 return appengine.ServiceAccount(g.aeCtx)
103 } 108 }
104 func (g giImpl) SignBytes(bytes []byte) (keyName string, signature []byte, err e rror) { 109 func (g giImpl) SignBytes(bytes []byte) (keyName string, signature []byte, err e rror) {
105 return appengine.SignBytes(g.aeCtx, bytes) 110 return appengine.SignBytes(g.aeCtx, bytes)
106 } 111 }
107 func (g giImpl) VersionID() string { 112 func (g giImpl) VersionID() string {
108 return appengine.VersionID(g.aeCtx) 113 return appengine.VersionID(g.aeCtx)
109 } 114 }
110 115
111 func (g giImpl) Testable() info.Testable { 116 func (g giImpl) Testable() info.Testable {
(...skipping 20 matching lines...) Expand all
132 func getProbeCache(c context.Context) *infoProbeCache { 137 func getProbeCache(c context.Context) *infoProbeCache {
133 if pc, ok := c.Value(probeCacheKey).(*infoProbeCache); ok { 138 if pc, ok := c.Value(probeCacheKey).(*infoProbeCache); ok {
134 return pc 139 return pc
135 } 140 }
136 return nil 141 return nil
137 } 142 }
138 143
139 func withProbeCache(c context.Context, pc *infoProbeCache) context.Context { 144 func withProbeCache(c context.Context, pc *infoProbeCache) context.Context {
140 return context.WithValue(c, probeCacheKey, pc) 145 return context.WithValue(c, probeCacheKey, pc)
141 } 146 }
OLDNEW
« no previous file with comments | « impl/prod/devserver.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698