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

Update dependencies #35

Merged
merged 3 commits into from
Mar 25, 2020
Merged

Update dependencies #35

merged 3 commits into from
Mar 25, 2020

Conversation

hyperparabolic
Copy link
Contributor

This package has started reporting vulnerabilities in npm audit. I'm fairly certain that only test dependencies are vulnerable, but wanted to get this fixed up anyway.

The first commit is enough to stop npm audit complaints.

The second commit is a complete update of all dependencies and requires some joi validation migrations.

Let me know if this works, I'd love to get it in so we don't need to manage a fork.

@nlf
Copy link
Owner

nlf commented Feb 11, 2020

you're correct in that only devDependencies here are vulnerable. i like the idea of updating everything, i just need to take a few minutes and make sure there's nothing that warrants a major version bump here (i don't think there is, since it's all internal usage libraries anyway)

i'll get this released shortly. thanks for your help!

@@ -353,37 +353,31 @@ internals.addHeaders = function (request, h) {

internals.validateOptions = function (options) {

let result;
const { error, value } = Schema.validate(options);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

.validate with a callback parameter seems to be deprecated.

@@ -30,5 +30,5 @@ module.exports = Joi.object({
styleSrc: Joi.array().items(Joi.string()).single().default(['self'])
.when('generateNonces', { is: [false, 'script'], then: Joi.array().items(Joi.string().valid('strict-dynamic').forbidden()) }),
workerSrc: Joi.array().items(Joi.string()).single().default(['self']),
generateNonces: Joi.alternatives().try([Joi.boolean(), Joi.string().valid('script', 'style')]).default(true)
generateNonces: Joi.alternatives().try(Joi.boolean(), Joi.string().valid('script', 'style')).default(true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Joi migration. They transitioned to using spread args instead of an array of args.

@@ -439,7 +439,7 @@ describe('Generic headers', () => {
url: '/'
});

expect(res.statusCode).to.equal(200);
expect(res.statusCode).to.equal(204);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

return '' on line 433 is being treated as an empty response and is a 204 (no content) rather than a 200 like before.

@@ -24,6 +24,6 @@ describe('Blankie', () => {
options: {
reportOnly: 'invalid value'
}
}])).to.reject(Error, 'child "reportOnly" fails because ["reportOnly" must be a boolean]');
}])).to.reject(Error, '"reportOnly" must be a boolean');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Joi error string format changed here.

@hyperparabolic
Copy link
Contributor Author

Bumped that version again due to a new npm audit flag.

hapijs/hapi#4017 I'd probably bump the major version because node v11 is unsupported by hapi going forward. Even if hoek still works fine with v11, it could break in a minor version update without warning.

@nlf nlf merged commit 220f3b6 into nlf:master Mar 25, 2020
@nlf
Copy link
Owner

nlf commented Mar 25, 2020

published as 5.0.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.

2 participants