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

Unified Diff: logdog/server/cmd/logdog_collector/main.go

Issue 2643363002: LogDog: Use server/auth for authentication. (Closed)
Patch Set: LogDog: Use server/auth for authentication. Created 3 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 | « logdog/server/cmd/logdog_archivist/main.go ('k') | logdog/server/service/rt.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/server/cmd/logdog_collector/main.go
diff --git a/logdog/server/cmd/logdog_collector/main.go b/logdog/server/cmd/logdog_collector/main.go
index 67ca13c6a7516ca83da920d743ca266f600f93ef..fde8aaea95d6d754e03ccb2fd8f0ee533b58dd62 100644
--- a/logdog/server/cmd/logdog_collector/main.go
+++ b/logdog/server/cmd/logdog_collector/main.go
@@ -8,7 +8,6 @@ import (
"fmt"
"time"
- "github.com/luci/luci-go/common/auth"
"github.com/luci/luci-go/common/clock"
"github.com/luci/luci-go/common/errors"
gcps "github.com/luci/luci-go/common/gcloud/pubsub"
@@ -25,7 +24,6 @@ import (
"cloud.google.com/go/pubsub"
"google.golang.org/api/iterator"
- "google.golang.org/api/option"
)
var (
@@ -81,14 +79,7 @@ func (a *application) runCollector(c context.Context) error {
}
// New PubSub instance with the authenticated client.
- tokenSource, err := a.TokenSource(c, func(o *auth.Options) {
- o.Scopes = gcps.SubscriberScopes
- })
- if err != nil {
- log.WithError(err).Errorf(c, "Failed to get Pub/Sub token source.")
- return err
- }
- psClient, err := pubsub.NewClient(c, pscfg.Project, option.WithTokenSource(tokenSource))
+ psClient, err := a.Service.PubSubSubscriberClient(c, pscfg.Project)
if err != nil {
log.Fields{
log.ErrorKey: err,
« no previous file with comments | « logdog/server/cmd/logdog_archivist/main.go ('k') | logdog/server/service/rt.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698