How to publish to pub/sub with just an api key

僤鯓⒐⒋嵵緔 提交于 2020-01-25 07:18:30

问题


I need to publish messages to GCP Pub/Sub with a POST request as the platform I'm using (Zoho) does not allow for any of the GCP libraries. I'm not sure how to make the request in a simple way, as the normal authentication system seems complex.

  1. Is there an easy way to publish a message using, e.g., an API key?

  2. Alternatively is there a simple way to create an API endpoint within GCP that I can then forward data on to the messaging system?

I have used the python client to publish to Pub/Sub, but cannot make POST requests because of the authentication issues.


回答1:


Both of your questions will have the same answer, yes, and Google Cloud Endpoints is your way to go here.

With Google Cloud Endpoints you can create a custom endpoint and use API keys to authenticate the requests that are being done. There's a really good how-to guide from medium you can follow in order to set up your endpoint and your Pub/Sub push subscription.

More information about creating push subscriptions can be found in the public documentation.



来源:https://stackoverflow.com/questions/57524669/how-to-publish-to-pub-sub-with-just-an-api-key

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!