mosquito / aio-pika

AMQP 0.9 client designed for asyncio and humans.
https://aio-pika.readthedocs.org/
Apache License 2.0
1.23k stars 187 forks source link

Feature request: providing amqp "connection.update_secret" implementation for refreshing tokens #481

Closed deschmih closed 2 years ago

deschmih commented 2 years ago

Hey, while connecting to rabbitmq and using jwt in an oauth2 manner, a token refresh before expiring is necessary. Currently I can do this only in the way closing the connection and open again. Since AMQP 0.9.1 https://www.rabbitmq.com/amqp-0-9-1-reference.html there is another option to do this. Connection.update-secret is the preferred way to do this. Update-secret is implemented in pamqp library. It would be nice to have this feature available in aio-pika.connection as a separate method.

mosquito commented 2 years ago

@deschmih feel free to join the review.

deschmih commented 2 years ago

You have done a really good job. Many thanks for this. But I think you should also bump version in setup.py to aiormq~=6.4.0 https://github.com/mosquito/aio-pika/blob/8c1515127d37df5997d869c5129d119d5f65e12a/setup.py#L41

deschmih commented 2 years ago

@mosquito To get a tagged version would be the icing on the cake. ;-) Many thanks.