feat: use argon2 0.40.1

This commit is contained in:
Michel Loiseleur 2024-04-16 12:39:57 +02:00
parent 1909e2948a
commit 071c757d98
4 changed files with 28 additions and 28 deletions

View File

@ -139,12 +139,9 @@ jobs:
env:
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
# The only known way to get arm64 argon2 is to build it from sources
npm_config_arch: arm64
npm_config_build_from_source: true
steps:
- name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Unix Vars
run: |
@ -157,7 +154,7 @@ jobs:
sudo apt install binfmt-support qemu-user-static
- name: Set up Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
@ -167,17 +164,6 @@ jobs:
run: npm ci
working-directory: ./
# argon2-node comes with an ELF binary for host arch, not target arch.
- name: Download argon2-node binary for arm64
working-directory: ./
run: |
ARGON2_VERSION=$(grep '"argon2":' apps/cli/package.json | sed -e 's/.*"argon2": "\(.*\)",/\1/g')
echo "ARGON2_VERSION: ${ARGON2_VERSION}"
curl -L -o argon2.tar.gz "https://github.com/ranisalt/node-argon2/releases/download/v${ARGON2_VERSION}/argon2-v${ARGON2_VERSION}-napi-v3-linux-arm64-glibc.tar.gz"
tar xvzf argon2.tar.gz
mv napi-v3/argon2.node node_modules/argon2/lib/binding/napi-v3/argon2.node
rm -rf argon2.tar.gz napi-v3
- name: Build & Package Unix
run: npm run dist:${{ env.SHORT_RUNNER_OS }}:arm64 --quiet
@ -193,14 +179,14 @@ jobs:
| awk '{split($0, a); print a[1]}' > bw-${{ env.LOWER_RUNNER_OS }}-arm64-sha256-${{ env._PACKAGE_VERSION }}.txt
- name: Upload unix zip asset
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: bw-${{ env.LOWER_RUNNER_OS }}-arm64-${{ env._PACKAGE_VERSION }}.zip
path: apps/cli/dist/bw-${{ env.LOWER_RUNNER_OS }}-arm64-${{ env._PACKAGE_VERSION }}.zip
if-no-files-found: error
- name: Upload unix checksum asset
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: bw-${{ env.LOWER_RUNNER_OS }}-arm64-sha256-${{ env._PACKAGE_VERSION }}.txt
path: apps/cli/dist/bw-${{ env.LOWER_RUNNER_OS }}-arm64-sha256-${{ env._PACKAGE_VERSION }}.txt

View File

@ -51,7 +51,7 @@
"dependencies": {
"@koa/multer": "3.0.2",
"@koa/router": "12.0.1",
"argon2": "0.31.2",
"argon2": "0.40.1",
"big-integer": "1.6.51",
"browser-hrtime": "1.1.8",
"chalk": "4.1.2",

30
package-lock.json generated
View File

@ -29,7 +29,7 @@
"@microsoft/signalr": "8.0.0",
"@microsoft/signalr-protocol-msgpack": "8.0.0",
"@ng-select/ng-select": "11.2.0",
"argon2": "0.31.2",
"argon2": "0.40.1",
"argon2-browser": "1.18.0",
"big-integer": "1.6.51",
"bootstrap": "4.6.0",
@ -202,7 +202,7 @@
"dependencies": {
"@koa/multer": "3.0.2",
"@koa/router": "12.0.1",
"argon2": "0.31.2",
"argon2": "0.40.1",
"big-integer": "1.6.51",
"browser-hrtime": "1.1.8",
"chalk": "4.1.2",
@ -231,6 +231,20 @@
"bw": "build/bw.js"
}
},
"apps/cli/node_modules/argon2": {
"version": "0.31.2",
"resolved": "https://registry.npmjs.org/argon2/-/argon2-0.31.2.tgz",
"integrity": "sha512-QSnJ8By5Mth60IEte45w9Y7v6bWcQw3YhRtJKKN8oNCxnTLDiv/AXXkDPf2srTMfxFVn3QJdVv2nhXESsUa+Yg==",
"hasInstallScript": true,
"dependencies": {
"@mapbox/node-pre-gyp": "^1.0.11",
"@phc/format": "^1.0.0",
"node-addon-api": "^7.0.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"apps/desktop": {
"name": "@bitwarden/desktop",
"version": "2024.4.1",
@ -12457,17 +12471,17 @@
"dev": true
},
"node_modules/argon2": {
"version": "0.31.2",
"resolved": "https://registry.npmjs.org/argon2/-/argon2-0.31.2.tgz",
"integrity": "sha512-QSnJ8By5Mth60IEte45w9Y7v6bWcQw3YhRtJKKN8oNCxnTLDiv/AXXkDPf2srTMfxFVn3QJdVv2nhXESsUa+Yg==",
"version": "0.40.1",
"resolved": "https://registry.npmjs.org/argon2/-/argon2-0.40.1.tgz",
"integrity": "sha512-DjtHDwd7pm12qeWyfihHoM8Bn5vGcgH6sKwgPqwNYroRmxlrzadHEvMyuvQxN/V8YSyRRKD5x6ito09q1e9OyA==",
"hasInstallScript": true,
"dependencies": {
"@mapbox/node-pre-gyp": "^1.0.11",
"@phc/format": "^1.0.0",
"node-addon-api": "^7.0.0"
"node-addon-api": "^7.1.0",
"node-gyp-build": "^4.8.0"
},
"engines": {
"node": ">=14.0.0"
"node": ">=16.17.0"
}
},
"node_modules/argon2-browser": {

View File

@ -162,7 +162,7 @@
"@microsoft/signalr": "8.0.0",
"@microsoft/signalr-protocol-msgpack": "8.0.0",
"@ng-select/ng-select": "11.2.0",
"argon2": "0.31.2",
"argon2": "0.40.1",
"argon2-browser": "1.18.0",
"big-integer": "1.6.51",
"bootstrap": "4.6.0",