Skip to content

Commit 8e09288

Browse files
authored
fix(bigquery): bq connection auth scopes (#6752)
Resolves #6744
1 parent 7163486 commit 8e09288

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

β€Žbigquery/integration_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ func initIntegrationTest() func() {
157157
}
158158
bqOpts := []option.ClientOption{option.WithTokenSource(ts)}
159159
sOpts := []option.ClientOption{option.WithTokenSource(testutil.TokenSource(ctx, storage.ScopeFullControl))}
160-
ptmOpts := []option.ClientOption{option.WithTokenSource(testutil.TokenSource(ctx, "https://www.googleapis.com/auth/cloud-platform"))}
160+
ptmOpts := []option.ClientOption{option.WithTokenSource(testutil.TokenSource(ctx, datacatalog.DefaultAuthScopes()...))}
161+
connOpts := []option.ClientOption{option.WithTokenSource(testutil.TokenSource(ctx, connection.DefaultAuthScopes()...))}
161162
cleanup := func() {}
162163
now := time.Now().UTC()
163164
if *record {
@@ -196,6 +197,7 @@ func initIntegrationTest() func() {
196197
bqOpts = append(bqOpts, grpcHeadersChecker.CallOptions()...)
197198
sOpts = append(sOpts, grpcHeadersChecker.CallOptions()...)
198199
ptmOpts = append(ptmOpts, grpcHeadersChecker.CallOptions()...)
200+
connOpts = append(sOpts, grpcHeadersChecker.CallOptions()...)
199201
}
200202
var err error
201203
client, err = NewClient(ctx, projID, bqOpts...)
@@ -210,7 +212,7 @@ func initIntegrationTest() func() {
210212
if err != nil {
211213
log.Fatalf("datacatalog.NewPolicyTagManagerClient: %v", err)
212214
}
213-
connectionsClient, err = connection.NewClient(ctx, sOpts...)
215+
connectionsClient, err = connection.NewClient(ctx, connOpts...)
214216
if err != nil {
215217
log.Fatalf("connection.NewService: %v", err)
216218
}

0 commit comments

Comments
 (0)