Skip to content

Commit dfff25a

Browse files
committed
Merge branch 'main' into PR #4026 to update
2 parents b6fe083 + 7d1610f commit dfff25a

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import com.google.api.gax.rpc.UnavailableException;
2828
import com.google.auth.Credentials;
2929
import com.google.auth.oauth2.GoogleCredentials;
30+
import com.google.auth.oauth2.ServiceAccountCredentials;
3031
import com.google.cloud.ByteArray;
3132
import com.google.cloud.Date;
3233
import 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);

google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/WorkerProxy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.google.api.client.http.javanet.NetHttpTransport;
2020
import com.google.auth.Credentials;
2121
import com.google.auth.http.HttpTransportFactory;
22-
import com.google.auth.oauth2.GoogleCredentials;
22+
import com.google.auth.oauth2.ServiceAccountCredentials;
2323
import com.google.cloud.opentelemetry.trace.TraceConfiguration;
2424
import com.google.cloud.opentelemetry.trace.TraceExporter;
2525
import 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

google-cloud-spanner/src/test/java/com/google/cloud/spanner/GceTestEnvConfig.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import static com.google.common.base.Preconditions.checkState;
2222

2323
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
24-
import com.google.auth.oauth2.GoogleCredentials;
24+
import com.google.auth.oauth2.ServiceAccountCredentials;
2525
import com.google.cloud.spanner.spi.v1.SpannerInterceptorProvider;
2626
import io.grpc.CallOptions;
2727
import 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
}

0 commit comments

Comments
 (0)