Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move to using insecure grpc channels with emulator #402

Merged
merged 13 commits into from Jul 22, 2021
19 changes: 12 additions & 7 deletions google/cloud/firestore_v1/base_client.py
Expand Up @@ -177,15 +177,20 @@ def _emulator_channel(self, transport):
# TODO: Implement a special credentials type for emulator and use
# "transport.create_channel" to create gRPC channels once google-auth
# extends it's allowed credentials types.
# if "GrpcAsyncIOTransport" in str(transport.__name__):
# return grpc.aio.secure_channel(
# self._emulator_host, self._local_composite_credentials()
# )
# else:
# return grpc.secure_channel(
# self._emulator_host, self._local_composite_credentials()
# )
crwilcox marked this conversation as resolved.
Show resolved Hide resolved
if "GrpcAsyncIOTransport" in str(transport.__name__):
return grpc.aio.secure_channel(
self._emulator_host, self._local_composite_credentials()
)
return grpc.aio.insecure_channel(
self._emulator_host)
else:
return grpc.secure_channel(
self._emulator_host, self._local_composite_credentials()
)

return grpc.insecure_channel(
self._emulator_host)
def _local_composite_credentials(self):
"""
Creates the credentials for the local emulator channel
Expand Down