File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner
google-cloud-spanner/src/test/java/com/google/cloud/spanner Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 2727import com .google .api .gax .rpc .UnavailableException ;
2828import com .google .auth .Credentials ;
2929import com .google .auth .oauth2 .GoogleCredentials ;
30+ import com .google .auth .oauth2 .ServiceAccountCredentials ;
3031import com .google .cloud .ByteArray ;
3132import com .google .cloud .Date ;
3233import com .google .cloud .NoCredentials ;
@@ -888,7 +889,7 @@ private synchronized TraceServiceClient getTraceServiceClient() throws IOExcepti
888889 credentials = NoCredentials .getInstance ();
889890 } else {
890891 credentials =
891- GoogleCredentials .fromStream (
892+ ServiceAccountCredentials .fromStream (
892893 new ByteArrayInputStream (
893894 FileUtils .readFileToByteArray (new File (WorkerProxy .serviceKeyFile ))),
894895 HTTP_TRANSPORT_FACTORY );
Original file line number Diff line number Diff line change 1919import com .google .api .client .http .javanet .NetHttpTransport ;
2020import com .google .auth .Credentials ;
2121import com .google .auth .http .HttpTransportFactory ;
22- import com .google .auth .oauth2 .GoogleCredentials ;
22+ import com .google .auth .oauth2 .ServiceAccountCredentials ;
2323import com .google .cloud .opentelemetry .trace .TraceConfiguration ;
2424import com .google .cloud .opentelemetry .trace .TraceExporter ;
2525import com .google .cloud .spanner .ErrorCode ;
@@ -87,7 +87,7 @@ public static OpenTelemetrySdk setupOpenTelemetrySdk() throws Exception {
8787 // Read credentials from the serviceKeyFile.
8888 HttpTransportFactory HTTP_TRANSPORT_FACTORY = NetHttpTransport ::new ;
8989 Credentials credentials =
90- GoogleCredentials .fromStream (
90+ ServiceAccountCredentials .fromStream (
9191 new ByteArrayInputStream (FileUtils .readFileToByteArray (new File (serviceKeyFile ))),
9292 HTTP_TRANSPORT_FACTORY );
9393
Original file line number Diff line number Diff line change 2121import static com .google .common .base .Preconditions .checkState ;
2222
2323import com .google .api .gax .grpc .InstantiatingGrpcChannelProvider ;
24- import com .google .auth .oauth2 .GoogleCredentials ;
24+ import com .google .auth .oauth2 .ServiceAccountCredentials ;
2525import com .google .cloud .spanner .spi .v1 .SpannerInterceptorProvider ;
2626import io .grpc .CallOptions ;
2727import io .grpc .Channel ;
@@ -80,7 +80,8 @@ public GceTestEnvConfig() {
8080 }
8181 if (!credentialsFile .isEmpty ()) {
8282 try {
83- builder .setCredentials (GoogleCredentials .fromStream (new FileInputStream (credentialsFile )));
83+ builder .setCredentials (
84+ ServiceAccountCredentials .fromStream (new FileInputStream (credentialsFile )));
8485 } catch (IOException e ) {
8586 throw new RuntimeException (e );
8687 }
You can’t perform that action at this time.
0 commit comments