Use node:crypto instead of third-party md5#5404
Conversation
alexandrevryghem
left a comment
There was a problem hiding this comment.
Thnx @alanorth! I've verified that this replacement works like expected and compared the old translation file hashes with the ones created in this PR and they were identical, so I'm a +1
|
Thanks @alexandrevryghem. I wanted to pull this out as a separate change from #4739, as that one was getting a bit more complicated as I started working on it. |
|
Hi @alanorth, |
Use Node.js native Crypto to calculate md5 hashes instead of third- party md5 library.
|
Thanks @alanorth ! Looks good to me too. Merging immediately. However, this will likely need manual backporting to 8.x and 7.x, as those both used |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin dspace-7_x
git worktree add -d .worktree/backport-5404-to-dspace-7_x origin/dspace-7_x
cd .worktree/backport-5404-to-dspace-7_x
git switch --create backport-5404-to-dspace-7_x
git cherry-pick -x 0835031f83b138517c1ef59307a9879a4272f48c |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin dspace-8_x
git worktree add -d .worktree/backport-5404-to-dspace-8_x origin/dspace-8_x
cd .worktree/backport-5404-to-dspace-8_x
git switch --create backport-5404-to-dspace-8_x
git cherry-pick -x 0835031f83b138517c1ef59307a9879a4272f48c |
|
Successfully created backport PR for |
|
As I suspected, this was only able to be auto-backported to 9.x. If anyone wants to backport this further, I'd gladly review/merge the manual backports. But, per our support policies, we're only guaranteeing bug/dependency backports to 9.x at this point (unless they are security related, and this isn't). |
Description
Use Node.js native crypto API to calculate md5 hashes instead of third-party md5 library. This is used during production builds to calculate hashes of i18n language files.
Note: this could be backported to DSpace 9, 8, and 7 because it is very simple and I think the Node.js APIs have been around long enough to be in all versions we use. See
crypto.createHashdocs: https://nodejs.org/api/crypto.html#cryptocreatehashalgorithm-optionsInstructions for Reviewers
Please add a more detailed description of the changes made by your PR. At a minimum, providing a bulleted list of changes in your PR is helpful to reviewers.
List of changes in this PR:
Include guidance for how to test or review your PR. This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes.
Run the build in production mode with
npm run build:prodand thennpm run serve:ssrand make sure that language switching in the UI works.Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.