From 018d90cbcbfada4df3d3f9c545af4bbe59f07f8a Mon Sep 17 00:00:00 2001 From: Victor Anene Date: Mon, 27 Feb 2023 12:36:44 +0100 Subject: [PATCH 01/23] feat: configure indy-vdr optional peer dependencies work funded by the Government of Ontario Signed-off-by: Victor Anene --- packages/indy-vdr/src/IndyVdrModuleConfig.ts | 39 ++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/packages/indy-vdr/src/IndyVdrModuleConfig.ts b/packages/indy-vdr/src/IndyVdrModuleConfig.ts index 6b6b2eaddb..e4dce9528e 100644 --- a/packages/indy-vdr/src/IndyVdrModuleConfig.ts +++ b/packages/indy-vdr/src/IndyVdrModuleConfig.ts @@ -1,6 +1,45 @@ import type { IndyVdrPoolConfig } from './pool' +import type { IndyVdr } from '@hyperledger/indy-vdr-shared' export interface IndyVdrModuleConfigOptions { + + /** + * + * ## Node.JS + * + * ```ts + * import * as indyVdr from '@hyperledger/indy-vdr-nodejs'; + * + * const agent = new Agent({ + * config: {}, + * dependencies: agentDependencies, + * modules: { + * indyVdr: new IndyVdrModule({ + * indyVdr, + * }) + * } + * }) + * ``` + * + * ## React Native + * + * ```ts + * import * as indyVdr from '@hyperledger/indy-vdr-react-native'; + * + * const agent = new Agent({ + * config: {}, + * dependencies: agentDependencies, + * modules: { + * indyVdr: new IndyVdrModule({ + * indyVdr, + * }) + * } + * }) + * ``` + * ``` + */ + indyVdr: IndyVdr + /** * Array of indy networks to connect to. * From fc8d7bfeafd239929be9300e1bdd5023a7684477 Mon Sep 17 00:00:00 2001 From: Victor Anene Date: Mon, 27 Feb 2023 17:11:05 +0100 Subject: [PATCH 02/23] feat(indy-vdr): add indyVdr argument to new IndyVdrModule instances work funded by the Government of Ontario Signed-off-by: Victor Anene --- demo/package.json | 3 +++ demo/src/BaseAgent.ts | 2 ++ packages/anoncreds/package.json | 1 + .../anoncreds/tests/legacyAnonCredsSetup.ts | 2 ++ packages/indy-vdr/src/IndyVdrModuleConfig.ts | 23 +++++++++---------- .../src/__tests__/IndyVdrModule.test.ts | 3 +++ .../src/__tests__/IndyVdrModuleConfig.test.ts | 3 +++ packages/indy-vdr/tests/helpers.ts | 3 ++- 8 files changed, 27 insertions(+), 13 deletions(-) diff --git a/demo/package.json b/demo/package.json index 247a4513cd..6d7d0be8cd 100644 --- a/demo/package.json +++ b/demo/package.json @@ -13,6 +13,9 @@ "faber": "ts-node src/FaberInquirer.ts", "refresh": "rm -rf ./node_modules ./yarn.lock && yarn" }, + "dependencies": { + "@hyperledger/indy-vdr-nodejs": "^0.1.0-dev.6" + }, "devDependencies": { "@aries-framework/anoncreds": "*", "@aries-framework/anoncreds-rs": "*", diff --git a/demo/src/BaseAgent.ts b/demo/src/BaseAgent.ts index f06d0016fe..04d6cf4121 100644 --- a/demo/src/BaseAgent.ts +++ b/demo/src/BaseAgent.ts @@ -25,6 +25,7 @@ import { import { IndySdkAnonCredsRegistry, IndySdkModule, IndySdkSovDidResolver } from '@aries-framework/indy-sdk' import { IndyVdrAnonCredsRegistry, IndyVdrModule, IndyVdrSovDidResolver } from '@aries-framework/indy-vdr' import { agentDependencies, HttpInboundTransport } from '@aries-framework/node' +import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { randomUUID } from 'crypto' import indySdk from 'indy-sdk' @@ -127,6 +128,7 @@ function getAskarAnonCredsIndyModules() { }), anoncredsRs: new AnonCredsRsModule(), indyVdr: new IndyVdrModule({ + indyVdr, networks: [indyNetworkConfig], }), dids: new DidsModule({ diff --git a/packages/anoncreds/package.json b/packages/anoncreds/package.json index ed2353d6db..88b8453958 100644 --- a/packages/anoncreds/package.json +++ b/packages/anoncreds/package.json @@ -31,6 +31,7 @@ }, "devDependencies": { "@aries-framework/node": "0.3.3", + "@hyperledger/indy-vdr-shared": "^0.1.0-dev.6", "indy-sdk": "^1.16.0-dev-1636", "rimraf": "^4.0.7", "rxjs": "^7.8.0", diff --git a/packages/anoncreds/tests/legacyAnonCredsSetup.ts b/packages/anoncreds/tests/legacyAnonCredsSetup.ts index 32a876fd1a..72465152e4 100644 --- a/packages/anoncreds/tests/legacyAnonCredsSetup.ts +++ b/packages/anoncreds/tests/legacyAnonCredsSetup.ts @@ -27,6 +27,7 @@ import { V2ProofProtocol, DidsModule, } from '@aries-framework/core' +import { indyVdr } from '@hyperledger/indy-vdr-shared' import { randomUUID } from 'crypto' import { AnonCredsRsModule } from '../../anoncreds-rs/src' @@ -153,6 +154,7 @@ export const getAskarAnonCredsIndyModules = ({ }), anoncredsRs: new AnonCredsRsModule(), indyVdr: new IndyVdrModule({ + indyVdr, networks: [indyNetworkConfig], }), dids: new DidsModule({ diff --git a/packages/indy-vdr/src/IndyVdrModuleConfig.ts b/packages/indy-vdr/src/IndyVdrModuleConfig.ts index e4dce9528e..42abfe2c0e 100644 --- a/packages/indy-vdr/src/IndyVdrModuleConfig.ts +++ b/packages/indy-vdr/src/IndyVdrModuleConfig.ts @@ -2,43 +2,42 @@ import type { IndyVdrPoolConfig } from './pool' import type { IndyVdr } from '@hyperledger/indy-vdr-shared' export interface IndyVdrModuleConfigOptions { - - /** + /** * * ## Node.JS * * ```ts - * import * as indyVdr from '@hyperledger/indy-vdr-nodejs'; - * + * import { indyVdr } from '@hyperledger/indy-vdr-nodejs'; + * * const agent = new Agent({ * config: {}, * dependencies: agentDependencies, * modules: { * indyVdr: new IndyVdrModule({ * indyVdr, - * }) + * }) * } - * }) + * }) * ``` * - * ## React Native + * ## React Nativeß * * ```ts - * import * as indyVdr from '@hyperledger/indy-vdr-react-native'; - * + * import { indyVdr } from '@hyperledger/indy-vdr-nodejs'; + * * const agent = new Agent({ * config: {}, * dependencies: agentDependencies, * modules: { * indyVdr: new IndyVdrModule({ * indyVdr, - * }) + * }) * } - * }) + * }) * ``` * ``` */ - indyVdr: IndyVdr + indyVdr: IndyVdr /** * Array of indy networks to connect to. diff --git a/packages/indy-vdr/src/__tests__/IndyVdrModule.test.ts b/packages/indy-vdr/src/__tests__/IndyVdrModule.test.ts index 4d904fa133..870ce48746 100644 --- a/packages/indy-vdr/src/__tests__/IndyVdrModule.test.ts +++ b/packages/indy-vdr/src/__tests__/IndyVdrModule.test.ts @@ -1,5 +1,7 @@ import type { DependencyManager } from '@aries-framework/core' +import { indyVdr } from '@hyperledger/indy-vdr-shared' + import { IndyVdrModule } from '../IndyVdrModule' import { IndyVdrModuleConfig } from '../IndyVdrModuleConfig' import { IndyVdrPoolService } from '../pool' @@ -12,6 +14,7 @@ const dependencyManager = { describe('IndyVdrModule', () => { test('registers dependencies on the dependency manager', () => { const indyVdrModule = new IndyVdrModule({ + indyVdr, networks: [ { isProduction: false, diff --git a/packages/indy-vdr/src/__tests__/IndyVdrModuleConfig.test.ts b/packages/indy-vdr/src/__tests__/IndyVdrModuleConfig.test.ts index db86ddb519..7f3c94aac5 100644 --- a/packages/indy-vdr/src/__tests__/IndyVdrModuleConfig.test.ts +++ b/packages/indy-vdr/src/__tests__/IndyVdrModuleConfig.test.ts @@ -1,5 +1,7 @@ import type { IndyVdrPoolConfig } from '../pool' +import { indyVdr } from '@hyperledger/indy-vdr-shared' + import { IndyVdrModuleConfig } from '../IndyVdrModuleConfig' describe('IndyVdrModuleConfig', () => { @@ -7,6 +9,7 @@ describe('IndyVdrModuleConfig', () => { const networkConfig = {} as IndyVdrPoolConfig const config = new IndyVdrModuleConfig({ + indyVdr, networks: [networkConfig], }) diff --git a/packages/indy-vdr/tests/helpers.ts b/packages/indy-vdr/tests/helpers.ts index ecaf154ee9..5a999c9009 100644 --- a/packages/indy-vdr/tests/helpers.ts +++ b/packages/indy-vdr/tests/helpers.ts @@ -2,13 +2,14 @@ import type { IndyVdrPoolService } from '../src/pool/IndyVdrPoolService' import type { AgentContext, Key } from '@aries-framework/core' import { KeyType } from '@aries-framework/core' -import { AttribRequest, NymRequest } from '@hyperledger/indy-vdr-shared' +import { AttribRequest, NymRequest, indyVdr } from '@hyperledger/indy-vdr-shared' import { genesisTransactions } from '../../core/tests/helpers' import { IndyVdrModuleConfig } from '../src/IndyVdrModuleConfig' import { indyDidFromPublicKeyBase58 } from '../src/utils/did' export const indyVdrModuleConfig = new IndyVdrModuleConfig({ + indyVdr, networks: [ { genesisTransactions, From e7175484968ef92f1131363c6c867652dd0c0a25 Mon Sep 17 00:00:00 2001 From: Victor Anene Date: Tue, 28 Feb 2023 10:03:38 +0100 Subject: [PATCH 03/23] fix: PR review work funded by the Government of Ontario Signed-off-by: Victor Anene --- packages/indy-vdr/src/IndyVdrModuleConfig.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/indy-vdr/src/IndyVdrModuleConfig.ts b/packages/indy-vdr/src/IndyVdrModuleConfig.ts index 42abfe2c0e..0f07324c81 100644 --- a/packages/indy-vdr/src/IndyVdrModuleConfig.ts +++ b/packages/indy-vdr/src/IndyVdrModuleConfig.ts @@ -20,10 +20,10 @@ export interface IndyVdrModuleConfigOptions { * }) * ``` * - * ## React Nativeß + * ## React Native * * ```ts - * import { indyVdr } from '@hyperledger/indy-vdr-nodejs'; + * import { indyVdr } from '@hyperledger/indy-vdr-react-native'; * * const agent = new Agent({ * config: {}, @@ -35,7 +35,6 @@ export interface IndyVdrModuleConfigOptions { * } * }) * ``` - * ``` */ indyVdr: IndyVdr From 198a59afee9aa7cecaa856899856c0f60eb936a7 Mon Sep 17 00:00:00 2001 From: Victor Anene Date: Tue, 28 Feb 2023 11:17:41 +0100 Subject: [PATCH 04/23] fix: resolve PR review work funded by the Government of Ontario Signed-off-by: Victor Anene --- packages/indy-vdr/tests/helpers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/indy-vdr/tests/helpers.ts b/packages/indy-vdr/tests/helpers.ts index 5a999c9009..b1c87f18aa 100644 --- a/packages/indy-vdr/tests/helpers.ts +++ b/packages/indy-vdr/tests/helpers.ts @@ -2,7 +2,8 @@ import type { IndyVdrPoolService } from '../src/pool/IndyVdrPoolService' import type { AgentContext, Key } from '@aries-framework/core' import { KeyType } from '@aries-framework/core' -import { AttribRequest, NymRequest, indyVdr } from '@hyperledger/indy-vdr-shared' +import { AttribRequest, NymRequest } from '@hyperledger/indy-vdr-shared' +import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { genesisTransactions } from '../../core/tests/helpers' import { IndyVdrModuleConfig } from '../src/IndyVdrModuleConfig' From 7b56f68e5a5f6aa406d3e445a5412facc95ba7f3 Mon Sep 17 00:00:00 2001 From: Victor Anene Date: Tue, 28 Feb 2023 12:37:21 +0100 Subject: [PATCH 05/23] fix: resolve PR review work funded by the Government of Ontario Signed-off-by: Victor Anene --- packages/indy-vdr/tests/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/indy-vdr/tests/helpers.ts b/packages/indy-vdr/tests/helpers.ts index b1c87f18aa..048553e20c 100644 --- a/packages/indy-vdr/tests/helpers.ts +++ b/packages/indy-vdr/tests/helpers.ts @@ -2,8 +2,8 @@ import type { IndyVdrPoolService } from '../src/pool/IndyVdrPoolService' import type { AgentContext, Key } from '@aries-framework/core' import { KeyType } from '@aries-framework/core' -import { AttribRequest, NymRequest } from '@hyperledger/indy-vdr-shared' import { indyVdr } from '@hyperledger/indy-vdr-nodejs' +import { AttribRequest, NymRequest } from '@hyperledger/indy-vdr-shared' import { genesisTransactions } from '../../core/tests/helpers' import { IndyVdrModuleConfig } from '../src/IndyVdrModuleConfig' From 46db7a9bf93cd772859841925fec86bb3b913e80 Mon Sep 17 00:00:00 2001 From: Victor Anene Date: Thu, 2 Mar 2023 12:20:42 +0100 Subject: [PATCH 06/23] fix: remove required statement from IndyVdrModule work funded by the Government of Ontario Signed-off-by: Victor Anene --- packages/indy-vdr/src/IndyVdrModule.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/packages/indy-vdr/src/IndyVdrModule.ts b/packages/indy-vdr/src/IndyVdrModule.ts index 44dc54ff8a..d03db3c08d 100644 --- a/packages/indy-vdr/src/IndyVdrModule.ts +++ b/packages/indy-vdr/src/IndyVdrModule.ts @@ -15,17 +15,6 @@ export class IndyVdrModule implements Module { } public register(dependencyManager: DependencyManager) { - try { - // eslint-disable-next-line import/no-extraneous-dependencies - require('@hyperledger/indy-vdr-nodejs') - } catch (error) { - try { - require('@hyperledger/indy-vdr-react-native') - } catch (error) { - throw new Error('Error registering bindings for Indy VDR') - } - } - // Config dependencyManager.registerInstance(IndyVdrModuleConfig, this.config) From c1a06be57093aa35206e85f86a0ffa2bc562de1d Mon Sep 17 00:00:00 2001 From: Victor Anene Date: Fri, 3 Mar 2023 08:05:41 +0100 Subject: [PATCH 07/23] feat: add AskerModule Config work funded by the Government of Ontario Signed-off-by: Victor Anene --- packages/askar/src/AskarModule.ts | 33 ++++--------- packages/askar/src/AskarModuleConfig.ts | 65 +++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 24 deletions(-) create mode 100644 packages/askar/src/AskarModuleConfig.ts diff --git a/packages/askar/src/AskarModule.ts b/packages/askar/src/AskarModule.ts index 5eccb13b3d..939a2bad22 100644 --- a/packages/askar/src/AskarModule.ts +++ b/packages/askar/src/AskarModule.ts @@ -1,33 +1,18 @@ +import type { AskarModuleConfigOptions } from './AskarModuleConfig' import type { DependencyManager, Module } from '@aries-framework/core' -import { AriesFrameworkError, InjectionSymbols } from '@aries-framework/core' - +import { AskarModuleConfig } from './AskarModuleConfig' import { AskarStorageService } from './storage' -import { AskarWallet } from './wallet' export class AskarModule implements Module { - public register(dependencyManager: DependencyManager) { - try { - // eslint-disable-next-line import/no-extraneous-dependencies - require('@hyperledger/aries-askar-nodejs') - } catch (error) { - try { - require('@hyperledger/aries-askar-react-native') - } catch (error) { - throw new Error('Could not load aries-askar bindings') - } - } + public readonly config: AskarModuleConfig - if (dependencyManager.isRegistered(InjectionSymbols.Wallet)) { - throw new AriesFrameworkError('There is an instance of Wallet already registered') - } else { - dependencyManager.registerContextScoped(InjectionSymbols.Wallet, AskarWallet) - } + public constructor(config: AskarModuleConfigOptions) { + this.config = new AskarModuleConfig(config) + } + public register(dependencyManager: DependencyManager) { + dependencyManager.registerInstance(AskarModuleConfig, this.config) - if (dependencyManager.isRegistered(InjectionSymbols.StorageService)) { - throw new AriesFrameworkError('There is an instance of StorageService already registered') - } else { - dependencyManager.registerSingleton(InjectionSymbols.StorageService, AskarStorageService) - } + dependencyManager.registerSingleton(AskarStorageService) } } diff --git a/packages/askar/src/AskarModuleConfig.ts b/packages/askar/src/AskarModuleConfig.ts new file mode 100644 index 0000000000..de3b5c7cb6 --- /dev/null +++ b/packages/askar/src/AskarModuleConfig.ts @@ -0,0 +1,65 @@ +import type { AskarWalletPostgresConfig } from './wallet' +import type { AriesAskar } from '@hyperledger/aries-askar-shared' + +/** + * @public + * AnonCredsModuleConfigOptions defines the interface for the options of the AnonCredsModuleConfig class. + */ +export interface AskarModuleConfigOptions { + /** + * + * ## Node.JS + * + * ```ts + * import { ariesAskar } from '@hyperledger/aries-askar-nodejs' + * + * const agent = new Agent({ + * config: {}, + * dependencies: agentDependencies, + * modules: { + * ariesAskar: new AskarModule({ + * ariesAskar, + * }) + * } + * }) + * ``` + * + * ## React Native + * + * ```ts + * import { ariesAskar } from '@hyperledger/aries-askar-react-native' + * + * const agent = new Agent({ + * config: {}, + * dependencies: agentDependencies, + * modules: { + * ariesAskar: new AskarModule({ + * ariesAskar, + * }) + * } + * }) + * ``` + */ + ariesAskar: AriesAskar + + /** + * A list of Askar wallets to connect to. + */ + wallets: [AskarWalletPostgresConfig, ...AskarWalletPostgresConfig[]] +} + +/** + * @public + */ +export class AskarModuleConfig { + private options: AskarModuleConfigOptions + + public constructor(options: AskarModuleConfigOptions) { + this.options = options + } + + /** See {@link AskarModuleConfigOptions.wallets} */ + public get wallets() { + return this.options.wallets + } +} From c871440e12ad97e834a1425bf38d0b3f63de1430 Mon Sep 17 00:00:00 2001 From: Victor Anene Date: Fri, 3 Mar 2023 08:32:57 +0100 Subject: [PATCH 08/23] feat: Anoncreds optional peer dependency setup work funded by Government of Ontario Signed-off-by: Victor Anene --- demo/src/BaseAgent.ts | 5 ++- packages/anoncreds-rs/tests/indy-flow.test.ts | 2 + .../anoncreds/src/AnonCredsModuleConfig.ts | 37 +++++++++++++++++++ .../src/__tests__/AnonCredsModule.test.ts | 3 ++ .../__tests__/AnonCredsModuleConfig.test.ts | 3 ++ .../legacy-indy-format-services.test.ts | 2 + .../AnonCredsRegistryService.test.ts | 3 ++ packages/anoncreds/tests/anoncreds.test.ts | 2 + .../anoncreds/tests/legacyAnonCredsSetup.ts | 5 ++- ...f.credentials.propose-offerED25519.test.ts | 2 + 10 files changed, 62 insertions(+), 2 deletions(-) diff --git a/demo/src/BaseAgent.ts b/demo/src/BaseAgent.ts index 04d6cf4121..782034c7bd 100644 --- a/demo/src/BaseAgent.ts +++ b/demo/src/BaseAgent.ts @@ -25,7 +25,8 @@ import { import { IndySdkAnonCredsRegistry, IndySdkModule, IndySdkSovDidResolver } from '@aries-framework/indy-sdk' import { IndyVdrAnonCredsRegistry, IndyVdrModule, IndyVdrSovDidResolver } from '@aries-framework/indy-vdr' import { agentDependencies, HttpInboundTransport } from '@aries-framework/node' -import { indyVdr } from '@hyperledger/indy-vdr-nodejs' +import { anoncreds } from '@hyperledger/anoncreds-shared' +import { indyVdr } from '@hyperledger/indy-vdr-shared' import { randomUUID } from 'crypto' import indySdk from 'indy-sdk' @@ -124,6 +125,7 @@ function getAskarAnonCredsIndyModules() { ], }), anoncreds: new AnonCredsModule({ + anoncreds, registries: [new IndyVdrAnonCredsRegistry()], }), anoncredsRs: new AnonCredsRsModule(), @@ -166,6 +168,7 @@ function getLegacyIndySdkModules() { ], }), anoncreds: new AnonCredsModule({ + anoncreds, registries: [new IndySdkAnonCredsRegistry()], }), indySdk: new IndySdkModule({ diff --git a/packages/anoncreds-rs/tests/indy-flow.test.ts b/packages/anoncreds-rs/tests/indy-flow.test.ts index d3b53ed6fe..e32ddc8616 100644 --- a/packages/anoncreds-rs/tests/indy-flow.test.ts +++ b/packages/anoncreds-rs/tests/indy-flow.test.ts @@ -27,6 +27,7 @@ import { ProofState, ProofExchangeRecord, } from '@aries-framework/core' +import { anoncreds } from '@hyperledger/anoncreds-nodejs' import { Subject } from 'rxjs' import { InMemoryStorageService } from '../../../tests/InMemoryStorageService' @@ -39,6 +40,7 @@ import { AnonCredsRsVerifierService } from '../src/services/AnonCredsRsVerifierS const registry = new InMemoryAnonCredsRegistry() const anonCredsModuleConfig = new AnonCredsModuleConfig({ + anoncreds, registries: [registry], }) diff --git a/packages/anoncreds/src/AnonCredsModuleConfig.ts b/packages/anoncreds/src/AnonCredsModuleConfig.ts index 9f7b971aab..1d724f0c50 100644 --- a/packages/anoncreds/src/AnonCredsModuleConfig.ts +++ b/packages/anoncreds/src/AnonCredsModuleConfig.ts @@ -1,10 +1,47 @@ import type { AnonCredsRegistry } from './services' +import type { Anoncreds } from '@hyperledger/anoncreds-shared' /** * @public * AnonCredsModuleConfigOptions defines the interface for the options of the AnonCredsModuleConfig class. */ export interface AnonCredsModuleConfigOptions { + /** + * + * ## Node.JS + * + * ```ts + * import { anoncreds } from '@hyperledger/anoncreds-nodejs' + * + * const agent = new Agent({ + * config: {}, + * dependencies: agentDependencies, + * modules: { + * anoncreds: new AnoncredsModule({ + * anoncreds, + * }) + * } + * }) + * ``` + * + * ## React Native + * + * ```ts + * import { anoncreds } from '@hyperledger/anoncreds-react-native' + * + * const agent = new Agent({ + * config: {}, + * dependencies: agentDependencies, + * modules: { + * anoncreds: new AnoncredsModule({ + * anoncreds, + * }) + * } + * }) + * ``` + */ + anoncreds: Anoncreds + /** * A list of AnonCreds registries to make available to the AnonCreds module. */ diff --git a/packages/anoncreds/src/__tests__/AnonCredsModule.test.ts b/packages/anoncreds/src/__tests__/AnonCredsModule.test.ts index f9c868c14c..69c26adac4 100644 --- a/packages/anoncreds/src/__tests__/AnonCredsModule.test.ts +++ b/packages/anoncreds/src/__tests__/AnonCredsModule.test.ts @@ -1,6 +1,8 @@ import type { AnonCredsRegistry } from '../services' import type { DependencyManager } from '@aries-framework/core' +import { anoncreds } from '@hyperledger/anoncreds-nodejs' + import { AnonCredsModule } from '../AnonCredsModule' import { AnonCredsModuleConfig } from '../AnonCredsModuleConfig' import { @@ -22,6 +24,7 @@ const registry = {} as AnonCredsRegistry describe('AnonCredsModule', () => { test('registers dependencies on the dependency manager', () => { const anonCredsModule = new AnonCredsModule({ + anoncreds, registries: [registry], }) anonCredsModule.register(dependencyManager) diff --git a/packages/anoncreds/src/__tests__/AnonCredsModuleConfig.test.ts b/packages/anoncreds/src/__tests__/AnonCredsModuleConfig.test.ts index beaca8bf53..7e0a70572d 100644 --- a/packages/anoncreds/src/__tests__/AnonCredsModuleConfig.test.ts +++ b/packages/anoncreds/src/__tests__/AnonCredsModuleConfig.test.ts @@ -1,5 +1,7 @@ import type { AnonCredsRegistry } from '../services' +import { anoncreds } from '@hyperledger/anoncreds-nodejs' + import { AnonCredsModuleConfig } from '../AnonCredsModuleConfig' describe('AnonCredsModuleConfig', () => { @@ -7,6 +9,7 @@ describe('AnonCredsModuleConfig', () => { const registry = {} as AnonCredsRegistry const config = new AnonCredsModuleConfig({ + anoncreds, registries: [registry], }) diff --git a/packages/anoncreds/src/formats/__tests__/legacy-indy-format-services.test.ts b/packages/anoncreds/src/formats/__tests__/legacy-indy-format-services.test.ts index 2a8e628097..435837001a 100644 --- a/packages/anoncreds/src/formats/__tests__/legacy-indy-format-services.test.ts +++ b/packages/anoncreds/src/formats/__tests__/legacy-indy-format-services.test.ts @@ -10,6 +10,7 @@ import { ProofState, EventEmitter, } from '@aries-framework/core' +import { anoncreds } from '@hyperledger/anoncreds-nodejs' import * as indySdk from 'indy-sdk' import { Subject } from 'rxjs' @@ -37,6 +38,7 @@ import { LegacyIndyProofFormatService } from '../LegacyIndyProofFormatService' const registry = new InMemoryAnonCredsRegistry() const anonCredsModuleConfig = new AnonCredsModuleConfig({ + anoncreds, registries: [registry], }) diff --git a/packages/anoncreds/src/services/registry/__tests__/AnonCredsRegistryService.test.ts b/packages/anoncreds/src/services/registry/__tests__/AnonCredsRegistryService.test.ts index 2cb39bc2e5..5459f50433 100644 --- a/packages/anoncreds/src/services/registry/__tests__/AnonCredsRegistryService.test.ts +++ b/packages/anoncreds/src/services/registry/__tests__/AnonCredsRegistryService.test.ts @@ -1,5 +1,7 @@ import type { AnonCredsRegistry } from '../AnonCredsRegistry' +import { anoncreds } from '@hyperledger/anoncreds-nodejs' + import { getAgentContext } from '../../../../../core/tests/helpers' import { AnonCredsModuleConfig } from '../../../AnonCredsModuleConfig' import { AnonCredsError } from '../../../error' @@ -18,6 +20,7 @@ const agentContext = getAgentContext({ [ AnonCredsModuleConfig, new AnonCredsModuleConfig({ + anoncreds, registries: [registryOne, registryTwo], }), ], diff --git a/packages/anoncreds/tests/anoncreds.test.ts b/packages/anoncreds/tests/anoncreds.test.ts index 127bbee586..4d4e28209d 100644 --- a/packages/anoncreds/tests/anoncreds.test.ts +++ b/packages/anoncreds/tests/anoncreds.test.ts @@ -1,5 +1,6 @@ import { Agent, KeyDerivationMethod, KeyType, TypedArrayEncoder } from '@aries-framework/core' import { agentDependencies } from '@aries-framework/node' +import { anoncreds } from '@hyperledger/anoncreds-nodejs' import * as indySdk from 'indy-sdk' import { IndySdkModule } from '../../indy-sdk/src/IndySdkModule' @@ -85,6 +86,7 @@ const agent = new Agent({ indySdk, }), anoncreds: new AnonCredsModule({ + anoncreds, registries: [ new InMemoryAnonCredsRegistry({ existingSchemas, diff --git a/packages/anoncreds/tests/legacyAnonCredsSetup.ts b/packages/anoncreds/tests/legacyAnonCredsSetup.ts index 72465152e4..f2858be87b 100644 --- a/packages/anoncreds/tests/legacyAnonCredsSetup.ts +++ b/packages/anoncreds/tests/legacyAnonCredsSetup.ts @@ -27,7 +27,8 @@ import { V2ProofProtocol, DidsModule, } from '@aries-framework/core' -import { indyVdr } from '@hyperledger/indy-vdr-shared' +import { anoncreds } from '@hyperledger/anoncreds-nodejs' +import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { randomUUID } from 'crypto' import { AnonCredsRsModule } from '../../anoncreds-rs/src' @@ -96,6 +97,7 @@ export const getLegacyAnonCredsModules = ({ ], }), anoncreds: new AnonCredsModule({ + anoncreds, registries: [new IndySdkAnonCredsRegistry()], }), dids: new DidsModule({ @@ -150,6 +152,7 @@ export const getAskarAnonCredsIndyModules = ({ ], }), anoncreds: new AnonCredsModule({ + anoncreds, registries: [new IndyVdrAnonCredsRegistry()], }), anoncredsRs: new AnonCredsRsModule(), diff --git a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials.propose-offerED25519.test.ts b/packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials.propose-offerED25519.test.ts index 8c0956a145..8649288048 100644 --- a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials.propose-offerED25519.test.ts +++ b/packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials.propose-offerED25519.test.ts @@ -1,5 +1,6 @@ import type { EventReplaySubject } from '../../../../../../tests' +import { anoncreds } from '@hyperledger/anoncreds-nodejs' import { randomUUID } from 'crypto' import { @@ -104,6 +105,7 @@ const getIndyJsonLdModules = () => ], }), anoncreds: new AnonCredsModule({ + anoncreds, registries: [new IndySdkAnonCredsRegistry()], }), dids: new DidsModule({ From 24c8848cc09211891eeb555d09d50e588ccc8a80 Mon Sep 17 00:00:00 2001 From: Victor Anene Date: Fri, 3 Mar 2023 08:35:27 +0100 Subject: [PATCH 09/23] chore: add depencies work funded by Government of Ontario Signed-off-by: Victor Anene --- demo/package.json | 3 ++- packages/anoncreds/package.json | 3 ++- packages/core/package.json | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/demo/package.json b/demo/package.json index 6d7d0be8cd..efd0d5b14b 100644 --- a/demo/package.json +++ b/demo/package.json @@ -14,7 +14,8 @@ "refresh": "rm -rf ./node_modules ./yarn.lock && yarn" }, "dependencies": { - "@hyperledger/indy-vdr-nodejs": "^0.1.0-dev.6" + "@hyperledger/indy-vdr-shared": "^0.1.0-dev.6", + "@hyperledger/anoncreds-shared": "^0.1.0-dev.6" }, "devDependencies": { "@aries-framework/anoncreds": "*", diff --git a/packages/anoncreds/package.json b/packages/anoncreds/package.json index 88b8453958..ed671967b2 100644 --- a/packages/anoncreds/package.json +++ b/packages/anoncreds/package.json @@ -31,7 +31,8 @@ }, "devDependencies": { "@aries-framework/node": "0.3.3", - "@hyperledger/indy-vdr-shared": "^0.1.0-dev.6", + "@hyperledger/indy-vdr-nodejs": "^0.1.0-dev.6", + "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.6", "indy-sdk": "^1.16.0-dev-1636", "rimraf": "^4.0.7", "rxjs": "^7.8.0", diff --git a/packages/core/package.json b/packages/core/package.json index 7b3dd8da9b..85da34fdac 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -51,6 +51,7 @@ "web-did-resolver": "^2.0.8" }, "devDependencies": { + "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.6", "@types/bn.js": "^5.1.0", "@types/events": "^3.0.0", "@types/luxon": "^1.27.0", From 6159278db07a80ea75d6338256e5505598e556ca Mon Sep 17 00:00:00 2001 From: Victor Anene Date: Tue, 7 Mar 2023 19:59:20 +0100 Subject: [PATCH 10/23] fix: move anoncreds dependency to anoncred-rs work funded by the Government of Ontario Signed-off-by: Victor Anene --- .../anoncreds-rs/src/AnonCredsRsModule.ts | 19 ++++--- .../src/AnonCredsRsModuleConfig.ts | 54 +++++++++++++++++++ packages/anoncreds-rs/tests/indy-flow.test.ts | 2 - packages/anoncreds/package.json | 1 - .../anoncreds/src/AnonCredsModuleConfig.ts | 37 ------------- .../src/__tests__/AnonCredsModule.test.ts | 3 -- .../__tests__/AnonCredsModuleConfig.test.ts | 3 -- .../legacy-indy-format-services.test.ts | 2 - .../AnonCredsRegistryService.test.ts | 3 -- packages/anoncreds/tests/anoncreds.test.ts | 2 - .../anoncreds/tests/legacyAnonCredsSetup.ts | 14 +++-- 11 files changed, 69 insertions(+), 71 deletions(-) create mode 100644 packages/anoncreds-rs/src/AnonCredsRsModuleConfig.ts diff --git a/packages/anoncreds-rs/src/AnonCredsRsModule.ts b/packages/anoncreds-rs/src/AnonCredsRsModule.ts index 4ceb7b8304..cca3f465fd 100644 --- a/packages/anoncreds-rs/src/AnonCredsRsModule.ts +++ b/packages/anoncreds-rs/src/AnonCredsRsModule.ts @@ -1,3 +1,4 @@ +import type { AnonCredsRsModuleConfigOptions } from './AnonCredsRsModuleConfig' import type { DependencyManager, Module } from '@aries-framework/core' import { @@ -6,20 +7,18 @@ import { AnonCredsVerifierServiceSymbol, } from '@aries-framework/anoncreds' +import { AnonCredsRsModuleConfig } from './AnonCredsRsModuleConfig' import { AnonCredsRsHolderService, AnonCredsRsIssuerService, AnonCredsRsVerifierService } from './services' export class AnonCredsRsModule implements Module { + public readonly config: AnonCredsRsModuleConfig + + public constructor(config: AnonCredsRsModuleConfigOptions) { + this.config = new AnonCredsRsModuleConfig(config) + } + public register(dependencyManager: DependencyManager) { - try { - // eslint-disable-next-line import/no-extraneous-dependencies - require('@hyperledger/anoncreds-nodejs') - } catch (error) { - try { - require('@hyperledger/anoncreds-react-native') - } catch (error) { - throw new Error('Could not load anoncreds bindings') - } - } + dependencyManager.registerInstance(AnonCredsRsModuleConfig, this.config) // Register services dependencyManager.registerSingleton(AnonCredsHolderServiceSymbol, AnonCredsRsHolderService) diff --git a/packages/anoncreds-rs/src/AnonCredsRsModuleConfig.ts b/packages/anoncreds-rs/src/AnonCredsRsModuleConfig.ts new file mode 100644 index 0000000000..6c2d79a05f --- /dev/null +++ b/packages/anoncreds-rs/src/AnonCredsRsModuleConfig.ts @@ -0,0 +1,54 @@ +import type { Anoncreds } from '@hyperledger/anoncreds-shared' + +/** + * @public + * AnonCredsRsModuleConfigOptions defines the interface for the options of the AnonCredsRsModuleConfig class. + */ +export interface AnonCredsRsModuleConfigOptions { + /** + * + * ## Node.JS + * + * ```ts + * import { anoncreds } from '@hyperledger/anoncreds-nodejs' + * + * const agent = new Agent({ + * config: {}, + * dependencies: agentDependencies, + * modules: { + * anoncredsRs: new AnoncredsRsModule({ + * anoncreds, + * }) + * } + * }) + * ``` + * + * ## React Native + * + * ```ts + * import { anoncreds } from '@hyperledger/anoncreds-react-native' + * + * const agent = new Agent({ + * config: {}, + * dependencies: agentDependencies, + * modules: { + * anoncredsRs: new AnoncredsRsModule({ + * anoncreds, + * }) + * } + * }) + * ``` + */ + anoncreds: Anoncreds +} + +/** + * @public + */ +export class AnonCredsRsModuleConfig { + private options: AnonCredsRsModuleConfigOptions + + public constructor(options: AnonCredsRsModuleConfigOptions) { + this.options = options + } +} diff --git a/packages/anoncreds-rs/tests/indy-flow.test.ts b/packages/anoncreds-rs/tests/indy-flow.test.ts index e32ddc8616..d3b53ed6fe 100644 --- a/packages/anoncreds-rs/tests/indy-flow.test.ts +++ b/packages/anoncreds-rs/tests/indy-flow.test.ts @@ -27,7 +27,6 @@ import { ProofState, ProofExchangeRecord, } from '@aries-framework/core' -import { anoncreds } from '@hyperledger/anoncreds-nodejs' import { Subject } from 'rxjs' import { InMemoryStorageService } from '../../../tests/InMemoryStorageService' @@ -40,7 +39,6 @@ import { AnonCredsRsVerifierService } from '../src/services/AnonCredsRsVerifierS const registry = new InMemoryAnonCredsRegistry() const anonCredsModuleConfig = new AnonCredsModuleConfig({ - anoncreds, registries: [registry], }) diff --git a/packages/anoncreds/package.json b/packages/anoncreds/package.json index ed671967b2..4619823e23 100644 --- a/packages/anoncreds/package.json +++ b/packages/anoncreds/package.json @@ -31,7 +31,6 @@ }, "devDependencies": { "@aries-framework/node": "0.3.3", - "@hyperledger/indy-vdr-nodejs": "^0.1.0-dev.6", "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.6", "indy-sdk": "^1.16.0-dev-1636", "rimraf": "^4.0.7", diff --git a/packages/anoncreds/src/AnonCredsModuleConfig.ts b/packages/anoncreds/src/AnonCredsModuleConfig.ts index 1d724f0c50..9f7b971aab 100644 --- a/packages/anoncreds/src/AnonCredsModuleConfig.ts +++ b/packages/anoncreds/src/AnonCredsModuleConfig.ts @@ -1,47 +1,10 @@ import type { AnonCredsRegistry } from './services' -import type { Anoncreds } from '@hyperledger/anoncreds-shared' /** * @public * AnonCredsModuleConfigOptions defines the interface for the options of the AnonCredsModuleConfig class. */ export interface AnonCredsModuleConfigOptions { - /** - * - * ## Node.JS - * - * ```ts - * import { anoncreds } from '@hyperledger/anoncreds-nodejs' - * - * const agent = new Agent({ - * config: {}, - * dependencies: agentDependencies, - * modules: { - * anoncreds: new AnoncredsModule({ - * anoncreds, - * }) - * } - * }) - * ``` - * - * ## React Native - * - * ```ts - * import { anoncreds } from '@hyperledger/anoncreds-react-native' - * - * const agent = new Agent({ - * config: {}, - * dependencies: agentDependencies, - * modules: { - * anoncreds: new AnoncredsModule({ - * anoncreds, - * }) - * } - * }) - * ``` - */ - anoncreds: Anoncreds - /** * A list of AnonCreds registries to make available to the AnonCreds module. */ diff --git a/packages/anoncreds/src/__tests__/AnonCredsModule.test.ts b/packages/anoncreds/src/__tests__/AnonCredsModule.test.ts index 69c26adac4..f9c868c14c 100644 --- a/packages/anoncreds/src/__tests__/AnonCredsModule.test.ts +++ b/packages/anoncreds/src/__tests__/AnonCredsModule.test.ts @@ -1,8 +1,6 @@ import type { AnonCredsRegistry } from '../services' import type { DependencyManager } from '@aries-framework/core' -import { anoncreds } from '@hyperledger/anoncreds-nodejs' - import { AnonCredsModule } from '../AnonCredsModule' import { AnonCredsModuleConfig } from '../AnonCredsModuleConfig' import { @@ -24,7 +22,6 @@ const registry = {} as AnonCredsRegistry describe('AnonCredsModule', () => { test('registers dependencies on the dependency manager', () => { const anonCredsModule = new AnonCredsModule({ - anoncreds, registries: [registry], }) anonCredsModule.register(dependencyManager) diff --git a/packages/anoncreds/src/__tests__/AnonCredsModuleConfig.test.ts b/packages/anoncreds/src/__tests__/AnonCredsModuleConfig.test.ts index 7e0a70572d..beaca8bf53 100644 --- a/packages/anoncreds/src/__tests__/AnonCredsModuleConfig.test.ts +++ b/packages/anoncreds/src/__tests__/AnonCredsModuleConfig.test.ts @@ -1,7 +1,5 @@ import type { AnonCredsRegistry } from '../services' -import { anoncreds } from '@hyperledger/anoncreds-nodejs' - import { AnonCredsModuleConfig } from '../AnonCredsModuleConfig' describe('AnonCredsModuleConfig', () => { @@ -9,7 +7,6 @@ describe('AnonCredsModuleConfig', () => { const registry = {} as AnonCredsRegistry const config = new AnonCredsModuleConfig({ - anoncreds, registries: [registry], }) diff --git a/packages/anoncreds/src/formats/__tests__/legacy-indy-format-services.test.ts b/packages/anoncreds/src/formats/__tests__/legacy-indy-format-services.test.ts index 435837001a..2a8e628097 100644 --- a/packages/anoncreds/src/formats/__tests__/legacy-indy-format-services.test.ts +++ b/packages/anoncreds/src/formats/__tests__/legacy-indy-format-services.test.ts @@ -10,7 +10,6 @@ import { ProofState, EventEmitter, } from '@aries-framework/core' -import { anoncreds } from '@hyperledger/anoncreds-nodejs' import * as indySdk from 'indy-sdk' import { Subject } from 'rxjs' @@ -38,7 +37,6 @@ import { LegacyIndyProofFormatService } from '../LegacyIndyProofFormatService' const registry = new InMemoryAnonCredsRegistry() const anonCredsModuleConfig = new AnonCredsModuleConfig({ - anoncreds, registries: [registry], }) diff --git a/packages/anoncreds/src/services/registry/__tests__/AnonCredsRegistryService.test.ts b/packages/anoncreds/src/services/registry/__tests__/AnonCredsRegistryService.test.ts index 5459f50433..2cb39bc2e5 100644 --- a/packages/anoncreds/src/services/registry/__tests__/AnonCredsRegistryService.test.ts +++ b/packages/anoncreds/src/services/registry/__tests__/AnonCredsRegistryService.test.ts @@ -1,7 +1,5 @@ import type { AnonCredsRegistry } from '../AnonCredsRegistry' -import { anoncreds } from '@hyperledger/anoncreds-nodejs' - import { getAgentContext } from '../../../../../core/tests/helpers' import { AnonCredsModuleConfig } from '../../../AnonCredsModuleConfig' import { AnonCredsError } from '../../../error' @@ -20,7 +18,6 @@ const agentContext = getAgentContext({ [ AnonCredsModuleConfig, new AnonCredsModuleConfig({ - anoncreds, registries: [registryOne, registryTwo], }), ], diff --git a/packages/anoncreds/tests/anoncreds.test.ts b/packages/anoncreds/tests/anoncreds.test.ts index 4d4e28209d..127bbee586 100644 --- a/packages/anoncreds/tests/anoncreds.test.ts +++ b/packages/anoncreds/tests/anoncreds.test.ts @@ -1,6 +1,5 @@ import { Agent, KeyDerivationMethod, KeyType, TypedArrayEncoder } from '@aries-framework/core' import { agentDependencies } from '@aries-framework/node' -import { anoncreds } from '@hyperledger/anoncreds-nodejs' import * as indySdk from 'indy-sdk' import { IndySdkModule } from '../../indy-sdk/src/IndySdkModule' @@ -86,7 +85,6 @@ const agent = new Agent({ indySdk, }), anoncreds: new AnonCredsModule({ - anoncreds, registries: [ new InMemoryAnonCredsRegistry({ existingSchemas, diff --git a/packages/anoncreds/tests/legacyAnonCredsSetup.ts b/packages/anoncreds/tests/legacyAnonCredsSetup.ts index f2858be87b..f638f46c49 100644 --- a/packages/anoncreds/tests/legacyAnonCredsSetup.ts +++ b/packages/anoncreds/tests/legacyAnonCredsSetup.ts @@ -28,11 +28,11 @@ import { DidsModule, } from '@aries-framework/core' import { anoncreds } from '@hyperledger/anoncreds-nodejs' -import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { randomUUID } from 'crypto' import { AnonCredsRsModule } from '../../anoncreds-rs/src' import { AskarModule } from '../../askar/src' +import { askarModuleConfig } from '../../askar/tests/helpers' import { sleep } from '../../core/src/utils/sleep' import { uuid } from '../../core/src/utils/uuid' import { setupSubjectTransports, setupEventReplaySubjects } from '../../core/tests' @@ -56,6 +56,7 @@ import { } from '../../indy-sdk/src' import { getIndySdkModuleConfig } from '../../indy-sdk/tests/setupIndySdkModule' import { IndyVdrAnonCredsRegistry, IndyVdrSovDidResolver, IndyVdrModule } from '../../indy-vdr/src' +import { indyVdrModuleConfig } from '../../indy-vdr/tests/helpers' import { V1CredentialProtocol, V1ProofProtocol, @@ -97,7 +98,6 @@ export const getLegacyAnonCredsModules = ({ ], }), anoncreds: new AnonCredsModule({ - anoncreds, registries: [new IndySdkAnonCredsRegistry()], }), dids: new DidsModule({ @@ -152,18 +152,16 @@ export const getAskarAnonCredsIndyModules = ({ ], }), anoncreds: new AnonCredsModule({ - anoncreds, registries: [new IndyVdrAnonCredsRegistry()], }), - anoncredsRs: new AnonCredsRsModule(), - indyVdr: new IndyVdrModule({ - indyVdr, - networks: [indyNetworkConfig], + anoncredsRs: new AnonCredsRsModule({ + anoncreds, }), + indyVdr: new IndyVdrModule(indyVdrModuleConfig), dids: new DidsModule({ resolvers: [new IndyVdrSovDidResolver()], // TODO: Support Registrar for tests }), - askar: new AskarModule(), + askar: new AskarModule(askarModuleConfig), cache: new CacheModule({ cache: new InMemoryLruCache({ limit: 100 }), }), From 2aa58304176d74db73b228aeb7b04b47225c87f9 Mon Sep 17 00:00:00 2001 From: Victor Anene Date: Tue, 7 Mar 2023 20:08:15 +0100 Subject: [PATCH 11/23] feat: askar module configuration work funded by the Government of Ontario Signed-off-by: Victor Anene --- demo/package.json | 5 +++-- demo/src/BaseAgent.ts | 15 +++++++++------ packages/askar/src/AskarModule.ts | 15 +++++++++++++++ packages/askar/src/AskarModuleConfig.ts | 11 ++--------- packages/askar/tests/helpers.ts | 6 +++++- packages/core/package.json | 1 - ...proof.credentials.propose-offerED25519.test.ts | 2 -- packages/indy-vdr/src/IndyVdrModuleConfig.ts | 4 ++++ .../indy-vdr/src/__tests__/IndyVdrModule.test.ts | 2 +- 9 files changed, 39 insertions(+), 22 deletions(-) diff --git a/demo/package.json b/demo/package.json index efd0d5b14b..8531a30a67 100644 --- a/demo/package.json +++ b/demo/package.json @@ -14,8 +14,9 @@ "refresh": "rm -rf ./node_modules ./yarn.lock && yarn" }, "dependencies": { - "@hyperledger/indy-vdr-shared": "^0.1.0-dev.6", - "@hyperledger/anoncreds-shared": "^0.1.0-dev.6" + "@hyperledger/indy-vdr-nodejs": "^0.1.0-dev.6", + "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.6", + "@hyperledger/aries-askar-nodejs": "^0.1.0-dev.3" }, "devDependencies": { "@aries-framework/anoncreds": "*", diff --git a/demo/src/BaseAgent.ts b/demo/src/BaseAgent.ts index 782034c7bd..18f51f8c78 100644 --- a/demo/src/BaseAgent.ts +++ b/demo/src/BaseAgent.ts @@ -25,8 +25,9 @@ import { import { IndySdkAnonCredsRegistry, IndySdkModule, IndySdkSovDidResolver } from '@aries-framework/indy-sdk' import { IndyVdrAnonCredsRegistry, IndyVdrModule, IndyVdrSovDidResolver } from '@aries-framework/indy-vdr' import { agentDependencies, HttpInboundTransport } from '@aries-framework/node' -import { anoncreds } from '@hyperledger/anoncreds-shared' -import { indyVdr } from '@hyperledger/indy-vdr-shared' +import { anoncreds } from '@hyperledger/anoncreds-nodejs' +import { ariesAskar } from '@hyperledger/aries-askar-nodejs' +import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { randomUUID } from 'crypto' import indySdk from 'indy-sdk' @@ -125,10 +126,11 @@ function getAskarAnonCredsIndyModules() { ], }), anoncreds: new AnonCredsModule({ - anoncreds, registries: [new IndyVdrAnonCredsRegistry()], }), - anoncredsRs: new AnonCredsRsModule(), + anoncredsRs: new AnonCredsRsModule({ + anoncreds, + }), indyVdr: new IndyVdrModule({ indyVdr, networks: [indyNetworkConfig], @@ -136,7 +138,9 @@ function getAskarAnonCredsIndyModules() { dids: new DidsModule({ resolvers: [new IndyVdrSovDidResolver()], }), - askar: new AskarModule(), + askar: new AskarModule({ + ariesAskar, + }), } as const } @@ -168,7 +172,6 @@ function getLegacyIndySdkModules() { ], }), anoncreds: new AnonCredsModule({ - anoncreds, registries: [new IndySdkAnonCredsRegistry()], }), indySdk: new IndySdkModule({ diff --git a/packages/askar/src/AskarModule.ts b/packages/askar/src/AskarModule.ts index 939a2bad22..dcdeea23a3 100644 --- a/packages/askar/src/AskarModule.ts +++ b/packages/askar/src/AskarModule.ts @@ -1,8 +1,11 @@ import type { AskarModuleConfigOptions } from './AskarModuleConfig' import type { DependencyManager, Module } from '@aries-framework/core' +import { AriesFrameworkError, InjectionSymbols } from '@aries-framework/core' + import { AskarModuleConfig } from './AskarModuleConfig' import { AskarStorageService } from './storage' +import { AskarWallet } from './wallet' export class AskarModule implements Module { public readonly config: AskarModuleConfig @@ -14,5 +17,17 @@ export class AskarModule implements Module { dependencyManager.registerInstance(AskarModuleConfig, this.config) dependencyManager.registerSingleton(AskarStorageService) + + if (dependencyManager.isRegistered(InjectionSymbols.Wallet)) { + throw new AriesFrameworkError('There is an instance of Wallet already registered') + } else { + dependencyManager.registerContextScoped(InjectionSymbols.Wallet, AskarWallet) + } + + if (dependencyManager.isRegistered(InjectionSymbols.StorageService)) { + throw new AriesFrameworkError('There is an instance of StorageService already registered') + } else { + dependencyManager.registerSingleton(InjectionSymbols.StorageService, AskarStorageService) + } } } diff --git a/packages/askar/src/AskarModuleConfig.ts b/packages/askar/src/AskarModuleConfig.ts index de3b5c7cb6..fe0d8c951b 100644 --- a/packages/askar/src/AskarModuleConfig.ts +++ b/packages/askar/src/AskarModuleConfig.ts @@ -1,10 +1,5 @@ -import type { AskarWalletPostgresConfig } from './wallet' import type { AriesAskar } from '@hyperledger/aries-askar-shared' -/** - * @public - * AnonCredsModuleConfigOptions defines the interface for the options of the AnonCredsModuleConfig class. - */ export interface AskarModuleConfigOptions { /** * @@ -45,7 +40,6 @@ export interface AskarModuleConfigOptions { /** * A list of Askar wallets to connect to. */ - wallets: [AskarWalletPostgresConfig, ...AskarWalletPostgresConfig[]] } /** @@ -58,8 +52,7 @@ export class AskarModuleConfig { this.options = options } - /** See {@link AskarModuleConfigOptions.wallets} */ - public get wallets() { - return this.options.wallets + public get ariesAskar() { + return this.options.ariesAskar } } diff --git a/packages/askar/tests/helpers.ts b/packages/askar/tests/helpers.ts index 8be4b2a833..d8cf9c0da3 100644 --- a/packages/askar/tests/helpers.ts +++ b/packages/askar/tests/helpers.ts @@ -2,11 +2,15 @@ import type { AskarWalletPostgresStorageConfig } from '../src/wallet' import type { InitConfig } from '@aries-framework/core' import { LogLevel } from '@aries-framework/core' +import { ariesAskar } from '@hyperledger/aries-askar-nodejs' import path from 'path' import { TestLogger } from '../../core/tests/logger' import { agentDependencies } from '../../node/src' import { AskarModule } from '../src/AskarModule' +import { AskarModuleConfig } from '../src/AskarModuleConfig' + +export const askarModuleConfig = new AskarModuleConfig({ ariesAskar }) export const genesisPath = process.env.GENESIS_TXN_PATH ? path.resolve(process.env.GENESIS_TXN_PATH) @@ -34,6 +38,6 @@ export function getPostgresAgentOptions( return { config, dependencies: agentDependencies, - modules: { askar: new AskarModule() }, + modules: { askar: new AskarModule(askarModuleConfig) }, } as const } diff --git a/packages/core/package.json b/packages/core/package.json index 85da34fdac..7b3dd8da9b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -51,7 +51,6 @@ "web-did-resolver": "^2.0.8" }, "devDependencies": { - "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.6", "@types/bn.js": "^5.1.0", "@types/events": "^3.0.0", "@types/luxon": "^1.27.0", diff --git a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials.propose-offerED25519.test.ts b/packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials.propose-offerED25519.test.ts index 8649288048..8c0956a145 100644 --- a/packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials.propose-offerED25519.test.ts +++ b/packages/core/src/modules/credentials/protocol/v2/__tests__/v2.ldproof.credentials.propose-offerED25519.test.ts @@ -1,6 +1,5 @@ import type { EventReplaySubject } from '../../../../../../tests' -import { anoncreds } from '@hyperledger/anoncreds-nodejs' import { randomUUID } from 'crypto' import { @@ -105,7 +104,6 @@ const getIndyJsonLdModules = () => ], }), anoncreds: new AnonCredsModule({ - anoncreds, registries: [new IndySdkAnonCredsRegistry()], }), dids: new DidsModule({ diff --git a/packages/indy-vdr/src/IndyVdrModuleConfig.ts b/packages/indy-vdr/src/IndyVdrModuleConfig.ts index 0f07324c81..a86df5707a 100644 --- a/packages/indy-vdr/src/IndyVdrModuleConfig.ts +++ b/packages/indy-vdr/src/IndyVdrModuleConfig.ts @@ -70,4 +70,8 @@ export class IndyVdrModuleConfig { public get networks() { return this.options.networks } + + public get indyVdr() { + return this.options.indyVdr + } } diff --git a/packages/indy-vdr/src/__tests__/IndyVdrModule.test.ts b/packages/indy-vdr/src/__tests__/IndyVdrModule.test.ts index 870ce48746..1b9b55c8e4 100644 --- a/packages/indy-vdr/src/__tests__/IndyVdrModule.test.ts +++ b/packages/indy-vdr/src/__tests__/IndyVdrModule.test.ts @@ -1,6 +1,6 @@ import type { DependencyManager } from '@aries-framework/core' -import { indyVdr } from '@hyperledger/indy-vdr-shared' +import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { IndyVdrModule } from '../IndyVdrModule' import { IndyVdrModuleConfig } from '../IndyVdrModuleConfig' From be8eb1f0148f5ae76e5ce36b1a7fa557ffd362f1 Mon Sep 17 00:00:00 2001 From: Victor Anene Date: Wed, 8 Mar 2023 12:23:40 +0100 Subject: [PATCH 12/23] fix: resolve PR review Signed-off-by: Victor Anene --- packages/anoncreds/tests/legacyAnonCredsSetup.ts | 8 -------- packages/askar/src/AskarModule.ts | 2 -- packages/askar/src/AskarModuleConfig.ts | 4 ---- .../indy-vdr/src/__tests__/IndyVdrModuleConfig.test.ts | 2 +- 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/packages/anoncreds/tests/legacyAnonCredsSetup.ts b/packages/anoncreds/tests/legacyAnonCredsSetup.ts index f638f46c49..8f3d6f467c 100644 --- a/packages/anoncreds/tests/legacyAnonCredsSetup.ts +++ b/packages/anoncreds/tests/legacyAnonCredsSetup.ts @@ -120,14 +120,6 @@ export const getAskarAnonCredsIndyModules = ({ const legacyIndyCredentialFormatService = new LegacyIndyCredentialFormatService() const legacyIndyProofFormatService = new LegacyIndyProofFormatService() - const indyNetworkConfig = { - id: `localhost-${uuid()}`, - isProduction: false, - genesisTransactions, - indyNamespace: 'pool:localtest', - transactionAuthorAgreement: { version: taaVersion, acceptanceMechanism: taaAcceptanceMechanism }, - } - const modules = { credentials: new CredentialsModule({ autoAcceptCredentials, diff --git a/packages/askar/src/AskarModule.ts b/packages/askar/src/AskarModule.ts index dcdeea23a3..a4830865ee 100644 --- a/packages/askar/src/AskarModule.ts +++ b/packages/askar/src/AskarModule.ts @@ -16,8 +16,6 @@ export class AskarModule implements Module { public register(dependencyManager: DependencyManager) { dependencyManager.registerInstance(AskarModuleConfig, this.config) - dependencyManager.registerSingleton(AskarStorageService) - if (dependencyManager.isRegistered(InjectionSymbols.Wallet)) { throw new AriesFrameworkError('There is an instance of Wallet already registered') } else { diff --git a/packages/askar/src/AskarModuleConfig.ts b/packages/askar/src/AskarModuleConfig.ts index fe0d8c951b..38eebdde86 100644 --- a/packages/askar/src/AskarModuleConfig.ts +++ b/packages/askar/src/AskarModuleConfig.ts @@ -36,10 +36,6 @@ export interface AskarModuleConfigOptions { * ``` */ ariesAskar: AriesAskar - - /** - * A list of Askar wallets to connect to. - */ } /** diff --git a/packages/indy-vdr/src/__tests__/IndyVdrModuleConfig.test.ts b/packages/indy-vdr/src/__tests__/IndyVdrModuleConfig.test.ts index 7f3c94aac5..b1abb77784 100644 --- a/packages/indy-vdr/src/__tests__/IndyVdrModuleConfig.test.ts +++ b/packages/indy-vdr/src/__tests__/IndyVdrModuleConfig.test.ts @@ -1,6 +1,6 @@ import type { IndyVdrPoolConfig } from '../pool' -import { indyVdr } from '@hyperledger/indy-vdr-shared' +import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { IndyVdrModuleConfig } from '../IndyVdrModuleConfig' From 4b5431ddc105c00aeb79e91a25c113243713d7e8 Mon Sep 17 00:00:00 2001 From: Victor Anene Date: Wed, 8 Mar 2023 13:28:18 +0100 Subject: [PATCH 13/23] fix: eslint error Signed-off-by: Victor Anene --- packages/anoncreds/tests/legacyAnonCredsSetup.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/anoncreds/tests/legacyAnonCredsSetup.ts b/packages/anoncreds/tests/legacyAnonCredsSetup.ts index 69dc5035f5..9d5290f615 100644 --- a/packages/anoncreds/tests/legacyAnonCredsSetup.ts +++ b/packages/anoncreds/tests/legacyAnonCredsSetup.ts @@ -34,16 +34,12 @@ import { AnonCredsRsModule } from '../../anoncreds-rs/src' import { AskarModule } from '../../askar/src' import { askarModuleConfig } from '../../askar/tests/helpers' import { sleep } from '../../core/src/utils/sleep' -import { uuid } from '../../core/src/utils/uuid' import { setupSubjectTransports, setupEventReplaySubjects } from '../../core/tests' import { getAgentOptions, importExistingIndyDidFromPrivateKey, makeConnection, publicDidSeed, - genesisTransactions, - taaVersion, - taaAcceptanceMechanism, waitForCredentialRecordSubject, waitForProofExchangeRecordSubject, } from '../../core/tests/helpers' From 6894eb78c13802b57625041bac52dabc8b193390 Mon Sep 17 00:00:00 2001 From: Ariel Gentile Date: Thu, 9 Mar 2023 16:31:48 -0300 Subject: [PATCH 14/23] style: fix lint error Signed-off-by: Ariel Gentile --- packages/indy-vdr/tests/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/indy-vdr/tests/helpers.ts b/packages/indy-vdr/tests/helpers.ts index 69db76b18b..1d1b94494e 100644 --- a/packages/indy-vdr/tests/helpers.ts +++ b/packages/indy-vdr/tests/helpers.ts @@ -1,8 +1,8 @@ import type { IndyVdrDidCreateOptions } from '../src/dids/IndyVdrIndyDidRegistrar' import type { Agent } from '@aries-framework/core' -import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { DidCommV1Service, DidCommV2Service, DidDocumentService, KeyType } from '@aries-framework/core' +import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { genesisTransactions } from '../../core/tests/helpers' import { IndyVdrModuleConfig } from '../src/IndyVdrModuleConfig' From 2e79ea3cd2c3d30e0bc82986cee0f9ceb318fe0f Mon Sep 17 00:00:00 2001 From: Ariel Gentile Date: Thu, 9 Mar 2023 17:53:43 -0300 Subject: [PATCH 15/23] fix: missing indyVdr in tests Signed-off-by: Ariel Gentile --- packages/indy-vdr/tests/indy-vdr-anoncreds-registry.e2e.test.ts | 2 ++ packages/indy-vdr/tests/indy-vdr-did-registrar.e2e.test.ts | 2 ++ packages/indy-vdr/tests/indy-vdr-indy-did-resolver.e2e.test.ts | 2 ++ packages/indy-vdr/tests/indy-vdr-sov-did-resolver.e2e.test.ts | 2 ++ 4 files changed, 8 insertions(+) diff --git a/packages/indy-vdr/tests/indy-vdr-anoncreds-registry.e2e.test.ts b/packages/indy-vdr/tests/indy-vdr-anoncreds-registry.e2e.test.ts index f3448d169a..1cba5741e0 100644 --- a/packages/indy-vdr/tests/indy-vdr-anoncreds-registry.e2e.test.ts +++ b/packages/indy-vdr/tests/indy-vdr-anoncreds-registry.e2e.test.ts @@ -1,4 +1,5 @@ import { Agent, DidsModule, Key, KeyType, TypedArrayEncoder } from '@aries-framework/core' +import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { RevocationRegistryDefinitionRequest, RevocationRegistryEntryRequest } from '@hyperledger/indy-vdr-shared' import { @@ -25,6 +26,7 @@ const agent = new Agent({ dependencies: agentDependencies, modules: { indyVdr: new IndyVdrModule({ + indyVdr, networks: indyVdrModuleConfig.networks, }), indySdk: new IndySdkModule({ diff --git a/packages/indy-vdr/tests/indy-vdr-did-registrar.e2e.test.ts b/packages/indy-vdr/tests/indy-vdr-did-registrar.e2e.test.ts index 65eee36cf3..b4b66f4449 100644 --- a/packages/indy-vdr/tests/indy-vdr-did-registrar.e2e.test.ts +++ b/packages/indy-vdr/tests/indy-vdr-did-registrar.e2e.test.ts @@ -11,6 +11,7 @@ import { Agent, DidsModule, } from '@aries-framework/core' +import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { convertPublicKeyToX25519, generateKeyPairFromSeed } from '@stablelib/ed25519' import { getAgentOptions, importExistingIndyDidFromPrivateKey } from '../../core/tests/helpers' @@ -30,6 +31,7 @@ const agent = new Agent( {}, { indyVdr: new IndyVdrModule({ + indyVdr, networks: indyVdrModuleConfig.networks, }), indySdk: new IndySdkModule({ diff --git a/packages/indy-vdr/tests/indy-vdr-indy-did-resolver.e2e.test.ts b/packages/indy-vdr/tests/indy-vdr-indy-did-resolver.e2e.test.ts index 209b05e698..92068e5690 100644 --- a/packages/indy-vdr/tests/indy-vdr-indy-did-resolver.e2e.test.ts +++ b/packages/indy-vdr/tests/indy-vdr-indy-did-resolver.e2e.test.ts @@ -1,4 +1,5 @@ import { DidsModule, Agent, TypedArrayEncoder, JsonTransformer } from '@aries-framework/core' +import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { getAgentOptions, importExistingIndyDidFromPrivateKey } from '../../core/tests/helpers' import { IndySdkModule } from '../../indy-sdk/src' @@ -14,6 +15,7 @@ const agent = new Agent( {}, { indyVdr: new IndyVdrModule({ + indyVdr, networks: indyVdrModuleConfig.networks, }), indySdk: new IndySdkModule({ diff --git a/packages/indy-vdr/tests/indy-vdr-sov-did-resolver.e2e.test.ts b/packages/indy-vdr/tests/indy-vdr-sov-did-resolver.e2e.test.ts index 2ff501c641..14b2a7e202 100644 --- a/packages/indy-vdr/tests/indy-vdr-sov-did-resolver.e2e.test.ts +++ b/packages/indy-vdr/tests/indy-vdr-sov-did-resolver.e2e.test.ts @@ -1,4 +1,5 @@ import { DidsModule, Agent, TypedArrayEncoder, JsonTransformer } from '@aries-framework/core' +import { indyVdr } from '@hyperledger/indy-vdr-nodejs' import { getAgentOptions, importExistingIndyDidFromPrivateKey } from '../../core/tests/helpers' import { IndySdkModule } from '../../indy-sdk/src' @@ -15,6 +16,7 @@ const agent = new Agent( {}, { indyVdr: new IndyVdrModule({ + indyVdr, networks: indyVdrModuleConfig.networks, }), indySdk: new IndySdkModule({ From 1bc4d8cbbfa8c885089c41d70d5badb0c78cb5a4 Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Sat, 11 Mar 2023 12:36:35 +0100 Subject: [PATCH 16/23] mediation timeout Signed-off-by: Timo Glastra --- .../core/src/modules/routing/__tests__/mediation.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/core/src/modules/routing/__tests__/mediation.test.ts b/packages/core/src/modules/routing/__tests__/mediation.test.ts index 8554984d2f..8fd1661838 100644 --- a/packages/core/src/modules/routing/__tests__/mediation.test.ts +++ b/packages/core/src/modules/routing/__tests__/mediation.test.ts @@ -10,6 +10,7 @@ import { SubjectOutboundTransport } from '../../../../../../tests/transport/Subj import { getIndySdkModules } from '../../../../../indy-sdk/tests/setupIndySdkModule' import { getAgentOptions, waitForBasicMessage } from '../../../../tests/helpers' import { Agent } from '../../../agent/Agent' +import { sleep } from '../../../utils/sleep' import { ConnectionRecord, HandshakeProtocol } from '../../connections' import { MediatorPickupStrategy } from '../MediatorPickupStrategy' import { MediationState } from '../models/MediationState' @@ -143,6 +144,10 @@ describe('mediator establishment', () => { content: message, }) + // polling interval is 100ms, so 500ms should be enough to make sure no messages are sent + await recipientAgent.mediationRecipient.stopMessagePickup() + await sleep(500) + expect(basicMessage.content).toBe(message) } @@ -159,6 +164,7 @@ describe('mediator establishment', () => { config: { ...recipientAgentOptions.config, mediatorPickupStrategy: MediatorPickupStrategy.PickUpV1, + mediatorPollingInterval: 100, }, }) }) @@ -175,6 +181,7 @@ describe('mediator establishment', () => { ...recipientAgentOptions.config, mediatorPickupStrategy: MediatorPickupStrategy.PickUpV1, useDidKeyInProtocols: false, + mediatorPollingInterval: 100, }, } ) From 2853c2e62134383f0faeea90866110f2f752dc65 Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Sat, 11 Mar 2023 12:47:18 +0100 Subject: [PATCH 17/23] style Signed-off-by: Timo Glastra --- .../indy-vdr/src/dids/__tests__/IndyVdrSovDidResolver.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/indy-vdr/src/dids/__tests__/IndyVdrSovDidResolver.test.ts b/packages/indy-vdr/src/dids/__tests__/IndyVdrSovDidResolver.test.ts index a5a3c73958..0ed14f5856 100644 --- a/packages/indy-vdr/src/dids/__tests__/IndyVdrSovDidResolver.test.ts +++ b/packages/indy-vdr/src/dids/__tests__/IndyVdrSovDidResolver.test.ts @@ -1,4 +1,5 @@ import { JsonTransformer } from '@aries-framework/core' + import { parseDid } from '../../../../core/src/modules/dids/domain/parse' import { getAgentConfig, getAgentContext, mockProperty } from '../../../../core/tests/helpers' import { IndyVdrPool } from '../../pool/IndyVdrPool' From d42668c3f080e9a72ae5b9709dc53317224bda49 Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Sat, 11 Mar 2023 14:12:11 +0100 Subject: [PATCH 18/23] pin indy-vdr to 9 Signed-off-by: Timo Glastra --- demo/package.json | 2 +- packages/indy-vdr/package.json | 4 ++-- yarn.lock | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/demo/package.json b/demo/package.json index f174a2ecc2..c0fd02e87d 100644 --- a/demo/package.json +++ b/demo/package.json @@ -14,7 +14,7 @@ "refresh": "rm -rf ./node_modules ./yarn.lock && yarn" }, "dependencies": { - "@hyperledger/indy-vdr-nodejs": "^0.1.0-dev.10", + "@hyperledger/indy-vdr-nodejs": "0.1.0-dev.9", "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.6", "@hyperledger/aries-askar-nodejs": "^0.1.0-dev.4" }, diff --git a/packages/indy-vdr/package.json b/packages/indy-vdr/package.json index 98b6d946f5..9bd541328e 100644 --- a/packages/indy-vdr/package.json +++ b/packages/indy-vdr/package.json @@ -26,10 +26,10 @@ "dependencies": { "@aries-framework/anoncreds": "0.3.3", "@aries-framework/core": "0.3.3", - "@hyperledger/indy-vdr-shared": "^0.1.0-dev.10" + "@hyperledger/indy-vdr-shared": "0.1.0-dev.9" }, "devDependencies": { - "@hyperledger/indy-vdr-nodejs": "^0.1.0-dev.10", + "@hyperledger/indy-vdr-nodejs": "0.1.0-dev.9", "@stablelib/ed25519": "^1.0.2", "rimraf": "^4.0.7", "rxjs": "^7.2.0", diff --git a/yarn.lock b/yarn.lock index 4cd5d1ffae..f2bca2b74f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -902,22 +902,22 @@ dependencies: fast-text-encoding "^1.0.3" -"@hyperledger/indy-vdr-nodejs@^0.1.0-dev.10": - version "0.1.0-dev.10" - resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-nodejs/-/indy-vdr-nodejs-0.1.0-dev.10.tgz#f5fc988b3c11766475f7f084f814af8a4eca0caf" - integrity sha512-wETVax9HRidhRTRiRqwLTj/looNCvjZ3vdqMoqmPbmet5sM9eRkU9v4ipz4paqz4LiZipTx2fisLyYskKW9g6A== +"@hyperledger/indy-vdr-nodejs@0.1.0-dev.9": + version "0.1.0-dev.9" + resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-nodejs/-/indy-vdr-nodejs-0.1.0-dev.9.tgz#11552e7bcfb3eb9ebeceb9021be5aa775ab5a881" + integrity sha512-5tw1b7LbCInFn6KDL8TYIicHpndDwMOxMZkAjmOIUopK7CzHV7DM56UgCF3SUajxkPln1vreBqEuGAMiiTl70Q== dependencies: - "@hyperledger/indy-vdr-shared" "0.1.0-dev.10" + "@hyperledger/indy-vdr-shared" "0.1.0-dev.9" "@mapbox/node-pre-gyp" "^1.0.10" ffi-napi "^4.0.3" ref-array-di "^1.2.2" ref-napi "^3.0.3" ref-struct-di "^1.1.1" -"@hyperledger/indy-vdr-shared@0.1.0-dev.10", "@hyperledger/indy-vdr-shared@^0.1.0-dev.10": - version "0.1.0-dev.10" - resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-shared/-/indy-vdr-shared-0.1.0-dev.10.tgz#2a6d09a3a6ae3458ae9209ab7b6f09435e88b9c9" - integrity sha512-7fr9/Iliu0u94qE8u1g/RoLJOwMH0kFdclttwBHfTAKTQyfoXUPe1yIZ8ITRgLwnmFYPQpRa54lU+uv15c37fg== +"@hyperledger/indy-vdr-shared@0.1.0-dev.9": + version "0.1.0-dev.9" + resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-shared/-/indy-vdr-shared-0.1.0-dev.9.tgz#b257c1ca75690812598e4606386c618e652d3f8c" + integrity sha512-n7W0YYVRad2AFD13RtZJ+xduUyz2Th6erfVW+7w21K04whyhsoPj9VTda2PtFGzPPNbZzrzRyEwdYNzsvy2GXQ== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" From 805af9a74a2e28001306cba979061afbef92d41c Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Fri, 17 Mar 2023 13:52:03 +0100 Subject: [PATCH 19/23] chore: update hyperledger deps Signed-off-by: Timo Glastra --- demo/package.json | 6 ++-- packages/anoncreds-rs/package.json | 4 +-- packages/askar/package.json | 4 +-- packages/indy-vdr/package.json | 4 +-- yarn.lock | 54 +++++++++++++++--------------- 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/demo/package.json b/demo/package.json index c0fd02e87d..a5b10d5b1c 100644 --- a/demo/package.json +++ b/demo/package.json @@ -14,9 +14,9 @@ "refresh": "rm -rf ./node_modules ./yarn.lock && yarn" }, "dependencies": { - "@hyperledger/indy-vdr-nodejs": "0.1.0-dev.9", - "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.6", - "@hyperledger/aries-askar-nodejs": "^0.1.0-dev.4" + "@hyperledger/indy-vdr-nodejs": "0.1.0-dev.11", + "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.10", + "@hyperledger/aries-askar-nodejs": "^0.1.0-dev.5" }, "devDependencies": { "@aries-framework/anoncreds": "*", diff --git a/packages/anoncreds-rs/package.json b/packages/anoncreds-rs/package.json index 1539c8dd9d..cbb80f2623 100644 --- a/packages/anoncreds-rs/package.json +++ b/packages/anoncreds-rs/package.json @@ -26,14 +26,14 @@ "dependencies": { "@aries-framework/core": "0.3.3", "@aries-framework/anoncreds": "0.3.3", - "@hyperledger/anoncreds-shared": "^0.1.0-dev.9", + "@hyperledger/anoncreds-shared": "^0.1.0-dev.10", "class-transformer": "^0.5.1", "class-validator": "^0.14.0", "rxjs": "^7.2.0", "tsyringe": "^4.7.0" }, "devDependencies": { - "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.9", + "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.10", "rimraf": "^4.0.7", "typescript": "~4.9.4" } diff --git a/packages/askar/package.json b/packages/askar/package.json index dceb761c97..e30054715f 100644 --- a/packages/askar/package.json +++ b/packages/askar/package.json @@ -25,7 +25,7 @@ }, "dependencies": { "@aries-framework/core": "0.3.3", - "@hyperledger/aries-askar-shared": "^0.1.0-dev.4", + "@hyperledger/aries-askar-shared": "^0.1.0-dev.5", "bn.js": "^5.2.1", "class-transformer": "^0.5.1", "class-validator": "^0.14.0", @@ -34,7 +34,7 @@ }, "devDependencies": { "@types/bn.js": "^5.1.0", - "@hyperledger/aries-askar-nodejs": "^0.1.0-dev.4", + "@hyperledger/aries-askar-nodejs": "^0.1.0-dev.5", "reflect-metadata": "^0.1.13", "rimraf": "^4.0.7", "typescript": "~4.9.4" diff --git a/packages/indy-vdr/package.json b/packages/indy-vdr/package.json index 9bd541328e..ddf8810676 100644 --- a/packages/indy-vdr/package.json +++ b/packages/indy-vdr/package.json @@ -26,10 +26,10 @@ "dependencies": { "@aries-framework/anoncreds": "0.3.3", "@aries-framework/core": "0.3.3", - "@hyperledger/indy-vdr-shared": "0.1.0-dev.9" + "@hyperledger/indy-vdr-shared": "0.1.0-dev.11" }, "devDependencies": { - "@hyperledger/indy-vdr-nodejs": "0.1.0-dev.9", + "@hyperledger/indy-vdr-nodejs": "0.1.0-dev.11", "@stablelib/ed25519": "^1.0.2", "rimraf": "^4.0.7", "rxjs": "^7.2.0", diff --git a/yarn.lock b/yarn.lock index 17b793081f..09791228c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -864,12 +864,12 @@ resolved "https://registry.yarnpkg.com/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340" integrity sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q== -"@hyperledger/anoncreds-nodejs@^0.1.0-dev.9": - version "0.1.0-dev.9" - resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-nodejs/-/anoncreds-nodejs-0.1.0-dev.9.tgz#5f09d5f147ce204abd9b3cea486c23e556cc8fdc" - integrity sha512-Ht5Gt1DfnFiRIY+AlTpe8Hcdryb+jKl79hGQ3kszdct/1JFZ70A81ssfwX0VKYTdCHt5jK5cJzVaOjOVmBKZiw== +"@hyperledger/anoncreds-nodejs@^0.1.0-dev.10", "@hyperledger/anoncreds-nodejs@^0.1.0-dev.6": + version "0.1.0-dev.10" + resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-nodejs/-/anoncreds-nodejs-0.1.0-dev.10.tgz#80c093ecb08a277fb494399b64aad1b900c3103f" + integrity sha512-ju5mJPwuyebAPziuf+eUOwxEws02G2FHEp/qG3GV3kxtlx7THW7HVB7dMSNqhRVKCsbcNnZtWJB1UiPvWqboUg== dependencies: - "@hyperledger/anoncreds-shared" "0.1.0-dev.9" + "@hyperledger/anoncreds-shared" "0.1.0-dev.10" "@mapbox/node-pre-gyp" "^1.0.10" ffi-napi "4.0.3" node-cache "5.1.2" @@ -877,17 +877,17 @@ ref-napi "3.0.3" ref-struct-di "1.1.1" -"@hyperledger/anoncreds-shared@0.1.0-dev.9", "@hyperledger/anoncreds-shared@^0.1.0-dev.9": - version "0.1.0-dev.9" - resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-shared/-/anoncreds-shared-0.1.0-dev.9.tgz#7f6a033997e2641432a51ff2b609d603b3f9ab50" - integrity sha512-xbWEB9Z9PwkxC2awx74xt1OULMxihbK2v7818Dtrrmun75gNBXF8Jdorn9+t+TEd62QLrJpVUJ1ZCKhXPx81zw== +"@hyperledger/anoncreds-shared@0.1.0-dev.10", "@hyperledger/anoncreds-shared@^0.1.0-dev.10": + version "0.1.0-dev.10" + resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-shared/-/anoncreds-shared-0.1.0-dev.10.tgz#9d67f64e98ff41971644c95b03dabafd741df4df" + integrity sha512-POvcwQrUcPrwoZehQa38pN1dnjyeUlrQ6VlksbBRS8SUHJuyixZsD+d3XoumqaNfl9Z1DCjfuOgEiPlec01gXQ== -"@hyperledger/aries-askar-nodejs@^0.1.0-dev.4": - version "0.1.0-dev.4" - resolved "https://registry.yarnpkg.com/@hyperledger/aries-askar-nodejs/-/aries-askar-nodejs-0.1.0-dev.4.tgz#016f89886732366eff9cba54eb6fcbf02cc5a212" - integrity sha512-Wh1SoxakBpQvgbFrLq+NIJ0l02N8SjBRDZBs/c55gIeenXzDJY/ZgfM6faLdDv4XeE6agXd4yl35f4s7+3zK+Q== +"@hyperledger/aries-askar-nodejs@^0.1.0-dev.5": + version "0.1.0-dev.5" + resolved "https://registry.yarnpkg.com/@hyperledger/aries-askar-nodejs/-/aries-askar-nodejs-0.1.0-dev.5.tgz#602db32f49dd1f9e7f83d378a9813d2bde5886f8" + integrity sha512-38lXtmnhhca+s14V3zTefAyZGIg6nRpKi4Emnr1q5hQXmn1WZn7/ybYJbcI/VHoAPNLA+DydSI99U5KuPkrC1w== dependencies: - "@hyperledger/aries-askar-shared" "0.1.0-dev.4" + "@hyperledger/aries-askar-shared" "0.1.0-dev.5" "@mapbox/node-pre-gyp" "^1.0.10" ffi-napi "^4.0.3" node-cache "^5.1.2" @@ -895,29 +895,29 @@ ref-napi "^3.0.3" ref-struct-di "^1.1.1" -"@hyperledger/aries-askar-shared@0.1.0-dev.4", "@hyperledger/aries-askar-shared@^0.1.0-dev.4": - version "0.1.0-dev.4" - resolved "https://registry.yarnpkg.com/@hyperledger/aries-askar-shared/-/aries-askar-shared-0.1.0-dev.4.tgz#439fbaa3911be56c134cbacfddd1553eb0b06dde" - integrity sha512-z+bWVbFD3S7IuYlG2XTxCjyaJWmS/wiHtYRxgWXjF6o4iR2vW+/y0NhTpiX2gO4Gx62zxFfh50b0oQTOM6/XqQ== +"@hyperledger/aries-askar-shared@0.1.0-dev.5", "@hyperledger/aries-askar-shared@^0.1.0-dev.5": + version "0.1.0-dev.5" + resolved "https://registry.yarnpkg.com/@hyperledger/aries-askar-shared/-/aries-askar-shared-0.1.0-dev.5.tgz#06ae815b873693b7b483004d027059d50f24fb60" + integrity sha512-nufXqMslytelijC0uXBTuaj9OHjHo5mJe0hABKfYJqe9p1RYmmKlnqi+B/mjWrr2R8yG8NLrNnHbwPcBArLrPA== dependencies: fast-text-encoding "^1.0.3" -"@hyperledger/indy-vdr-nodejs@^0.1.0-dev.10": - version "0.1.0-dev.10" - resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-nodejs/-/indy-vdr-nodejs-0.1.0-dev.10.tgz#f5fc988b3c11766475f7f084f814af8a4eca0caf" - integrity sha512-wETVax9HRidhRTRiRqwLTj/looNCvjZ3vdqMoqmPbmet5sM9eRkU9v4ipz4paqz4LiZipTx2fisLyYskKW9g6A== +"@hyperledger/indy-vdr-nodejs@0.1.0-dev.11": + version "0.1.0-dev.11" + resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-nodejs/-/indy-vdr-nodejs-0.1.0-dev.11.tgz#376f16651aa03f0d9feb98880210e41c0e8dcb9a" + integrity sha512-gAz3vVB+r/cVR04nvMi2goqTfrn/yv0ihANaDloK/LKbzHXg4LHwR6Stu8aBoymwq/5ld1HUdVK9p8v/q797hg== dependencies: - "@hyperledger/indy-vdr-shared" "0.1.0-dev.10" + "@hyperledger/indy-vdr-shared" "0.1.0-dev.11" "@mapbox/node-pre-gyp" "^1.0.10" ffi-napi "^4.0.3" ref-array-di "^1.2.2" ref-napi "^3.0.3" ref-struct-di "^1.1.1" -"@hyperledger/indy-vdr-shared@0.1.0-dev.10", "@hyperledger/indy-vdr-shared@^0.1.0-dev.10": - version "0.1.0-dev.10" - resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-shared/-/indy-vdr-shared-0.1.0-dev.10.tgz#2a6d09a3a6ae3458ae9209ab7b6f09435e88b9c9" - integrity sha512-7fr9/Iliu0u94qE8u1g/RoLJOwMH0kFdclttwBHfTAKTQyfoXUPe1yIZ8ITRgLwnmFYPQpRa54lU+uv15c37fg== +"@hyperledger/indy-vdr-shared@0.1.0-dev.11": + version "0.1.0-dev.11" + resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-shared/-/indy-vdr-shared-0.1.0-dev.11.tgz#f0afc11dd63971914b74e7bd0b9222e4122cf3d5" + integrity sha512-FNJYrsWENZDe8jwOTAr9rqEHvTJg/8wPAwA8OqYgU6Ara1m9yWhoGveysrP5dxFAAZk2G5cLvB+QeshEw7d5bQ== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" From e4fcc3dcdf0af88afbbd5c48fe2a66e838b7e325 Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Sat, 18 Mar 2023 16:37:13 +0100 Subject: [PATCH 20/23] chore: update dependencies Signed-off-by: Timo Glastra --- demo/package.json | 6 +- packages/anoncreds-rs/package.json | 4 +- .../src/AnonCredsRsModuleConfig.ts | 4 ++ packages/anoncreds-rs/src/types.ts | 4 -- packages/anoncreds/package.json | 2 +- packages/askar/package.json | 4 +- packages/askar/src/AskarModule.ts | 1 + packages/askar/src/types.ts | 3 - packages/indy-vdr/package.json | 4 +- packages/indy-vdr/src/IndyVdrModuleConfig.ts | 1 + yarn.lock | 62 +++++++++++-------- 11 files changed, 51 insertions(+), 44 deletions(-) delete mode 100644 packages/anoncreds-rs/src/types.ts delete mode 100644 packages/askar/src/types.ts diff --git a/demo/package.json b/demo/package.json index a5b10d5b1c..289273b81d 100644 --- a/demo/package.json +++ b/demo/package.json @@ -14,9 +14,9 @@ "refresh": "rm -rf ./node_modules ./yarn.lock && yarn" }, "dependencies": { - "@hyperledger/indy-vdr-nodejs": "0.1.0-dev.11", - "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.10", - "@hyperledger/aries-askar-nodejs": "^0.1.0-dev.5" + "@hyperledger/indy-vdr-nodejs": "0.1.0-dev.12", + "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.11", + "@hyperledger/aries-askar-nodejs": "^0.1.0-dev.6" }, "devDependencies": { "@aries-framework/anoncreds": "*", diff --git a/packages/anoncreds-rs/package.json b/packages/anoncreds-rs/package.json index cbb80f2623..4405a1f3a0 100644 --- a/packages/anoncreds-rs/package.json +++ b/packages/anoncreds-rs/package.json @@ -26,14 +26,14 @@ "dependencies": { "@aries-framework/core": "0.3.3", "@aries-framework/anoncreds": "0.3.3", - "@hyperledger/anoncreds-shared": "^0.1.0-dev.10", + "@hyperledger/anoncreds-shared": "^0.1.0-dev.11", "class-transformer": "^0.5.1", "class-validator": "^0.14.0", "rxjs": "^7.2.0", "tsyringe": "^4.7.0" }, "devDependencies": { - "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.10", + "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.11", "rimraf": "^4.0.7", "typescript": "~4.9.4" } diff --git a/packages/anoncreds-rs/src/AnonCredsRsModuleConfig.ts b/packages/anoncreds-rs/src/AnonCredsRsModuleConfig.ts index 6c2d79a05f..2d676b4d52 100644 --- a/packages/anoncreds-rs/src/AnonCredsRsModuleConfig.ts +++ b/packages/anoncreds-rs/src/AnonCredsRsModuleConfig.ts @@ -51,4 +51,8 @@ export class AnonCredsRsModuleConfig { public constructor(options: AnonCredsRsModuleConfigOptions) { this.options = options } + + public get anoncreds() { + return this.options.anoncreds + } } diff --git a/packages/anoncreds-rs/src/types.ts b/packages/anoncreds-rs/src/types.ts deleted file mode 100644 index 2694976be7..0000000000 --- a/packages/anoncreds-rs/src/types.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Anoncreds } from '@hyperledger/anoncreds-shared' - -export const AnonCredsRsSymbol = Symbol('AnonCredsRs') -export type { Anoncreds } diff --git a/packages/anoncreds/package.json b/packages/anoncreds/package.json index 4619823e23..9f1ab9d6e2 100644 --- a/packages/anoncreds/package.json +++ b/packages/anoncreds/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@aries-framework/node": "0.3.3", - "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.6", + "@hyperledger/anoncreds-nodejs": "^0.1.0-dev.11", "indy-sdk": "^1.16.0-dev-1636", "rimraf": "^4.0.7", "rxjs": "^7.8.0", diff --git a/packages/askar/package.json b/packages/askar/package.json index e30054715f..57cd37143f 100644 --- a/packages/askar/package.json +++ b/packages/askar/package.json @@ -25,7 +25,7 @@ }, "dependencies": { "@aries-framework/core": "0.3.3", - "@hyperledger/aries-askar-shared": "^0.1.0-dev.5", + "@hyperledger/aries-askar-shared": "^0.1.0-dev.6", "bn.js": "^5.2.1", "class-transformer": "^0.5.1", "class-validator": "^0.14.0", @@ -34,7 +34,7 @@ }, "devDependencies": { "@types/bn.js": "^5.1.0", - "@hyperledger/aries-askar-nodejs": "^0.1.0-dev.5", + "@hyperledger/aries-askar-nodejs": "^0.1.0-dev.6", "reflect-metadata": "^0.1.13", "rimraf": "^4.0.7", "typescript": "~4.9.4" diff --git a/packages/askar/src/AskarModule.ts b/packages/askar/src/AskarModule.ts index a4830865ee..8a22d82323 100644 --- a/packages/askar/src/AskarModule.ts +++ b/packages/askar/src/AskarModule.ts @@ -13,6 +13,7 @@ export class AskarModule implements Module { public constructor(config: AskarModuleConfigOptions) { this.config = new AskarModuleConfig(config) } + public register(dependencyManager: DependencyManager) { dependencyManager.registerInstance(AskarModuleConfig, this.config) diff --git a/packages/askar/src/types.ts b/packages/askar/src/types.ts deleted file mode 100644 index bc0baa2947..0000000000 --- a/packages/askar/src/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { AriesAskar } from '@hyperledger/aries-askar-shared' - -export type { AriesAskar } diff --git a/packages/indy-vdr/package.json b/packages/indy-vdr/package.json index ddf8810676..f7eee340a7 100644 --- a/packages/indy-vdr/package.json +++ b/packages/indy-vdr/package.json @@ -26,10 +26,10 @@ "dependencies": { "@aries-framework/anoncreds": "0.3.3", "@aries-framework/core": "0.3.3", - "@hyperledger/indy-vdr-shared": "0.1.0-dev.11" + "@hyperledger/indy-vdr-shared": "0.1.0-dev.12" }, "devDependencies": { - "@hyperledger/indy-vdr-nodejs": "0.1.0-dev.11", + "@hyperledger/indy-vdr-nodejs": "0.1.0-dev.12", "@stablelib/ed25519": "^1.0.2", "rimraf": "^4.0.7", "rxjs": "^7.2.0", diff --git a/packages/indy-vdr/src/IndyVdrModuleConfig.ts b/packages/indy-vdr/src/IndyVdrModuleConfig.ts index ce61d3bbb0..086846ddf7 100644 --- a/packages/indy-vdr/src/IndyVdrModuleConfig.ts +++ b/packages/indy-vdr/src/IndyVdrModuleConfig.ts @@ -71,6 +71,7 @@ export class IndyVdrModuleConfig { return this.options.networks } + /** See {@link IndyVdrModuleConfigOptions.indyVdr} */ public get indyVdr() { return this.options.indyVdr } diff --git a/yarn.lock b/yarn.lock index 09791228c5..dab29c0369 100644 --- a/yarn.lock +++ b/yarn.lock @@ -864,12 +864,12 @@ resolved "https://registry.yarnpkg.com/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340" integrity sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q== -"@hyperledger/anoncreds-nodejs@^0.1.0-dev.10", "@hyperledger/anoncreds-nodejs@^0.1.0-dev.6": - version "0.1.0-dev.10" - resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-nodejs/-/anoncreds-nodejs-0.1.0-dev.10.tgz#80c093ecb08a277fb494399b64aad1b900c3103f" - integrity sha512-ju5mJPwuyebAPziuf+eUOwxEws02G2FHEp/qG3GV3kxtlx7THW7HVB7dMSNqhRVKCsbcNnZtWJB1UiPvWqboUg== +"@hyperledger/anoncreds-nodejs@^0.1.0-dev.11": + version "0.1.0-dev.11" + resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-nodejs/-/anoncreds-nodejs-0.1.0-dev.11.tgz#301b9bc5a4bb0235212ac48da2bf41118b407cdd" + integrity sha512-4BSHOGOdXjF4pyJuEjwk0iaSHeqt5UdXRXNv+u9VJ7yYhqM/aJZNhtUAgHXu8KGZwimFcFsp2e0FoLqwO0vLHQ== dependencies: - "@hyperledger/anoncreds-shared" "0.1.0-dev.10" + "@hyperledger/anoncreds-shared" "0.1.0-dev.11" "@mapbox/node-pre-gyp" "^1.0.10" ffi-napi "4.0.3" node-cache "5.1.2" @@ -877,17 +877,17 @@ ref-napi "3.0.3" ref-struct-di "1.1.1" -"@hyperledger/anoncreds-shared@0.1.0-dev.10", "@hyperledger/anoncreds-shared@^0.1.0-dev.10": - version "0.1.0-dev.10" - resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-shared/-/anoncreds-shared-0.1.0-dev.10.tgz#9d67f64e98ff41971644c95b03dabafd741df4df" - integrity sha512-POvcwQrUcPrwoZehQa38pN1dnjyeUlrQ6VlksbBRS8SUHJuyixZsD+d3XoumqaNfl9Z1DCjfuOgEiPlec01gXQ== +"@hyperledger/anoncreds-shared@0.1.0-dev.11", "@hyperledger/anoncreds-shared@^0.1.0-dev.11": + version "0.1.0-dev.11" + resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-shared/-/anoncreds-shared-0.1.0-dev.11.tgz#206328cabcd855ef20c863ab5c2615a3a4c2502c" + integrity sha512-nK05y/qNtI3P+hnkVZW/d5oduMa7slZfEh2gQ+ZmAEmwHEcSU8iJ+QTkKS3nRE+6igXUvVAztlGS7JZHf21KKw== -"@hyperledger/aries-askar-nodejs@^0.1.0-dev.5": - version "0.1.0-dev.5" - resolved "https://registry.yarnpkg.com/@hyperledger/aries-askar-nodejs/-/aries-askar-nodejs-0.1.0-dev.5.tgz#602db32f49dd1f9e7f83d378a9813d2bde5886f8" - integrity sha512-38lXtmnhhca+s14V3zTefAyZGIg6nRpKi4Emnr1q5hQXmn1WZn7/ybYJbcI/VHoAPNLA+DydSI99U5KuPkrC1w== +"@hyperledger/aries-askar-nodejs@^0.1.0-dev.6": + version "0.1.0-dev.6" + resolved "https://registry.yarnpkg.com/@hyperledger/aries-askar-nodejs/-/aries-askar-nodejs-0.1.0-dev.6.tgz#1067196269e3dc7904afa946234e069c31dfc2d9" + integrity sha512-VHORF/VbXXNA0zevS8diocVFfHpqp8XS33VuIEDFEG9n87Sc4sO0KxxCr5KdGeAf46yhiCdJd2bOKRjDHCObyQ== dependencies: - "@hyperledger/aries-askar-shared" "0.1.0-dev.5" + "@hyperledger/aries-askar-shared" "0.1.0-dev.6" "@mapbox/node-pre-gyp" "^1.0.10" ffi-napi "^4.0.3" node-cache "^5.1.2" @@ -895,29 +895,30 @@ ref-napi "^3.0.3" ref-struct-di "^1.1.1" -"@hyperledger/aries-askar-shared@0.1.0-dev.5", "@hyperledger/aries-askar-shared@^0.1.0-dev.5": - version "0.1.0-dev.5" - resolved "https://registry.yarnpkg.com/@hyperledger/aries-askar-shared/-/aries-askar-shared-0.1.0-dev.5.tgz#06ae815b873693b7b483004d027059d50f24fb60" - integrity sha512-nufXqMslytelijC0uXBTuaj9OHjHo5mJe0hABKfYJqe9p1RYmmKlnqi+B/mjWrr2R8yG8NLrNnHbwPcBArLrPA== +"@hyperledger/aries-askar-shared@0.1.0-dev.6", "@hyperledger/aries-askar-shared@^0.1.0-dev.6": + version "0.1.0-dev.6" + resolved "https://registry.yarnpkg.com/@hyperledger/aries-askar-shared/-/aries-askar-shared-0.1.0-dev.6.tgz#af3bf4318312ee1af0ead8c0bea6a4445a265525" + integrity sha512-P62u1GNw2hvFh3T8hYTBiD2YsIzHIQOwa8+p8wEhB0AJi7Ixc3OcAtxxgbreosDtGrW+cxkinuSqufveuK9V1g== dependencies: fast-text-encoding "^1.0.3" -"@hyperledger/indy-vdr-nodejs@0.1.0-dev.11": - version "0.1.0-dev.11" - resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-nodejs/-/indy-vdr-nodejs-0.1.0-dev.11.tgz#376f16651aa03f0d9feb98880210e41c0e8dcb9a" - integrity sha512-gAz3vVB+r/cVR04nvMi2goqTfrn/yv0ihANaDloK/LKbzHXg4LHwR6Stu8aBoymwq/5ld1HUdVK9p8v/q797hg== +"@hyperledger/indy-vdr-nodejs@0.1.0-dev.12": + version "0.1.0-dev.12" + resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-nodejs/-/indy-vdr-nodejs-0.1.0-dev.12.tgz#c8966bf5f446fff4c7bf0bf5afb4159159d2dd9e" + integrity sha512-rJDkk4u0zyn3n/PBw0pf3qSgbZ0n5VAJY5ykeMU2/bBfFXQ1KJex/148M4YsGEOxY0XUSoXgcT/oJYS3MSA6Nw== dependencies: - "@hyperledger/indy-vdr-shared" "0.1.0-dev.11" + "@hyperledger/indy-vdr-shared" "0.1.0-dev.12" "@mapbox/node-pre-gyp" "^1.0.10" + "@types/ref-array-di" "^1.2.5" ffi-napi "^4.0.3" ref-array-di "^1.2.2" ref-napi "^3.0.3" ref-struct-di "^1.1.1" -"@hyperledger/indy-vdr-shared@0.1.0-dev.11": - version "0.1.0-dev.11" - resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-shared/-/indy-vdr-shared-0.1.0-dev.11.tgz#f0afc11dd63971914b74e7bd0b9222e4122cf3d5" - integrity sha512-FNJYrsWENZDe8jwOTAr9rqEHvTJg/8wPAwA8OqYgU6Ara1m9yWhoGveysrP5dxFAAZk2G5cLvB+QeshEw7d5bQ== +"@hyperledger/indy-vdr-shared@0.1.0-dev.12": + version "0.1.0-dev.12" + resolved "https://registry.yarnpkg.com/@hyperledger/indy-vdr-shared/-/indy-vdr-shared-0.1.0-dev.12.tgz#a5051cb91b7698f80265b7506789fb50490477e2" + integrity sha512-CPVGTHVLFAVVU6uIhcbhAUWqDrn3u2R3D+ALdqgKwJY1Ca8kFiUvhFN1/DkHtZuEo549wPQmFqH2hCkXaiuF7Q== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -2684,6 +2685,13 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/ref-array-di@^1.2.5": + version "1.2.5" + resolved "https://registry.yarnpkg.com/@types/ref-array-di/-/ref-array-di-1.2.5.tgz#822b9be5b934398fafd5c26264d8de80d487747d" + integrity sha512-dA/Himb7ca/Tf5vqLOhi7LewAAoOXghlocw7gAqvNrmLybAtu+w2BLzEsbFWAtx5ElNzMEHDaRybueYViFROjQ== + dependencies: + "@types/ref-napi" "*" + "@types/ref-napi@*", "@types/ref-napi@^3.0.4": version "3.0.7" resolved "https://registry.yarnpkg.com/@types/ref-napi/-/ref-napi-3.0.7.tgz#20adc93a7a2f9f992dfb17409fd748e6f4bf403d" From 07c04302d633be5221d9ab207c6ced96b65d1bfb Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Sat, 18 Mar 2023 23:13:04 +0100 Subject: [PATCH 21/23] fix: yarn.lock Signed-off-by: Timo Glastra --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index abdb5103bb..dab29c0369 100644 --- a/yarn.lock +++ b/yarn.lock @@ -893,7 +893,7 @@ node-cache "^5.1.2" ref-array-di "^1.2.2" ref-napi "^3.0.3" - ref-struct-di "^1.1.1 + ref-struct-di "^1.1.1" "@hyperledger/aries-askar-shared@0.1.0-dev.6", "@hyperledger/aries-askar-shared@^0.1.0-dev.6": version "0.1.0-dev.6" From bfc8b9e1e1dd3b12d207bc601f813d2fb6fbde8f Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Sat, 18 Mar 2023 23:14:00 +0100 Subject: [PATCH 22/23] chore: same version askar Signed-off-by: Timo Glastra --- packages/indy-sdk-to-askar-migration/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/indy-sdk-to-askar-migration/package.json b/packages/indy-sdk-to-askar-migration/package.json index 87373300f3..5f8171a183 100644 --- a/packages/indy-sdk-to-askar-migration/package.json +++ b/packages/indy-sdk-to-askar-migration/package.json @@ -29,10 +29,10 @@ "@aries-framework/core": "^0.3.3", "@aries-framework/indy-sdk": "^0.3.3", "@aries-framework/node": "^0.3.3", - "@hyperledger/aries-askar-shared": "^0.1.0-dev.5" + "@hyperledger/aries-askar-shared": "^0.1.0-dev.6" }, "devDependencies": { - "@hyperledger/aries-askar-nodejs": "^0.1.0-dev.5", + "@hyperledger/aries-askar-nodejs": "^0.1.0-dev.6", "indy-sdk": "^1.16.0-dev-1655", "rimraf": "^4.0.7", "typescript": "~4.9.4" From 8eec9eb7bb9da81d782c99459e3116a4dfecc9b2 Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Sat, 18 Mar 2023 23:59:40 +0100 Subject: [PATCH 23/23] fix: askar Signed-off-by: Timo Glastra --- .../tests/migrate.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/indy-sdk-to-askar-migration/tests/migrate.test.ts b/packages/indy-sdk-to-askar-migration/tests/migrate.test.ts index 5d8b6f64ab..a5bd7e87b2 100644 --- a/packages/indy-sdk-to-askar-migration/tests/migrate.test.ts +++ b/packages/indy-sdk-to-askar-migration/tests/migrate.test.ts @@ -44,7 +44,11 @@ describeRunInNodeVersion([18], 'Indy SDK To Askar Migration', () => { const invalidNewAgent = new Agent({ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion config: { ...invalidConfig, walletConfig: { ...invalidConfig.walletConfig!, key: 'wrong-key' } }, - modules: { askar: new AskarModule() }, + modules: { + askar: new AskarModule({ + ariesAskar, + }), + }, dependencies: agentDependencies, }) @@ -58,7 +62,11 @@ describeRunInNodeVersion([18], 'Indy SDK To Askar Migration', () => { const newAgent = new Agent({ config, - modules: { askar: new AskarModule() }, + modules: { + askar: new AskarModule({ + ariesAskar, + }), + }, dependencies: agentDependencies, })