Skip to content

Commit 7eb8d49

Browse files
authored
fix: never use credentials in combination with plain text (#98)
1 parent e96e172 commit 7eb8d49

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.google.api.gax.grpc.GrpcInterceptorProvider;
2121
import com.google.api.gax.retrying.RetrySettings;
2222
import com.google.api.gax.rpc.TransportChannelProvider;
23+
import com.google.cloud.NoCredentials;
2324
import com.google.cloud.ServiceDefaults;
2425
import com.google.cloud.ServiceOptions;
2526
import com.google.cloud.ServiceRpc;
@@ -518,6 +519,8 @@ public ManagedChannelBuilder apply(ManagedChannelBuilder builder) {
518519
return builder.usePlaintext();
519520
}
520521
});
522+
// As we are using plain text, we should never send any credentials.
523+
this.setCredentials(NoCredentials.getInstance());
521524
}
522525
return new SpannerOptions(this);
523526
}

0 commit comments

Comments
 (0)