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

Unified Diff: logdog/server/cmd/logdog_archivist/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 | « no previous file | logdog/server/cmd/logdog_collector/main.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/server/cmd/logdog_archivist/main.go
diff --git a/logdog/server/cmd/logdog_archivist/main.go b/logdog/server/cmd/logdog_archivist/main.go
index 5754c3b229749608cadf08d3c36bd1cd48371af8..741becbcf5814bd8c0043628e729e2816e064a35 100644
--- a/logdog/server/cmd/logdog_archivist/main.go
+++ b/logdog/server/cmd/logdog_archivist/main.go
@@ -7,7 +7,6 @@ package main
import (
"time"
- "github.com/luci/luci-go/common/auth"
"github.com/luci/luci-go/common/clock"
"github.com/luci/luci-go/common/errors"
"github.com/luci/luci-go/common/gcloud/gs"
@@ -26,7 +25,6 @@ import (
"cloud.google.com/go/pubsub"
"golang.org/x/net/context"
"google.golang.org/api/iterator"
- "google.golang.org/api/option"
)
var (
@@ -85,16 +83,8 @@ func (a *application) runArchivist(c context.Context) error {
}
psProject, psSubscriptionName := taskSub.Split()
- 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
- }
-
- // Pub/Sub: TokenSource => Client
- psClient, err := pubsub.NewClient(c, psProject, option.WithTokenSource(tokenSource))
+ // New PubSub instance with the authenticated client.
+ psClient, err := a.Service.PubSubSubscriberClient(c, psProject)
if err != nil {
log.WithError(err).Errorf(c, "Failed to create Pub/Sub client.")
return err
« no previous file with comments | « no previous file | logdog/server/cmd/logdog_collector/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698