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

URL encode postgres credentials #4550

Merged
merged 2 commits into from
Oct 8, 2021

Conversation

agrimrules
Copy link
Contributor

When the postgres credentials contain charachters such as / and ?
we need to URL encode them so that they are processed correctly.

Resolves: #3901

What changed?
When using the postgres sql plugin, we need to URL encode the username/password if they contain characters like / and ?.

Why?
To support postgres passwords containing / and ? or other similar characters in them.

How did you test it?
Verified the following ways

  1. Tested against local docker postgres with problematic passwords.
  2. Added unit test to verify correct encoding.

Potential risks
postgres connectivity could break on older versions of postgres. (very unlikely)

Release notes
None.

Documentation Changes
None.

When the postgres credentials contain characters such as / and ?
we need to URL encode them so that they are processed correctly.

Resolves: uber#3901
Copy link
Collaborator

@longquanzheng longquanzheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for fixing it!

@coveralls
Copy link

Pull Request Test Coverage Report for Build 819225dc-22f4-40f1-9d34-9b4c8b3eee7a

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 80 unchanged lines in 16 files lost coverage.
  • Overall coverage decreased (-0.04%) to 56.684%

Files with Coverage Reduction New Missed Lines %
service/history/queue/timer_queue_processor_base.go 1 78.6%
client/history/client.go 2 40.32%
client/history/metricClient.go 2 45.94%
common/task/weightedRoundRobinTaskScheduler.go 2 89.64%
common/types/mapper/thrift/shared.go 2 64.52%
service/history/execution/mutable_state_builder.go 2 69.77%
service/history/handler.go 2 48.32%
service/matching/matcher.go 2 91.46%
common/persistence/nosql/nosqlplugin/cassandra/workflow.go 3 55.49%
common/task/fifoTaskScheduler.go 3 82.47%
Totals Coverage Status
Change from base Build 4b4d4a8c-0384-4e44-b5a7-3adfc3216dee: -0.04%
Covered Lines: 81009
Relevant Lines: 142914

💛 - Coveralls

@longquanzheng longquanzheng merged commit e372561 into uber:master Oct 8, 2021
longquanzheng pushed a commit that referenced this pull request Oct 8, 2021
longquanzheng pushed a commit that referenced this pull request Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Valid postgres passwords break connection string starting v0.16.0
3 participants