Skip to content

Commit

Permalink
fix: pass anonymous credentials for emulator (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
HemangChothani committed Dec 21, 2020
1 parent 2584147 commit 8eed8e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions google/cloud/pubsub_v1/publisher/client.py
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/pubsub_v1/subscriber/client.py
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8eed8e1

Please sign in to comment.