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 15
15
package com .google .cloud .pubsublite ;
16
16
17
17
import com .google .auth .oauth2 .GoogleCredentials ;
18
+ import com .google .common .collect .ImmutableList ;
18
19
import io .grpc .Channel ;
19
20
import io .grpc .ManagedChannelBuilder ;
20
21
import io .grpc .auth .MoreCallCredentials ;
23
24
import java .util .function .Function ;
24
25
25
26
public class Stubs {
27
+ private static final ImmutableList <String > DEFAULT_SERVICE_SCOPES =
28
+ ImmutableList .of ("https://www.googleapis.com/auth/cloud-platform" );
29
+
26
30
public static <StubT extends AbstractStub <StubT >> StubT defaultStub (
27
31
String target , Function <Channel , StubT > stubFactory ) throws IOException {
28
32
return stubFactory
29
33
.apply (ManagedChannelBuilder .forTarget (target ).build ())
30
- .withCallCredentials (MoreCallCredentials .from (GoogleCredentials .getApplicationDefault ()));
34
+ .withCallCredentials (MoreCallCredentials .from (
35
+ GoogleCredentials
36
+ .getApplicationDefault ()
37
+ .createScoped (DEFAULT_SERVICE_SCORES )));
31
38
}
32
39
33
40
private Stubs () {}
You can’t perform that action at this time.
0 commit comments