-
Notifications
You must be signed in to change notification settings - Fork 104
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
fix(migrations): encode input to ensure valid postgres urls #6123
base: main
Are you sure you want to change the base?
Conversation
86b10ea
to
5630680
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Intellicode, thank you for this contribution. There are currently multiple createConnectionString
copies within our code base e.g.
packages/services/storage/src/db/utils.ts
packages/migrations/src/connection-string.ts
Could you adjust all of them to use the same function definition with your improvements?
Also could you please add a changeset for hive
using the command pnpm changeset
, for describing this improvement?
@n1ru4l Thanks for your feedback! I've modified the other places to include the logic, I've also made password optional, since some authentication mechanisms allow disabling of password based login (such as in Azure with Workload ID's on Kubernetes) |
a25a003
to
cbfe669
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Intellicode Can you also update the configuration of other services that access postgres and the READMEs (mark password as optional env variable).
Please also add a changeset for graphql-hive
74f029e
to
9b7794a
Compare
…sword if not provided
Co-authored-by: Laurin Quast <[email protected]>
Co-authored-by: Laurin Quast <[email protected]>
55302c7
to
c5e4838
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates to the following files are missing:
- https://github.com/graphql-hive/console/blob/main/packages/services/rate-limit/src/environment.ts
- https://github.com/graphql-hive/console/blob/main/packages/services/stripe-billing/src/environment.ts
- https://github.com/graphql-hive/console/blob/main/packages/services/tokens/src/environment.ts
- https://github.com/graphql-hive/console/blob/main/packages/services/usage-estimator/src/environment.ts
- https://github.com/graphql-hive/console/blob/main/packages/services/server/src/environment.ts
Background
When passwords (or other parameters) contain special characters (such as
%
in a password), it will result in invalid postgres url'sDescription
The change encodes all injected input parameters, I can remove some if you think its unnecessary.
Checklist