I'm using google-cloud-pubsub in Django and the Google Cloud Pub/Sub Emulator. I'm trying to create a topic in this way:
publisher = pubsub.PublisherClient ()
topic_path = publisher.topic_path ('my-project', 'my-new-topic')
topic = publisher.create_topic (topic_path)
topic.publish (topic, request.data ['url']. encode ('utf-8'))
but it gives me this exception:
StatusCode.PERMISSION_DENIED, User not authorized to perform this action.
I'm wondering if there is anything else to configure except the PUBSUB_EMULATOR_HOST environment variable. Do I have to set some permissions, even for the emulator? The tutorial doesn't explain much more.
Thanks in advance.