-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Pubsub: add 'PublisherClient.from_service_account_dict' #8137
Comments
@xrmx You should be able to create credentials via the from google.oauth2.service_account import Credentials
from google.cloud.pubsub_v1 import PublisherClient
credentials = Credentials.from_service_account_info(your_dict)
publisher_client = PublisherClient(credentials=credentials) |
@tseaver sure I am currently doing this, but it would be nice to have already a wrapper to avoid digging into source code to find out where all this come from :) |
I think that this is a general auth problem. There should be a simple way to configure auth. IMHO, if there's a nee for a different auth configuration, there should be a clear and documented way to do more complex configuration. The changes should probably adding more docs for auth, and then getting references to those docs from all of the clients. |
The Given that we fix the docs, I'd say we don't need to add a |
FWIW, there is an open PR that adds a quick example on how to use an other-than-default Or, if "almost sufficient", the PR can be updated to cover this issue, too. |
@plamut commented on the PR, thanks! |
Is your feature request related to a problem? Please describe.
I'd like to use the pubsub client on a webapp where i have the secrets in environment variables and not on disk.
Describe the solution you'd like
I would like to have a classmethod added to Publisher to instantiate a client with the credentials passed from a dict instead of a json file path.
The text was updated successfully, but these errors were encountered: