diff --git a/BUILD b/BUILD index a15f38343cd..bf0a9085a94 100644 --- a/BUILD +++ b/BUILD @@ -1768,7 +1768,7 @@ grpc_cc_library( "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/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/jwt/json_token.cc", "src/core/lib/security/credentials/jwt/jwt_credentials.cc", diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h index 7f3e6ae5741..823bddebb05 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -301,7 +301,7 @@ GRPCAPI grpc_call_credentials* grpc_composite_call_credentials_create( GRPCAPI grpc_call_credentials* grpc_google_compute_engine_credentials_create( 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. @@ -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 this could result in an oauth2 token leak. The security level of the 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); GRPCAPI gpr_timespec grpc_max_auth_token_lifetime(void); diff --git a/src/core/lib/security/credentials/google_default/gce_channel_credentials.cc b/src/core/lib/security/credentials/google_default/compute_engine_channel_credentials.cc similarity index 97% rename from src/core/lib/security/credentials/google_default/gce_channel_credentials.cc rename to src/core/lib/security/credentials/google_default/compute_engine_channel_credentials.cc index bae2b128747..da1e6832d72 100644 --- a/src/core/lib/security/credentials/google_default/gce_channel_credentials.cc +++ b/src/core/lib/security/credentials/google_default/compute_engine_channel_credentials.cc @@ -44,7 +44,7 @@ #include "src/core/lib/slice/slice_string_helpers.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) { // 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 diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py index 71b65d31f4c..079d51431f7 100644 --- a/src/python/grpcio/grpc/__init__.py +++ b/src/python/grpcio/grpc/__init__.py @@ -1868,12 +1868,12 @@ def alts_server_credentials(): return ServerCredentials(_cygrpc.server_credentials_alts()) -def gce_channel_credentials(call_creds): +def compute_engine_channel_credentials(call_creds): """ TODO: Document. """ return ChannelCredentials( - _cygrpc.channel_credentials_gce(call_creds._credentials)) + _cygrpc.channel_credentials_compute_engine(call_creds._credentials)) def channel_ready_future(channel): diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi index 8b9f40671a7..e205f61f0dc 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi @@ -381,7 +381,7 @@ def server_credentials_alts(): grpc_alts_credentials_options_destroy(c_options) return credentials -cdef class GCEChannelCredentials(ChannelCredentials): +cdef class ComputeEngineChannelCredentials(ChannelCredentials): cdef grpc_channel_credentials* _c_creds cdef grpc_call_credentials* _c_call_creds @@ -390,12 +390,12 @@ cdef class GCEChannelCredentials(ChannelCredentials): self._c_call_creds = call_creds.c() 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 # TODO: Does this thing need to be deleted? # I suppose the reason the google default one doesn't need to be is # because there's one per process. We'll see. -def channel_credentials_gce(call_creds): - return GCEChannelCredentials(call_creds) +def channel_credentials_compute_engine(call_creds): + return ComputeEngineChannelCredentials(call_creds) diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi index bdfdf4672f5..d4f3716b78f 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi @@ -505,7 +505,7 @@ cdef extern from "grpc/grpc_security.h": grpc_ssl_roots_override_callback cb) 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( const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair, verify_peer_options *verify_options, void *reserved) nogil diff --git a/src/python/grpcio_tests/tests/interop/client.py b/src/python/grpcio_tests/tests/interop/client.py index ca0b5a03c6c..b56880c5c07 100644 --- a/src/python/grpcio_tests/tests/interop/client.py +++ b/src/python/grpcio_tests/tests/interop/client.py @@ -120,7 +120,7 @@ def get_secure_channel_parameters(args): 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.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_credentials, call_credentials)