Removing dependency on vulnerable deprecated package (request) and updating other dependencies #4
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Reason for pull request
While installing redcap with npm, npm generates a security report listing some vulnerabilities (see npm audit report below). The vulnerabilities in debug, diff, growl and mkdirp are resolved by updating mocha. Updating mocha contains breaking changes, but I suspect them not to be relevant. For the vulnerability in request and it's dependency tough-cookie is no fix available. Request has been fully deprecated in 2020 and should no longer be used.
I dug a bit in the code base and request seems to be only used in
lib/utils/postFileUpload.jsand should be able to be replaced with thehttpsandform-datapackage from the standard library. This pull request attempts just that.Caveat
I do not have a REDCap project with full feature support. Therefor I can't execute all unit tests to validate that the mocha breaking changes are irrelevant. I also can't test the
postFileUploadutility since the REDCap project I have available does not support file uploads and I can't enable the capability myself.I expect my changes to work, but if possible please check the code and test the functionality, before considering to merge.
What was done?
Update dependencies
Using
npm updateandnpm audit fix --forceRemoving request
The rest should be pretty much the same, but I'm not entirely sure, because I'm basically writing the patch blind.
I hope the patch doesn't require that much more work.
Kind regards
Benjamin