Skip to content
Permalink
Browse files
fix: pass anonymous credentials for emulator (#250)
  • Loading branch information
HemangChothani committed Dec 21, 2020
1 parent 2584147 commit 8eed8e16019510dc8b20fb6b009d61a7ac532d26
Showing with 4 additions and 0 deletions.
  1. +2 −0 google/cloud/pubsub_v1/publisher/client.py
  2. +2 −0 google/cloud/pubsub_v1/subscriber/client.py
@@ -26,6 +26,7 @@

from google.api_core import gapic_v1
from google.api_core import grpc_helpers
from google.auth.credentials import AnonymousCredentials
from google.oauth2 import service_account

from google.cloud.pubsub_v1 import _gapic
@@ -129,6 +130,7 @@ def __init__(self, batch_settings=(), publisher_options=(), **kwargs):
kwargs["channel"] = grpc.insecure_channel(
target=os.environ.get("PUBSUB_EMULATOR_HOST")
)
kwargs["credentials"] = AnonymousCredentials()

# The GAPIC client has mTLS logic to determine the api endpoint and the
# ssl credentials to use. Here we create a GAPIC client to help compute the
@@ -20,6 +20,7 @@
import grpc

from google.api_core import grpc_helpers
from google.auth.credentials import AnonymousCredentials
from google.oauth2 import service_account

from google.cloud.pubsub_v1 import _gapic
@@ -80,6 +81,7 @@ def __init__(self, **kwargs):
kwargs["channel"] = grpc.insecure_channel(
target=os.environ.get("PUBSUB_EMULATOR_HOST")
)
kwargs["credentials"] = AnonymousCredentials()

# The GAPIC client has mTLS logic to determine the api endpoint and the
# ssl credentials to use. Here we create a GAPIC client to help compute the

0 comments on commit 8eed8e1

Please sign in to comment.