Skip to content

Add ssl option to uri for postgres - #10025

Merged
sushantdhiman merged 4 commits into
sequelize:masterfrom
justinkalland:add-uri-ssl-postgres
Oct 13, 2018
Merged

Add ssl option to uri for postgres#10025
sushantdhiman merged 4 commits into
sequelize:masterfrom
justinkalland:add-uri-ssl-postgres

Conversation

@justinkalland

@justinkalland justinkalland commented Oct 11, 2018

Copy link
Copy Markdown
Contributor

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

@sushantdhiman sushantdhiman left a comment

Copy link
Copy Markdown
Contributor

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

codecov Bot commented Oct 12, 2018

Copy link
Copy Markdown

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

justinkalland commented Oct 12, 2018

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor

Thanks @justinkalland

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

Copy link
Copy Markdown

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.

3 participants