You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to use procastinate in my Django project, mainly because of it's awesome name ;).
I'm deploying my application on AWS, and would like to enable automatic secrets management for the RDS database that I'm using there. This implies that the database credentials can (and will) be rotated out, and that one should fetch fresh database credentials that have the newly applied password.
Currently, it is not possible to implement this using an aiopg pool; as far as I can see, new connections to the database are made here:
I'm not an expert on python async programming, but would be willing to implement this, if you think this has a chance of being merged.
Describe alternatives you've considered
I have disabled password rotation for now, so I am not blocked.
I looked at the synchronous pathways in procrastinate. I'm able to subclass a connector, and override the function which creates a database connection. I'd rather not do that with the Pool class, the _fill_free_pool function does way more than just establishing a connection.
Al alternative could be to extract the following lines into a def _create_connection(dsn, timeout, enable_json, ....), and to subclass the Pool, and override this helper function. Please correct me if I'm wrong, but after browsing through the source code, I have the feeling that this project prefers composition over using inheritance.
Is your feature request related to a problem?
I'd like to use procastinate in my Django project, mainly because of it's awesome name ;).
I'm deploying my application on AWS, and would like to enable automatic secrets management for the RDS database that I'm using there. This implies that the database credentials can (and will) be rotated out, and that one should fetch fresh database credentials that have the newly applied password.
Currently, it is not possible to implement this using an aiopg pool; as far as I can see, new connections to the database are made here:
aiopg/aiopg/pool.py
Lines 336 to 343 in 7b01833
Describe the solution you'd like
Would
aiopg
be open to add an additional callback to provide a way to override the values inself._dsn
andself._conn_kwargs
?I have noticed that a callback exists that is invoked after a connection is made:
aiopg/aiopg/pool.py
Lines 345 to 346 in 7b01833
I would propose to implement this using the following code, and add the callback to the constructor of the pool, like is done for
on_connect
.I'm not an expert on python async programming, but would be willing to implement this, if you think this has a chance of being merged.
Describe alternatives you've considered
I have disabled password rotation for now, so I am not blocked.
I looked at the synchronous pathways in procrastinate. I'm able to subclass a connector, and override the function which creates a database connection. I'd rather not do that with the
Pool
class, the_fill_free_pool
function does way more than just establishing a connection.Al alternative could be to extract the following lines into a
def _create_connection(dsn, timeout, enable_json, ....)
, and to subclass the Pool, and override this helper function. Please correct me if I'm wrong, but after browsing through the source code, I have the feeling that this project prefers composition over using inheritance.aiopg/aiopg/pool.py
Lines 336 to 344 in 7b01833
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: