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: pass anonymous credentials for emulator #250

Merged
merged 1 commit into from Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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