File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1515package com .google .cloud .pubsublite ;
1616
1717import com .google .auth .oauth2 .GoogleCredentials ;
18+ import com .google .common .collect .ImmutableList ;
1819import io .grpc .Channel ;
1920import io .grpc .ManagedChannelBuilder ;
2021import io .grpc .auth .MoreCallCredentials ;
2324import java .util .function .Function ;
2425
2526public class Stubs {
27+ private static final ImmutableList <String > DEFAULT_SERVICE_SCOPES =
28+ ImmutableList .of ("https://www.googleapis.com/auth/cloud-platform" );
29+
2630 public static <StubT extends AbstractStub <StubT >> StubT defaultStub (
2731 String target , Function <Channel , StubT > stubFactory ) throws IOException {
2832 return stubFactory
2933 .apply (ManagedChannelBuilder .forTarget (target ).build ())
30- .withCallCredentials (MoreCallCredentials .from (GoogleCredentials .getApplicationDefault ()));
34+ .withCallCredentials (MoreCallCredentials .from (
35+ GoogleCredentials
36+ .getApplicationDefault ()
37+ .createScoped (DEFAULT_SERVICE_SCORES )));
3138 }
3239
3340 private Stubs () {}
You can’t perform that action at this time.
0 commit comments