Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow special characters in DB connection parts #386

Merged
merged 1 commit into from
May 18, 2024

Conversation

rustprooflabs
Copy link
Owner

Details

Addresses #383, tests based on #384.

This approach uses urllib.prase.quote() to handle special characters in Postgres passwords and other conn string components. This allows continuing to use URI style connection strings. There are a variety of places throughout the code that expect URI style connections.

The quote() method appears to handle the requirements defined by Postgres.

"The connection URI needs to be encoded with percent-encoding if it includes symbols with special meaning in any of its parts. Here is an example where the equal sign (=) is replaced with %3D and the space character with %20:"
From Postgres libpq connection docs

Thank you @jmealo for all the sleuthing you did to determine the cause of the issue and suggesting a path forward! I'll get an updated :latest image pushed soon, will comment here when that's ready.

@rustprooflabs rustprooflabs added the bug Something isn't working label May 18, 2024
@rustprooflabs rustprooflabs added this to the 1.0.1 milestone May 18, 2024
@rustprooflabs rustprooflabs merged commit d467450 into dev May 18, 2024
1 check passed
@rustprooflabs rustprooflabs deleted the 383-special-chars branch May 18, 2024 13:53
@jmealo
Copy link

jmealo commented May 18, 2024

@rustprooflabs: thanks for addressing this so quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants