Conversation
dfangl
left a comment
There was a problem hiding this comment.
LGTM! At some point we might need to introduce a handler for connection requests as well, but this seems good so far!
We will have to see if keeping the whitelist up to date takes a lot of work or not.
| @@ -0,0 +1,42 @@ | |||
|
|
|||
| ALLOWED_CONNECTION_PARAMETERS = [ | |||
There was a problem hiding this comment.
We probably have to adjust this list for each new postgresql version, but seems like a good solution for now!
There was a problem hiding this comment.
Yes, I thought about either going through a modular approach for connection handlers, or instead setting it directly. As we only have postgres after our proxy, I thought it could be done directly for now, but not closing any doors!
For the whitelist, I made a small script fetching and parsing the postgres documentation page linked above, so it is pretty fast but needs to be thought about, that's a thing.
This PR allows the proxy to modify and ignore the incoming connection parameters, allowing for example Redshift connector to connect to a Postgres server. A release on pypi will be needed.
List of allowed connection parameters: https://www.postgresql.org/docs/11/libpq-connect.html#LIBPQ-PARAMKEYWORDS