OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |