From db65d8a6422f6574b8cc2a88394695294cc202d2 Mon Sep 17 00:00:00 2001 From: Henry Tsai Date: Tue, 23 Jul 2024 18:49:20 -0700 Subject: [PATCH] Updated @noble/ciphers package dependency (#791) * Updated @noble/ciphers package dependency * More debugging and minor doc improvement --- .github/workflows/alpha-npm.yml | 6 ++++++ .github/workflows/release.yml | 6 ++++++ .github/workflows/tests-ci.yml | 12 +++++++++--- packages/agent/package.json | 2 +- .../src/prototyping/crypto/primitives/aes-gcm.ts | 2 +- .../src/prototyping/crypto/primitives/aes-kw.ts | 2 +- .../agent/src/prototyping/crypto/primitives/hkdf.ts | 2 +- .../src/prototyping/crypto/primitives/pbkdf2.ts | 2 +- packages/crypto/package.json | 2 +- packages/crypto/src/primitives/aes-ctr.ts | 2 +- packages/crypto/src/primitives/aes-gcm.ts | 2 +- packages/crypto/src/primitives/xchacha20-poly1305.ts | 2 +- packages/crypto/src/primitives/xchacha20.ts | 2 +- pnpm-lock.yaml | 8 ++++---- 14 files changed, 35 insertions(+), 17 deletions(-) diff --git a/.github/workflows/alpha-npm.yml b/.github/workflows/alpha-npm.yml index bc3820fff..1235f307c 100644 --- a/.github/workflows/alpha-npm.yml +++ b/.github/workflows/alpha-npm.yml @@ -44,6 +44,12 @@ jobs: NODE_AUTH_TOKEN: ${{secrets.npm_token}} run: pnpm whoami + - name: Print Node.js, npm, & pnpm versions for debugging if needed + run: | + node -v + npm -v + pnpm -v + - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 78e32ebe5..6dc99f90b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,6 +59,12 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: pnpm whoami + - name: Print Node.js, npm, & pnpm versions for debugging if needed + run: | + node -v + npm -v + pnpm -v + - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/tests-ci.yml b/.github/workflows/tests-ci.yml index d75877d7d..ea8c9ecd7 100644 --- a/.github/workflows/tests-ci.yml +++ b/.github/workflows/tests-ci.yml @@ -106,10 +106,16 @@ jobs: with: cache: "true" + - name: Print Node.js, npm, & pnpm versions for debugging if needed + run: | + node -v + npm -v + pnpm -v + - name: Install dependencies run: pnpm install --no-frozen-lockfile - - name: Get Playwright Version (for cache) + - name: Get Playwright version referenced by DIDs package (for cache) id: get-playwright-version run: | PLAYWRIGHT_VERSION=$(pnpm --filter dids ls @playwright/test | grep '@playwright/test' | awk 'NR==1{print $2}') @@ -123,11 +129,11 @@ jobs: path: ~/Library/Caches/ms-playwright key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} - - name: Install Playwright Browsers (if no cache) + - name: Install Playwright browsers referenced by DIDs package (if no cache) if: steps.cache-playwright-restore.outputs.cache-hit != 'true' run: pnpm --filter dids exec playwright install --with-deps - - name: Build esm + - name: Build ESM run: pnpm --recursive --stream build:esm - name: Build browser for matrix ${{ matrix.group }} diff --git a/packages/agent/package.json b/packages/agent/package.json index 7b8602f94..d1fa49b8d 100644 --- a/packages/agent/package.json +++ b/packages/agent/package.json @@ -69,7 +69,7 @@ "node": ">=18.0.0" }, "dependencies": { - "@noble/ciphers": "0.4.1", + "@noble/ciphers": "0.5.3", "@scure/bip39": "1.2.2", "@tbd54566975/dwn-sdk-js": "0.4.4", "@web5/common": "1.0.0", diff --git a/packages/agent/src/prototyping/crypto/primitives/aes-gcm.ts b/packages/agent/src/prototyping/crypto/primitives/aes-gcm.ts index e6fa352a6..6a643175a 100644 --- a/packages/agent/src/prototyping/crypto/primitives/aes-gcm.ts +++ b/packages/agent/src/prototyping/crypto/primitives/aes-gcm.ts @@ -1,5 +1,5 @@ import { Convert } from '@web5/common'; -import { getWebcryptoSubtle } from '@noble/ciphers/webcrypto/utils'; +import { getWebcryptoSubtle } from '@noble/ciphers/webcrypto'; import type { Jwk } from '@web5/crypto'; diff --git a/packages/agent/src/prototyping/crypto/primitives/aes-kw.ts b/packages/agent/src/prototyping/crypto/primitives/aes-kw.ts index cb7ad1607..b954ac622 100644 --- a/packages/agent/src/prototyping/crypto/primitives/aes-kw.ts +++ b/packages/agent/src/prototyping/crypto/primitives/aes-kw.ts @@ -1,5 +1,5 @@ // ! TODO : Make sure I remove `@noble/ciphers` from the Agent package.json once this is moved to the `@web5/crypto` package. -import { getWebcryptoSubtle } from '@noble/ciphers/webcrypto/utils'; +import { getWebcryptoSubtle } from '@noble/ciphers/webcrypto'; import type { Jwk } from '@web5/crypto'; diff --git a/packages/agent/src/prototyping/crypto/primitives/hkdf.ts b/packages/agent/src/prototyping/crypto/primitives/hkdf.ts index a134b0128..aa8facf57 100644 --- a/packages/agent/src/prototyping/crypto/primitives/hkdf.ts +++ b/packages/agent/src/prototyping/crypto/primitives/hkdf.ts @@ -1,5 +1,5 @@ // ! TODO : Make sure I remove `@noble/ciphers` from the Agent package.json once this is moved to the `@web5/crypto` package. -import { getWebcryptoSubtle } from '@noble/ciphers/webcrypto/utils'; +import { getWebcryptoSubtle } from '@noble/ciphers/webcrypto'; import { Convert } from '@web5/common'; import { DeriveKeyBytesParams } from '../types/params-direct.js'; diff --git a/packages/agent/src/prototyping/crypto/primitives/pbkdf2.ts b/packages/agent/src/prototyping/crypto/primitives/pbkdf2.ts index b32366c7b..d4d6691a5 100644 --- a/packages/agent/src/prototyping/crypto/primitives/pbkdf2.ts +++ b/packages/agent/src/prototyping/crypto/primitives/pbkdf2.ts @@ -1,5 +1,5 @@ // ! TODO : Make sure I remove `@noble/ciphers` from the Agent package.json once this is moved to the `@web5/crypto` package. -import { getWebcryptoSubtle } from '@noble/ciphers/webcrypto/utils'; +import { getWebcryptoSubtle } from '@noble/ciphers/webcrypto'; import type { DeriveKeyBytesParams } from '../types/params-direct.js'; diff --git a/packages/crypto/package.json b/packages/crypto/package.json index 929ae3fd8..12d84a692 100644 --- a/packages/crypto/package.json +++ b/packages/crypto/package.json @@ -75,7 +75,7 @@ "node": ">=18.0.0" }, "dependencies": { - "@noble/ciphers": "0.4.1", + "@noble/ciphers": "0.5.3", "@noble/curves": "1.3.0", "@noble/hashes": "1.4.0", "@web5/common": "1.0.1" diff --git a/packages/crypto/src/primitives/aes-ctr.ts b/packages/crypto/src/primitives/aes-ctr.ts index 6e9bd2634..77f450e4b 100644 --- a/packages/crypto/src/primitives/aes-ctr.ts +++ b/packages/crypto/src/primitives/aes-ctr.ts @@ -1,5 +1,5 @@ import { Convert } from '@web5/common'; -import { getWebcryptoSubtle } from '@noble/ciphers/webcrypto/utils'; +import { getWebcryptoSubtle } from '@noble/ciphers/crypto'; import type { Jwk } from '../jose/jwk.js'; diff --git a/packages/crypto/src/primitives/aes-gcm.ts b/packages/crypto/src/primitives/aes-gcm.ts index b9e484bd7..9f83a30eb 100644 --- a/packages/crypto/src/primitives/aes-gcm.ts +++ b/packages/crypto/src/primitives/aes-gcm.ts @@ -1,5 +1,5 @@ import { Convert } from '@web5/common'; -import { getWebcryptoSubtle } from '@noble/ciphers/webcrypto/utils'; +import { getWebcryptoSubtle } from '@noble/ciphers/webcrypto'; import type { Jwk } from '../jose/jwk.js'; diff --git a/packages/crypto/src/primitives/xchacha20-poly1305.ts b/packages/crypto/src/primitives/xchacha20-poly1305.ts index 4eea6d177..15bb9b0c0 100644 --- a/packages/crypto/src/primitives/xchacha20-poly1305.ts +++ b/packages/crypto/src/primitives/xchacha20-poly1305.ts @@ -1,6 +1,6 @@ import { Convert } from '@web5/common'; import { xchacha20poly1305 } from '@noble/ciphers/chacha'; -import { getWebcryptoSubtle } from '@noble/ciphers/webcrypto/utils'; +import { getWebcryptoSubtle } from '@noble/ciphers/webcrypto'; import type { Jwk } from '../jose/jwk.js'; diff --git a/packages/crypto/src/primitives/xchacha20.ts b/packages/crypto/src/primitives/xchacha20.ts index 49a38909f..de13807d6 100644 --- a/packages/crypto/src/primitives/xchacha20.ts +++ b/packages/crypto/src/primitives/xchacha20.ts @@ -1,6 +1,6 @@ import { Convert } from '@web5/common'; import { xchacha20 } from '@noble/ciphers/chacha'; -import { getWebcryptoSubtle } from '@noble/ciphers/webcrypto/utils'; +import { getWebcryptoSubtle } from '@noble/ciphers/webcrypto'; import type { Jwk } from '../jose/jwk.js'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dc2fe4c3b..cbccbcb16 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,8 +40,8 @@ importers: packages/agent: dependencies: '@noble/ciphers': - specifier: 0.4.1 - version: 0.4.1 + specifier: 0.5.3 + version: 0.5.3 '@scure/bip39': specifier: 1.2.2 version: 1.2.2 @@ -425,8 +425,8 @@ importers: packages/crypto: dependencies: '@noble/ciphers': - specifier: 0.4.1 - version: 0.4.1 + specifier: 0.5.3 + version: 0.5.3 '@noble/curves': specifier: 1.3.0 version: 1.3.0