From be9d8360b21a9104fc85415a46901a538221e430 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Mon, 29 Jul 2024 12:55:28 +0200 Subject: [PATCH] fix: use one-webcrypto from npm --- packages/access-client/package.json | 8 ++--- packages/access-client/src/crypto/aes-key.js | 2 +- packages/access-client/src/crypto/encoding.js | 2 +- .../access-client/src/crypto/p256-ecdh.js | 2 +- packages/blob-index/package.json | 2 +- packages/blob-index/test/helpers/random.js | 2 +- packages/filecoin-api/package.json | 2 +- packages/filecoin-api/test/utils.js | 2 +- packages/upload-api/package.json | 2 +- packages/upload-api/test/util.js | 2 +- pnpm-lock.yaml | 35 +++++++++---------- 11 files changed, 30 insertions(+), 31 deletions(-) diff --git a/packages/access-client/package.json b/packages/access-client/package.json index 8e6d1cc23..ddb47b3d6 100644 --- a/packages/access-client/package.json +++ b/packages/access-client/package.json @@ -99,6 +99,8 @@ "dependencies": { "@ipld/car": "^5.1.1", "@ipld/dag-ucan": "^3.4.0", + "@scure/bip39": "^1.2.1", + "@storacha/one-webcrypto": "^1.0.1", "@ucanto/client": "^9.0.1", "@ucanto/core": "^10.0.1", "@ucanto/interface": "^10.0.1", @@ -110,14 +112,11 @@ "bigint-mod-arith": "^3.1.2", "conf": "11.0.2", "multiformats": "^12.1.2", - "one-webcrypto": "https://github.com/web3-storage/one-webcrypto", "p-defer": "^4.0.0", "type-fest": "^4.9.0", - "uint8arrays": "^4.0.6", - "@scure/bip39": "^1.2.1" + "uint8arrays": "^4.0.6" }, "devDependencies": { - "@web3-storage/eslint-config-w3up": "workspace:^", "@types/assert": "^1.5.6", "@types/inquirer": "^9.0.4", "@types/mocha": "^10.0.1", @@ -126,6 +125,7 @@ "@types/varint": "^6.0.1", "@types/ws": "^8.5.4", "@ucanto/server": "^10.0.0", + "@web3-storage/eslint-config-w3up": "workspace:^", "assert": "^2.0.0", "mocha": "^10.2.0", "playwright-test": "^12.3.4", diff --git a/packages/access-client/src/crypto/aes-key.js b/packages/access-client/src/crypto/aes-key.js index 76a86ab57..3d41d3f95 100644 --- a/packages/access-client/src/crypto/aes-key.js +++ b/packages/access-client/src/crypto/aes-key.js @@ -1,4 +1,4 @@ -import { webcrypto } from 'one-webcrypto' +import { webcrypto } from '@storacha/one-webcrypto' import * as uint8arrays from 'uint8arrays' import { randomIV } from './encoding.js' diff --git a/packages/access-client/src/crypto/encoding.js b/packages/access-client/src/crypto/encoding.js index 6f325b79c..9159754ff 100644 --- a/packages/access-client/src/crypto/encoding.js +++ b/packages/access-client/src/crypto/encoding.js @@ -1,4 +1,4 @@ -import { webcrypto } from 'one-webcrypto' +import { webcrypto } from '@storacha/one-webcrypto' import * as uint8arrays from 'uint8arrays' import * as bigintModArith from 'bigint-mod-arith' diff --git a/packages/access-client/src/crypto/p256-ecdh.js b/packages/access-client/src/crypto/p256-ecdh.js index 23071bb23..e1891bee2 100644 --- a/packages/access-client/src/crypto/p256-ecdh.js +++ b/packages/access-client/src/crypto/p256-ecdh.js @@ -1,4 +1,4 @@ -import { webcrypto } from 'one-webcrypto' +import { webcrypto } from '@storacha/one-webcrypto' import * as uint8arrays from 'uint8arrays' import * as DID from '@ipld/dag-ucan/did' import { AesKey } from './aes-key.js' diff --git a/packages/blob-index/package.json b/packages/blob-index/package.json index 9a7bd2da6..45435fc08 100644 --- a/packages/blob-index/package.json +++ b/packages/blob-index/package.json @@ -40,6 +40,7 @@ }, "dependencies": { "@ipld/dag-cbor": "^9.0.6", + "@storacha/one-webcrypto": "^1.0.1", "@ucanto/core": "^10.0.1", "@ucanto/interface": "^10.0.1", "@web3-storage/capabilities": "workspace:^", @@ -52,7 +53,6 @@ "@web3-storage/eslint-config-w3up": "workspace:^", "c8": "^7.14.0", "entail": "^2.1.2", - "one-webcrypto": "git://github.com/web3-storage/one-webcrypto", "typescript": "5.2.2" }, "eslintConfig": { diff --git a/packages/blob-index/test/helpers/random.js b/packages/blob-index/test/helpers/random.js index c1684349c..3d2fea4aa 100644 --- a/packages/blob-index/test/helpers/random.js +++ b/packages/blob-index/test/helpers/random.js @@ -3,7 +3,7 @@ import { CID } from 'multiformats' import { sha256 } from 'multiformats/hashes/sha2' import * as CAR from '@ucanto/transport/car' import * as raw from 'multiformats/codecs/raw' -import { webcrypto } from 'one-webcrypto' +import { webcrypto } from '@storacha/one-webcrypto' /** @param {number} size */ export async function randomBytes(size) { diff --git a/packages/filecoin-api/package.json b/packages/filecoin-api/package.json index 95439ecc7..597bd594d 100644 --- a/packages/filecoin-api/package.json +++ b/packages/filecoin-api/package.json @@ -166,6 +166,7 @@ "p-map": "^6.0.0" }, "devDependencies": { + "@storacha/one-webcrypto": "^1.0.1", "@types/assert": "^1.5.10", "@types/mocha": "^10.0.1", "@ucanto/client": "^9.0.1", @@ -176,7 +177,6 @@ "c8": "^10.1.2", "mocha": "^10.2.0", "multiformats": "^12.1.2", - "one-webcrypto": "git://github.com/web3-storage/one-webcrypto", "p-wait-for": "^5.0.2", "typescript": "5.2.2" }, diff --git a/packages/filecoin-api/test/utils.js b/packages/filecoin-api/test/utils.js index fd0e7bebf..93eb82862 100644 --- a/packages/filecoin-api/test/utils.js +++ b/packages/filecoin-api/test/utils.js @@ -1,6 +1,6 @@ import { Aggregate, Piece } from '@web3-storage/data-segment' import { CID } from 'multiformats' -import { webcrypto } from 'one-webcrypto' +import { webcrypto } from '@storacha/one-webcrypto' import { sha256 } from 'multiformats/hashes/sha2' import * as raw from 'multiformats/codecs/raw' diff --git a/packages/upload-api/package.json b/packages/upload-api/package.json index e188ee585..89f0d0905 100644 --- a/packages/upload-api/package.json +++ b/packages/upload-api/package.json @@ -210,6 +210,7 @@ "devDependencies": { "@ipld/car": "^5.1.1", "@ipld/dag-ucan": "^3.4.0", + "@storacha/one-webcrypto": "^1.0.1", "@types/mocha": "^10.0.1", "@ucanto/core": "^10.0.1", "@web-std/blob": "^3.0.5", @@ -218,7 +219,6 @@ "@web3-storage/sigv4": "^1.0.2", "is-subset": "^0.1.1", "mocha": "^10.2.0", - "one-webcrypto": "git://github.com/web3-storage/one-webcrypto", "typescript": "5.2.2" }, "eslintConfig": { diff --git a/packages/upload-api/test/util.js b/packages/upload-api/test/util.js index c2c860cb4..44c47a2cd 100644 --- a/packages/upload-api/test/util.js +++ b/packages/upload-api/test/util.js @@ -3,7 +3,7 @@ import { createServer, connect } from '../src/lib.js' import { ed25519 } from '@ucanto/principal' import { delegate } from '@ucanto/core' import { CID } from 'multiformats' -import { webcrypto } from 'one-webcrypto' +import { webcrypto } from '@storacha/one-webcrypto' import { sha256 } from 'multiformats/hashes/sha2' import * as CAR from '@ucanto/transport/car' import * as raw from 'multiformats/codecs/raw' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ab2278f0..a4c1f0367 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,6 +57,9 @@ importers: '@scure/bip39': specifier: ^1.2.1 version: 1.3.0 + '@storacha/one-webcrypto': + specifier: ^1.0.1 + version: 1.0.1 '@ucanto/client': specifier: ^9.0.1 version: 9.0.1 @@ -90,9 +93,6 @@ importers: multiformats: specifier: ^12.1.2 version: 12.1.3 - one-webcrypto: - specifier: https://github.com/web3-storage/one-webcrypto - version: https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/5148cd14d5489a8ac4cd38223870e02db15a2382 p-defer: specifier: ^4.0.0 version: 4.0.1 @@ -154,6 +154,9 @@ importers: '@ipld/dag-cbor': specifier: ^9.0.6 version: 9.2.0 + '@storacha/one-webcrypto': + specifier: ^1.0.1 + version: 1.0.1 '@ucanto/core': specifier: ^10.0.1 version: 10.0.1 @@ -185,9 +188,6 @@ importers: entail: specifier: ^2.1.2 version: 2.1.2 - one-webcrypto: - specifier: git://github.com/web3-storage/one-webcrypto - version: https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/5148cd14d5489a8ac4cd38223870e02db15a2382 typescript: specifier: 5.2.2 version: 5.2.2 @@ -316,6 +316,9 @@ importers: specifier: ^6.0.0 version: 6.0.0 devDependencies: + '@storacha/one-webcrypto': + specifier: ^1.0.1 + version: 1.0.1 '@types/assert': specifier: ^1.5.10 version: 1.5.10 @@ -343,9 +346,6 @@ importers: multiformats: specifier: ^12.1.2 version: 12.1.3 - one-webcrypto: - specifier: git://github.com/web3-storage/one-webcrypto - version: https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/5148cd14d5489a8ac4cd38223870e02db15a2382 p-wait-for: specifier: ^5.0.2 version: 5.0.2 @@ -471,6 +471,9 @@ importers: '@ipld/dag-ucan': specifier: ^3.4.0 version: 3.4.0 + '@storacha/one-webcrypto': + specifier: ^1.0.1 + version: 1.0.1 '@types/mocha': specifier: ^10.0.1 version: 10.0.6 @@ -492,9 +495,6 @@ importers: mocha: specifier: ^10.2.0 version: 10.4.0 - one-webcrypto: - specifier: git://github.com/web3-storage/one-webcrypto - version: https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/5148cd14d5489a8ac4cd38223870e02db15a2382 typescript: specifier: 5.2.2 version: 5.2.2 @@ -1987,6 +1987,9 @@ packages: '@slorber/remark-comment@1.0.0': resolution: {integrity: sha512-RCE24n7jsOj1M0UPvIQCHTe7fI0sFL4S2nwKVWwHyVr/wI/H8GosgsJGyhnsZoGFnD/P2hLf1mSbrrgSLN93NA==} + '@storacha/one-webcrypto@1.0.1': + resolution: {integrity: sha512-bD+vWmcgsEBqU0Dz04BR43SA03bBoLTAY29vaKasY9Oe8cb6XIP0/vkm0OS2UwKC13c8uRgFW4rjJUgDCNLejQ==} + '@svgr/babel-plugin-add-jsx-attribute@8.0.0': resolution: {integrity: sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g==} engines: {node: '>=14'} @@ -5236,10 +5239,6 @@ packages: one-webcrypto@1.0.3: resolution: {integrity: sha512-fu9ywBVBPx0gS9K0etIROTiCkvI5S1TDjFsYFb3rC1ewFxeOqsbzq7aIMBHsYfrTHBcGXJaONXXjTl8B01cW1Q==} - one-webcrypto@https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/5148cd14d5489a8ac4cd38223870e02db15a2382: - resolution: {tarball: https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/5148cd14d5489a8ac4cd38223870e02db15a2382} - version: 1.0.3 - onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} @@ -9010,6 +9009,8 @@ snapshots: micromark-util-character: 1.2.0 micromark-util-symbol: 1.1.0 + '@storacha/one-webcrypto@1.0.1': {} + '@svgr/babel-plugin-add-jsx-attribute@8.0.0(@babel/core@7.24.5)': dependencies: '@babel/core': 7.24.5 @@ -13079,8 +13080,6 @@ snapshots: one-webcrypto@1.0.3: {} - one-webcrypto@https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/5148cd14d5489a8ac4cd38223870e02db15a2382: {} - onetime@5.1.2: dependencies: mimic-fn: 2.1.0