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

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 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 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
4 checks passed
4 checks passed
codecov/patch 100% of diff hit (target 96.38%)
Details
codecov/project 96.38% (+<.01%) compared to fcd07ef
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@sushantdhiman
Copy link
Contributor

@sushantdhiman sushantdhiman commented Oct 13, 2018

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

@gaganpreet gaganpreet commented Feb 20, 2019

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
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants