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

fix: strf-8574, bump "hapi" and its modules to fix security issues #617

Conversation

MaxGenash
Copy link
Contributor

What?

Bumped outdated versions of "hapi" and its related modules to fix security vulnerabilities.

Modules "h2o2" and "inert" were emitted from "hapi" in the newer versions, so I added them as separate dependencies.

Tickets / Documentation

This PR is a part of STRF-8574

@MaxGenash MaxGenash requested a review from a team August 13, 2020 12:12
@MaxGenash MaxGenash self-assigned this Aug 13, 2020
@MaxGenash MaxGenash added the dependencies Pull requests that update a dependency file label Aug 13, 2020
let themePath = process.cwd();
let templatePath = Path.join(themePath, 'templates');
let dotStencilFilePath = Path.join(themePath, '.stencil');
let themeConfigPath = Path.join(themePath, 'config.json');
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason why these paths can't be const ?

Copy link
Contributor Author

@MaxGenash MaxGenash Aug 14, 2020

Choose a reason for hiding this comment

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

@junedkazi no, I just didn’t notice that they aren’t further modified :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

proxy: "localhost:" + stencilServerPort,
tunnel: tunnel,
});
const tunnel = typeof Program.tunnel === 'undefined'
Copy link
Contributor

Choose a reason for hiding this comment

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

we can move this to the top where we define other constants 🍹

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

"@hapi/boom": "^8.0.1",
"@hapi/glue": "^6.2.0",
"@hapi/good": "^8.2.4",
"@hapi/good-console": "^8.1.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to be deprecated soon. See https://www.npmjs.com/package/@hapi/good-console for details.
This is not a blocker but we should investigate and figure out if it is required or we drop the usage in a followup PR.

Copy link
Contributor Author

@MaxGenash MaxGenash Aug 14, 2020

Choose a reason for hiding this comment

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

Ok, I'll check it on Monday

@@ -36,11 +36,17 @@
"@bigcommerce/stencil-paper": "^3.0.0-rc.29",
"@bigcommerce/stencil-styles": "1.2.1",
"@octokit/rest": "^18.0.3",
"@hapi/boom": "^8.0.1",
"@hapi/glue": "^6.2.0",
"@hapi/good": "^8.2.4",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to be deprecated soon. See https://www.npmjs.com/package/@hapi/good for details.
This is not a blocker but we should investigate and figure out if it is required or we drop the usage in a followup PR.

Copy link
Contributor Author

@MaxGenash MaxGenash Aug 14, 2020

Choose a reason for hiding this comment

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

Ok, I'll check it on Monday

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@junedkazi I checked, we can drop "@hapi/good" and "@hapi/good-console" since they aren't actually used in this project. I can create a corresponding followup PR when this one gets merged.

@@ -19,11 +19,12 @@ lab.describe('RawResponse', () => {
const statusCode = 200;
let request;
let response;
let reply;
let h;
Copy link
Contributor

Choose a reason for hiding this comment

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

what does h stand for ?

Copy link
Contributor Author

@MaxGenash MaxGenash Aug 14, 2020

Choose a reason for hiding this comment

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

@junedkazi From the docs "h" stands for HAPI.
They replaced the reply function with this "Response Toolkit" (h) in v17.

@@ -14,24 +14,24 @@ const internals = {
*/
function RawResponse(data, headers, statusCode) {

this.respond = function (request, reply) {
var payload = data;
this.respond = function (request, h) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what does h stand for ?

Copy link
Contributor Author

@MaxGenash MaxGenash Aug 14, 2020

Choose a reason for hiding this comment

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

@junedkazi From the docs "h" stands for HAPI.
They replaced the reply function with this "Response Toolkit" (h) in v17.

Copy link
Contributor

@junedkazi junedkazi left a comment

Choose a reason for hiding this comment

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

@MaxGenash I feel this is good to go. Can you create follow up tickets to drop the deprecated packages ?

@junedkazi junedkazi merged commit 3ba580e into bigcommerce:master Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants