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

Unified Diff: logdog/appengine/coordinator/service.go

Issue 2350793002: LogDog: Use gRPC credential directly. (Closed)
Patch Set: Created 4 years, 3 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: logdog/appengine/coordinator/service.go
diff --git a/logdog/appengine/coordinator/service.go b/logdog/appengine/coordinator/service.go
index 960057e6770975e9fd0965dcc12a9a413ae52634..5d9bea108994fd1d55a11f21fc051fde15ffe8fd 100644
--- a/logdog/appengine/coordinator/service.go
+++ b/logdog/appengine/coordinator/service.go
@@ -25,6 +25,7 @@ import (
gcps "cloud.google.com/go/pubsub"
"golang.org/x/net/context"
"google.golang.org/api/option"
+ "google.golang.org/grpc"
"google.golang.org/grpc/metadata"
)
@@ -187,10 +188,10 @@ func (s *prodServicesInst) IntermediateStorage(c context.Context) (storage.Stora
}
// Get an Authenticator bound to the token scopes that we need for BigTable.
- transport, err := auth.GetRPCTransport(c, auth.AsSelf, auth.WithScopes(bigtable.StorageScopes...))
+ creds, err := auth.GetPerRPCCredentials(auth.AsSelf, auth.WithScopes(bigtable.StorageScopes...))
if err != nil {
- log.WithError(err).Errorf(c, "Failed to create BigTable authenticator.")
- return nil, errors.New("failed to create BigTable authenticator")
+ log.WithError(err).Errorf(c, "Failed to create BigTable credentials.")
+ return nil, errors.New("failed to create BigTable credentials")
}
// Explicitly clear gRPC metadata from the Context. It is forwarded to
@@ -203,7 +204,7 @@ func (s *prodServicesInst) IntermediateStorage(c context.Context) (storage.Stora
Instance: bt.Instance,
LogTable: bt.LogTableName,
ClientOptions: []option.ClientOption{
- option.WithHTTPClient(&http.Client{Transport: transport}),
+ option.WithGRPCDialOption(grpc.WithPerRPCCredentials(creds)),
},
})
if err != nil {
« 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