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

Unified Diff: impl/prod/context.go

Issue 1632943003: impl/prod: Expose Remote API scopes. (Closed) Base URL: https://github.com/luci/gae@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/prod/context.go
diff --git a/impl/prod/context.go b/impl/prod/context.go
index 8a613253d2aa4cd85cc42a80895cc36ee07d1da8..92cb8af809de554a8206e186c7c277f577b67e85 100644
--- a/impl/prod/context.go
+++ b/impl/prod/context.go
@@ -19,6 +19,13 @@ import (
"google.golang.org/appengine/remote_api"
)
+// RemoteAPIScopes is the set of OAuth2 scopes needed for Remote API access.
+var RemoteAPIScopes = []string{
dnj 2016/01/26 05:21:35 This is useful when using external authentication
+ "https://www.googleapis.com/auth/appengine.apis",
+ "https://www.googleapis.com/auth/userinfo.email",
+ "https://www.googleapis.com/auth/cloud.platform",
+}
+
type key int
var (
@@ -139,11 +146,7 @@ func UseRemote(inOutCtx *context.Context, host string, client *http.Client) (err
if aeCtx == nil {
aeCtx = context.Background()
}
- client, err = gOAuth.DefaultClient(aeCtx,
- "https://www.googleapis.com/auth/appengine.apis",
- "https://www.googleapis.com/auth/userinfo.email",
- "https://www.googleapis.com/auth/cloud.platform",
- )
+ client, err = gOAuth.DefaultClient(aeCtx, RemoteAPIScopes...)
if err != nil {
return
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698