Open ranchodeluxe opened 3 months ago
to get this test passing locally using the testing infrastructure I had to:
/
then urllib.parse.quote
worked:revised passing test
{
'name': 'dsn_bad_characters_maybe',
'dsn': 'postgres://eoapi:a2Vw%3Ayk%3D%29CdSis%5Bfek%5DtW%3D@eoapi-primary.default.svc:5432/eoapi',
'result': ([('eoapi-primary.default.svc', 5432)], {
'user': 'eoapi',
'password': 'a2Vw:yk=)CdSis[fek]tW=',
'database': 'eoapi',
'ssl': True,
'sslmode': SSLMode.prefer
,
'target_session_attrs': 'any'})
},
I see we have a _validate_port_spec.
If passwords don't allow certain characters should we validate and raise too?
thanks @elprans : urllib.parse.quote_plus()
works, test is up to date
will close this
$ pytest tests/test_connect.py -k TestConnectParams
tests/test_connect.py ✓✓✓✓✓✓✓✓✓✓ 100% ██████████
Results (0.09s):
10 passed
41 deselected
Problem
Crunchydata Postgresql Operator creates passwords by default using the
US-ASCII
spec. Some of them with special characters in it including@
,[
,]
,/
that seem to cause problems forasyncpg
host parsing even after runningurllib.parse.quote
on the password.The error below shows it return the password assuming it's the port from an example app:
Test output (from this PR) running locally: