permitio / opal

Policy and data administration, distribution, and real-time updates on top of Policy Agents (OPA, Cedar, ...)
https://opal.ac
Apache License 2.0
3.51k stars 154 forks source link

Special characters in postgres password result in client connections being closed. #584

Open tyndra opened 1 month ago

tyndra commented 1 month ago

Describe the bug I am using postgres as a broadcast channel backend. Observed strange behavior when the client connection is being closed immediately after opening. The log files did not provide much for troubleshooting.

 2024-05-13T13:27:24.206089+0000 | fastapi_websocket_rpc.websocket_rpc_e...| INFO  | Client connection failed - 52764 :: 531a6024dc4d457ea5ad9857ddbb8ed9
 2024-05-13T13:27:24.214804+0000 | websockets.legacy.server                | INFO  | connection closed

Traced the problem to a special character in the password string. Example: bnvcGy1pU%071lS

To Reproduce Change postgress password to bnvcGy1pU%071lS and configure the server with new connection string (OPAL_BROADCAST_URI)

Expected behavior Allow special characters in the password string

OPAL version

orweis commented 1 month ago

Hi @tyndra I think this is a bug in asyncpg, that was fixed , could you check which version of asyncpg you have installed for Python running the server ?

CC: @roekatz

tyndra commented 1 month ago

Version: 0.29.0

orweis commented 1 month ago

I've opened a ticket for this : ticket PER-9920