Caps-Télé est désormais compatible avec l'extension FastNews.kiwi disponible pour votre navigateur. Avec cette extension, vérifiez s'il y a des nouveaux sujets sur ce forum en un clic depuis n'importe quelle page !Cliquez ici pour en savoir plus.
Posté le: Mercredi 13 Décembre 2017, 12:29 Sujet du message: Permissions for creating a subscription
Hi, It seems like a common intended usage of pubsub is for a consumer to create its own subscription when it starts up. That's based on a few observations: some client libraries have an option that automatically creates subscriptions; a subscription seems to evaporate after 7 days if nobody pulls from it; deployment/configuration of a service is more complicated if a subscription has to be pre-created; and a service often wouldn't want messages starting at some arbitrary time before it started.
However, to create a subscription, we see from the docs that you need:
(a) pubsub.subscriptions.create on the containing Cloud project (b) pubsub.topics.attachSubscription on the requested topic
The pubsub.subscriber role on the topic gives you (b), which makes sense.
But the only role listed with pubsub.subscriptions.create in it is pubsub.editor, which seems like a crazy permission to give at project level.
So…what am I missing? Intuitively it seems like pubsub.subscriber on the topic should be enough to do this. there doesn't seem to be any such operation in the API as "attaching" a subscription…isn't that the same as creating a subscription? So how are subscriptions.create and topics.attachSubscription logically different?
Please help. Thanks!
I didn't find the right solution from the Internet.