pull/23203/head
Richard Belleville 4 years ago
parent ff5f4bb6fc
commit e9a90ab30a
  1. 6
      include/grpc/grpc_security.h
  2. 4
      src/python/grpcio/grpc/__init__.py
  3. 12
      src/python/grpcio_tests/tests/interop/client.py

@ -148,11 +148,11 @@ GRPCAPI void grpc_channel_credentials_release(grpc_channel_credentials* creds);
valid throughout the lifetime of the returned grpc_channel_credentials
object. It is expected that the call credentials object was generated
according to the Application Default Credentials mechanism and asserts the
identity of default service account of the machine. Supplying any other sort
of call credential may result in RPCs suddenly and unexpectedly failing.
identity of the default service account of the machine. Supplying any other
sort of call credential may result in RPCs suddenly and unexpectedly failing.
If nullptr is supplied, the returned call credentials object will use a call
credentials object based on the default service account of the VM.
credentials object based on the Application Default Credentials mechanism.
*/
GRPCAPI grpc_channel_credentials* grpc_google_default_credentials_create(
grpc_call_credentials* call_credentials);

@ -1880,7 +1880,9 @@ def compute_engine_channel_credentials(call_credentials):
with any other call credential, the connection may suddenly and unexpectedly
begin failing RPCs.
"""
return ChannelCredentials(_cygrpc.channel_credentials_compute_engine(call_credentials._credentials))
return ChannelCredentials(
_cygrpc.channel_credentials_compute_engine(
call_credentials._credentials))
def channel_ready_future(channel):

@ -109,21 +109,15 @@ def get_secure_channel_parameters(args):
% args.grpc_test_use_grpclb_with_child_policy),)
if args.custom_credentials_type is not None:
if args.custom_credentials_type == "compute_engine_channel_creds":
# channel_credentials = grpc.google_default_channel_credentials()
if call_credentials is not None:
raise ValueError("What? That's not true! That's impossible!")
assert call_credentials is None
google_credentials, unused_project_id = google_auth.default(
scopes=[args.oauth_scope])
call_creds = grpc.metadata_call_credentials(
google_auth.transport.grpc.AuthMetadataPlugin(
credentials=google_credentials,
request=google_auth.transport.requests.Request()))
# TODO: Is there any reason why it actually had to take this argument?
# Couldn't we just as easily have created a composite channel credential?
channel_credentials = grpc.compute_engine_channel_credentials(call_creds)
# channel_credentials = grpc.composite_channel_credentials(channel_credent)
# channel_credentials = grpc.composite_channel_credentials(
# channel_credentials, call_credentials)
channel_credentials = grpc.compute_engine_channel_credentials(
call_creds)
else:
raise ValueError("Unknown credentials type '{}'".format(
args.custom_credentials_type))

Loading…
Cancel
Save