@le-space/orbitdb-identity-provider-webauthn-did 0.2.13 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -39,7 +39,7 @@ Note: WebAuthn varsig support in this repo relies on our forked `@le-space/iso-*
39
39
  npm install @le-space/orbitdb-identity-provider-webauthn-did
40
40
  ```
41
41
 
42
- Note: `@orbitdb/core` is patched (via `patch-package`) to support Ed25519 keystore keys.
42
+ Note: Ed25519 keystore DIDs are handled without patching OrbitDB. The provider generates the requested libp2p key type and stores it through OrbitDB's public keystore API.
43
43
 
44
44
  ## WebAuthn Configuration
45
45
 
@@ -186,7 +186,7 @@ sequenceDiagram
186
186
  Auth-->>WebAuthn: Attestation
187
187
  WebAuthn-->>App: Credential
188
188
 
189
- App->>KS: getKey()/createKey(Ed25519)
189
+ App->>KS: getKey() or add generated Ed25519 key
190
190
  KS-->>App: Keystore keypair
191
191
 
192
192
  opt encryptKeystore=true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@le-space/orbitdb-identity-provider-webauthn-did",
3
- "version": "0.2.13",
3
+ "version": "0.3.0",
4
4
  "description": "WebAuthn-based DID identity provider for OrbitDB for hardware-secured wallets and biometric Passkey authentication",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -10,7 +10,6 @@
10
10
  "./standalone": "./src/standalone/index.js"
11
11
  },
12
12
  "scripts": {
13
- "postinstall": "patch-package",
14
13
  "test": "npm run test:all",
15
14
  "test:all": "playwright test",
16
15
  "test:headed": "playwright test tests/webauthn-focused.test.js --headed --project=chromium",
@@ -59,14 +58,14 @@
59
58
  },
60
59
  "homepage": "https://github.com/le-space/orbitdb-identity-provider-webauthn-did#readme",
61
60
  "peerDependencies": {
62
- "@orbitdb/core": "^3.0.0"
61
+ "@orbitdb/core": "^4.0.0"
63
62
  },
64
63
  "dependencies": {
65
64
  "@ipld/dag-ucan": "^3.4.3",
66
- "@ipld/dag-cbor": "^9.2.5",
65
+ "@ipld/dag-cbor": "^10.0.1",
67
66
  "@le-space/ucanto-principal": "^9.1.2",
68
- "@libp2p/logger": "^5.1.5",
69
- "@libp2p/crypto": "^5.1.8",
67
+ "@libp2p/logger": "^6.2.9",
68
+ "@libp2p/crypto": "^5.1.20",
70
69
  "@simplewebauthn/browser": "^13.0.0",
71
70
  "cbor-web": "^9.0.1",
72
71
  "iso-base": "npm:@le-space/iso-base",
@@ -74,17 +73,28 @@
74
73
  "iso-passkeys": "npm:@le-space/iso-passkeys",
75
74
  "iso-web": "^2.1.0",
76
75
  "iso-webauthn-varsig": "npm:@le-space/iso-webauthn-varsig",
77
- "multiformats": "^13.0.0",
78
- "patch-package": "^8.0.1",
76
+ "multiformats": "^14.0.0",
79
77
  "vite-plugin-node-polyfills": "^0.24.0"
80
78
  },
81
79
  "devDependencies": {
82
- "@orbitdb/core": "^3.0.0",
80
+ "@chainsafe/libp2p-noise": "^17.0.0",
81
+ "@chainsafe/libp2p-yamux": "^8.0.1",
82
+ "@helia/bitswap": "^4.0.1",
83
+ "@helia/http": "^4.0.1",
84
+ "@helia/libp2p": "^1.0.1",
85
+ "@ipld/dag-json": "^11.0.0",
86
+ "@libp2p/gossipsub": "^16.0.3",
87
+ "@libp2p/identify": "^4.1.8",
88
+ "@libp2p/websockets": "^10.1.15",
89
+ "@orbitdb/core": "^4.0.0",
90
+ "@orbitdb/simple-encryption": "^0.0.2",
83
91
  "@playwright/test": "^1.55.0",
92
+ "blockstore-level": "^4.0.1",
84
93
  "chai": "^5.0.0",
94
+ "datastore-level": "^13.0.1",
85
95
  "eslint": "^9.0.0",
86
- "helia": "^5.0.0",
87
- "libp2p": "^2.0.0",
96
+ "helia": "^7.0.1",
97
+ "libp2p": "^3.3.4",
88
98
  "mocha": "^10.0.0"
89
99
  },
90
100
  "engines": {
@@ -4,6 +4,8 @@
4
4
 
5
5
  import { logger } from '@libp2p/logger';
6
6
  import { generateKeyPair } from '@libp2p/crypto/keys';
7
+ import { varint } from 'multiformats';
8
+ import { base58btc } from 'multiformats/bases/base58';
7
9
  import * as KeystoreEncryption from './encryption.js';
8
10
  import { WebAuthnDIDProvider } from '../webauthn/provider.js';
9
11
 
@@ -119,11 +121,6 @@ export class OrbitDBWebAuthnIdentityProvider {
119
121
  }
120
122
 
121
123
  try {
122
- // Import multiformats modules
123
- const multiformats = await import('multiformats');
124
- const varint = multiformats.varint;
125
- const { base58btc } = await import('multiformats/bases/base58');
126
-
127
124
  if (this.encryptKeystore) {
128
125
  const encryptedData = this.unlockedKeypair
129
126
  ? {
@@ -157,10 +154,12 @@ export class OrbitDBWebAuthnIdentityProvider {
157
154
  identityId.substring(0, 32) + '...',
158
155
  this.keystoreKeyType
159
156
  );
160
- keystoreKey = await this.keystore.createKey(
161
- identityId,
162
- this.keystoreKeyType
163
- );
157
+ const keyType =
158
+ this.keystoreKeyType === 'secp256k1' ? 'secp256k1' : 'Ed25519';
159
+ keystoreKey = await generateKeyPair(keyType);
160
+ await this.keystore.addKey(identityId, {
161
+ privateKey: keystoreKey.raw,
162
+ });
164
163
  }
165
164
 
166
165
  identityLog(
@@ -6,6 +6,8 @@
6
6
  */
7
7
 
8
8
  import { logger } from '@libp2p/logger';
9
+ import { varint } from 'multiformats';
10
+ import { base58btc } from 'multiformats/bases/base58';
9
11
  import * as KeystoreEncryption from '../keystore/encryption.js';
10
12
  import {
11
13
  buildAuthenticatorSelection,
@@ -341,11 +343,6 @@ export class WebAuthnDIDProvider {
341
343
  */
342
344
  static async createDID(credentialInfo) {
343
345
  try {
344
- // Import multiformats modules with correct exports
345
- const multiformats = await import('multiformats');
346
- const varint = multiformats.varint;
347
- const { base58btc } = await import('multiformats/bases/base58');
348
-
349
346
  // Extract public key coordinates
350
347
  const { x, y } = credentialInfo.publicKey;
351
348