File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 4747import com .google .api .gax .rpc .internal .Headers ;
4848import com .google .api .gax .tracing .ApiTracer ;
4949import com .google .api .gax .tracing .BaseApiTracer ;
50+ import com .google .auth .ApiKeyCredentials ;
5051import com .google .auth .Credentials ;
5152import com .google .auth .Retryable ;
5253import com .google .common .base .Preconditions ;
@@ -192,7 +193,9 @@ public GrpcCallContext nullToSelf(ApiCallContext inputContext) {
192193 public GrpcCallContext withCredentials (Credentials newCredentials ) {
193194 Preconditions .checkNotNull (newCredentials );
194195 CallOptions newCallOptions = callOptions ;
195- if (channelCredentials == null || !(channelCredentials == newCredentials )) {
196+ if (channelCredentials == null
197+ || newCredentials instanceof ApiKeyCredentials
198+ || !(channelCredentials == newCredentials )) {
196199 newCallOptions = callOptions .withCallCredentials (MoreCallCredentials .from (newCredentials ));
197200 }
198201 return new GrpcCallContext (
You can’t perform that action at this time.
0 commit comments