influxdata / influxdb-python

Python client for InfluxDB
MIT License
1.7k stars 522 forks source link

Unquote username & password when parsing a DSN #919

Open dufferzafar opened 2 years ago

dufferzafar commented 2 years ago

A DSN like: influxdb://user:sec#ret@host:port should be written as influxdb://user:sec%23ret@host:port

RFC 3986 allows characters like # ? to appear %-quoted in username / password which should be properly unquoted before using them.

Please see relevant Python bug: https://bugs.python.org/issue18140#msg375109

dufferzafar commented 2 years ago

SQLAlchemy already handles this: https://github.com/sqlalchemy/sqlalchemy/blob/6e538cf64adfef7f604e3b0d976405a27b8e3d27/lib/sqlalchemy/engine/url.py#L834-L838