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

Add ssl option to uri for postgres #10025

Merged
merged 4 commits into from Oct 13, 2018
Merged

Add ssl option to uri for postgres #10025

merged 4 commits into from Oct 13, 2018

Conversation

justinkalland
Copy link
Contributor

@justinkalland justinkalland commented Oct 11, 2018

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

Added support for the ssl option to the Postgres URI. For example:

postgres://localhost/sequelize_test?ssl=true

The way I chose to support this was assigning any query parameters from the URI into dialectOptions. Then each dialects ConnectionManager.connect() can use the parameters the same as if they were used in the constructor with options.dialectOptions.

Closes #10015

Related #9712, #6932, #5891

Copy link
Contributor

@sushantdhiman sushantdhiman left a comment

Choose a reason for hiding this comment

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

Please add some tests in https://github.com/sequelize/sequelize/blob/master/test/unit/configuration.test.js#L57

Assert that dialectOptions got new entries as specified in connection string

@codecov
Copy link

codecov bot commented Oct 12, 2018

Codecov Report

Merging #10025 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10025      +/-   ##
==========================================
+ Coverage   96.38%   96.38%   +<.01%     
==========================================
  Files          63       63              
  Lines        9382     9386       +4     
==========================================
+ Hits         9043     9047       +4     
  Misses        339      339
Impacted Files Coverage Δ
lib/sequelize.js 96.62% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fcd07ef...8d82270. Read the comment docs.

@justinkalland
Copy link
Contributor Author

justinkalland commented Oct 12, 2018

Sorry about the commit mistakes, I am newer to GitHub and still figuring out the nuances of pull requests.

@sushantdhiman sushantdhiman merged commit fa587ac into sequelize:master Oct 13, 2018
@sushantdhiman
Copy link
Contributor

Thanks @justinkalland

@justinkalland justinkalland deleted the add-uri-ssl-postgres branch October 14, 2018 01:13
@gaganpreet
Copy link

Is this going to be released on npm? Just came across this issue and tried changing sslmode=require to ssl=true in my connection string. No dice. Using latest Sequelize version (4.42.0).

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.

None yet

3 participants