Change name to compute_engine_channel_credentials

pull/23203/head
Richard Belleville 5 years ago
parent 257fd6953e
commit 3bdc5bb4d1
  1. 2
      BUILD
  2. 4
      include/grpc/grpc_security.h
  3. 2
      src/core/lib/security/credentials/google_default/compute_engine_channel_credentials.cc
  4. 4
      src/python/grpcio/grpc/__init__.py
  5. 8
      src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi
  6. 2
      src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
  7. 2
      src/python/grpcio_tests/tests/interop/client.py

@ -1768,7 +1768,7 @@ grpc_cc_library(
"src/core/lib/security/credentials/fake/fake_credentials.cc", "src/core/lib/security/credentials/fake/fake_credentials.cc",
"src/core/lib/security/credentials/google_default/credentials_generic.cc", "src/core/lib/security/credentials/google_default/credentials_generic.cc",
"src/core/lib/security/credentials/google_default/google_default_credentials.cc", "src/core/lib/security/credentials/google_default/google_default_credentials.cc",
"src/core/lib/security/credentials/google_default/gce_channel_credentials.cc", "src/core/lib/security/credentials/google_default/compute_engine_channel_credentials.cc",
"src/core/lib/security/credentials/iam/iam_credentials.cc", "src/core/lib/security/credentials/iam/iam_credentials.cc",
"src/core/lib/security/credentials/jwt/json_token.cc", "src/core/lib/security/credentials/jwt/json_token.cc",
"src/core/lib/security/credentials/jwt/jwt_credentials.cc", "src/core/lib/security/credentials/jwt/jwt_credentials.cc",

@ -301,7 +301,7 @@ GRPCAPI grpc_call_credentials* grpc_composite_call_credentials_create(
GRPCAPI grpc_call_credentials* grpc_google_compute_engine_credentials_create( GRPCAPI grpc_call_credentials* grpc_google_compute_engine_credentials_create(
void* reserved); void* reserved);
/** Creates GCE channel credentials to connect to a google gRPC service. /** Creates compute engine channel credentials to connect to a google gRPC service.
call_credentials is expected to be a gce_call_credentials object. call_credentials is expected to be a gce_call_credentials object.
@ -312,7 +312,7 @@ GRPCAPI grpc_call_credentials* grpc_google_compute_engine_credentials_create(
WARNING: Do NOT use this credentials to connect to a non-google service as WARNING: Do NOT use this credentials to connect to a non-google service as
this could result in an oauth2 token leak. The security level of the this could result in an oauth2 token leak. The security level of the
resulting connection is GRPC_PRIVACY_AND_INTEGRITY. */ resulting connection is GRPC_PRIVACY_AND_INTEGRITY. */
GRPCAPI grpc_channel_credentials* grpc_gce_channel_credentials_create( GRPCAPI grpc_channel_credentials* grpc_compute_engine_channel_credentials_create(
grpc_call_credentials* call_credentials, void* reserved); grpc_call_credentials* call_credentials, void* reserved);
GRPCAPI gpr_timespec grpc_max_auth_token_lifetime(void); GRPCAPI gpr_timespec grpc_max_auth_token_lifetime(void);

@ -44,7 +44,7 @@
#include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/api_trace.h"
grpc_channel_credentials* grpc_gce_channel_credentials_create( grpc_channel_credentials* grpc_compute_engine_channel_credentials_create(
grpc_call_credentials* call_credentials, void* reserved) { grpc_call_credentials* call_credentials, void* reserved) {
// If we haven't initialized the google_default_credentials singleton, // If we haven't initialized the google_default_credentials singleton,
// then we don't know whether or not we're on GCE and can't safely // then we don't know whether or not we're on GCE and can't safely

@ -1868,12 +1868,12 @@ def alts_server_credentials():
return ServerCredentials(_cygrpc.server_credentials_alts()) return ServerCredentials(_cygrpc.server_credentials_alts())
def gce_channel_credentials(call_creds): def compute_engine_channel_credentials(call_creds):
""" """
TODO: Document. TODO: Document.
""" """
return ChannelCredentials( return ChannelCredentials(
_cygrpc.channel_credentials_gce(call_creds._credentials)) _cygrpc.channel_credentials_compute_engine(call_creds._credentials))
def channel_ready_future(channel): def channel_ready_future(channel):

@ -381,7 +381,7 @@ def server_credentials_alts():
grpc_alts_credentials_options_destroy(c_options) grpc_alts_credentials_options_destroy(c_options)
return credentials return credentials
cdef class GCEChannelCredentials(ChannelCredentials): cdef class ComputeEngineChannelCredentials(ChannelCredentials):
cdef grpc_channel_credentials* _c_creds cdef grpc_channel_credentials* _c_creds
cdef grpc_call_credentials* _c_call_creds cdef grpc_call_credentials* _c_call_creds
@ -390,12 +390,12 @@ cdef class GCEChannelCredentials(ChannelCredentials):
self._c_call_creds = call_creds.c() self._c_call_creds = call_creds.c()
cdef grpc_channel_credentials *c(self) except *: cdef grpc_channel_credentials *c(self) except *:
self._c_creds = grpc_gce_channel_credentials_create(self._c_call_creds, NULL) self._c_creds = grpc_compute_engine_channel_credentials_create(self._c_call_creds, NULL)
return self._c_creds return self._c_creds
# TODO: Does this thing need to be deleted? # TODO: Does this thing need to be deleted?
# I suppose the reason the google default one doesn't need to be is # I suppose the reason the google default one doesn't need to be is
# because there's one per process. We'll see. # because there's one per process. We'll see.
def channel_credentials_gce(call_creds): def channel_credentials_compute_engine(call_creds):
return GCEChannelCredentials(call_creds) return ComputeEngineChannelCredentials(call_creds)

@ -505,7 +505,7 @@ cdef extern from "grpc/grpc_security.h":
grpc_ssl_roots_override_callback cb) nogil grpc_ssl_roots_override_callback cb) nogil
grpc_channel_credentials *grpc_google_default_credentials_create() nogil grpc_channel_credentials *grpc_google_default_credentials_create() nogil
grpc_channel_credentials *grpc_gce_channel_credentials_create(grpc_call_credentials* call_creds, void* reserved) nogil grpc_channel_credentials *grpc_compute_engine_channel_credentials_create(grpc_call_credentials* call_creds, void* reserved) nogil
grpc_channel_credentials *grpc_ssl_credentials_create( grpc_channel_credentials *grpc_ssl_credentials_create(
const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair, const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair,
verify_peer_options *verify_options, void *reserved) nogil verify_peer_options *verify_options, void *reserved) nogil

@ -120,7 +120,7 @@ def get_secure_channel_parameters(args):
request=google_auth.transport.requests.Request())) request=google_auth.transport.requests.Request()))
# TODO: Is there any reason why it actually had to take this argument? # 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? # Couldn't we just as easily have created a composite channel credential?
channel_credentials = grpc.gce_channel_credentials(call_creds) channel_credentials = grpc.compute_engine_channel_credentials(call_creds)
# channel_credentials = grpc.composite_channel_credentials(channel_credent) # channel_credentials = grpc.composite_channel_credentials(channel_credent)
# channel_credentials = grpc.composite_channel_credentials( # channel_credentials = grpc.composite_channel_credentials(
# channel_credentials, call_credentials) # channel_credentials, call_credentials)

Loading…
Cancel
Save