diff --git a/__tests__/localAgent.test.ts b/__tests__/localAgent.test.ts index 4351c64fb..583cf14fd 100644 --- a/__tests__/localAgent.test.ts +++ b/__tests__/localAgent.test.ts @@ -17,6 +17,7 @@ import { JwtMessageHandler } from '../packages/did-jwt/src' import { CredentialIssuer, ICredentialIssuer, W3cMessageHandler } from '../packages/credential-w3c/src' import { EthrDIDProvider } from '../packages/did-provider-ethr/src' import { WebDIDProvider } from '../packages/did-provider-web/src' +import { KeyDIDProvider } from '../packages/did-provider-key/src' import { DIDComm, DIDCommMessageHandler, IDIDComm } from '../packages/did-comm/src' import { SelectiveDisclosure, @@ -120,6 +121,9 @@ const setup = async (options?: IAgentOptions): Promise => { 'did:web': new WebDIDProvider({ defaultKms: 'local', }), + 'did:key': new KeyDIDProvider({ + defaultKms: 'local', + }), }, }), new DIDResolverPlugin({ diff --git a/__tests__/localMemoryStoreAgent.test.ts b/__tests__/localMemoryStoreAgent.test.ts index 2146e547e..5a8a847dc 100644 --- a/__tests__/localMemoryStoreAgent.test.ts +++ b/__tests__/localMemoryStoreAgent.test.ts @@ -17,6 +17,7 @@ import { JwtMessageHandler } from '../packages/did-jwt/src' import { CredentialIssuer, ICredentialIssuer, W3cMessageHandler } from '../packages/credential-w3c/src' import { EthrDIDProvider } from '../packages/did-provider-ethr/src' import { WebDIDProvider } from '../packages/did-provider-web/src' +import { KeyDIDProvider } from '../packages/did-provider-key/src' import { DIDComm, DIDCommMessageHandler, IDIDComm } from '../packages/did-comm/src' import { SelectiveDisclosure, @@ -113,6 +114,9 @@ const setup = async (options?: IAgentOptions): Promise => { 'did:web': new WebDIDProvider({ defaultKms: 'local', }), + 'did:key': new KeyDIDProvider({ + defaultKms: 'local', + }), }, }), new DIDResolverPlugin({ diff --git a/__tests__/restAgent.test.ts b/__tests__/restAgent.test.ts index 8fa1d0c10..580d2fa33 100644 --- a/__tests__/restAgent.test.ts +++ b/__tests__/restAgent.test.ts @@ -19,6 +19,7 @@ import { JwtMessageHandler } from '../packages/did-jwt/src' import { CredentialIssuer, ICredentialIssuer, W3cMessageHandler } from '../packages/credential-w3c/src' import { EthrDIDProvider } from '../packages/did-provider-ethr/src' import { WebDIDProvider } from '../packages/did-provider-web/src' +import { KeyDIDProvider } from '../packages/did-provider-key/src' import { DIDComm, DIDCommMessageHandler, IDIDComm } from '../packages/did-comm/src' import { SelectiveDisclosure, @@ -127,6 +128,9 @@ const setup = async (options?: IAgentOptions): Promise => { 'did:web': new WebDIDProvider({ defaultKms: 'local', }), + 'did:key': new KeyDIDProvider({ + defaultKms: 'local', + }), }, }), new DIDResolverPlugin({ diff --git a/__tests__/shared/didManager.ts b/__tests__/shared/didManager.ts index 20cee7616..442001381 100644 --- a/__tests__/shared/didManager.ts +++ b/__tests__/shared/didManager.ts @@ -19,7 +19,7 @@ export default (testContext: { it('should get providers', async () => { const providers = await agent.didManagerGetProviders() - expect(providers).toEqual(['did:ethr', 'did:ethr:rinkeby', 'did:web']) + expect(providers).toEqual(['did:ethr', 'did:ethr:rinkeby', 'did:web', 'did:key']) }) let identifier: IIdentifier @@ -73,6 +73,18 @@ export default (testContext: { expect(identifier3).toEqual(identifier4) + const identifierKey1 = await agent.didManagerGetOrCreate({ + alias: 'carol', + provider: 'did:key', + }) + + const identifierKey2 = await agent.didManagerGetOrCreate({ + alias: 'carol', + provider: 'did:key', + }) + + expect(identifierKey1).toEqual(identifierKey2) + const identifier5 = await agent.didManagerGetOrCreate({ alias: 'alice', provider: 'did:ethr', @@ -97,7 +109,7 @@ export default (testContext: { it('should get identifiers', async () => { const allIdentifiers = await agent.didManagerFind() - expect(allIdentifiers.length).toEqual(3) + expect(allIdentifiers.length).toEqual(4) const aliceIdentifiers = await agent.didManagerFind({ alias: 'alice', diff --git a/packages/cli/default/default.yml b/packages/cli/default/default.yml index 0184280d7..d36ed704f 100644 --- a/packages/cli/default/default.yml +++ b/packages/cli/default/default.yml @@ -260,6 +260,10 @@ didManager: $require: '@veramo/did-provider-web#WebDIDProvider' $args: - defaultKms: local + did:key: + $require: '@veramo/did-provider-key#KeyDIDProvider' + $args: + - defaultKms: local # Agent agent: diff --git a/packages/cli/package.json b/packages/cli/package.json index 3ee74c59f..fb07194d7 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -10,8 +10,8 @@ "scripts": { "build": "tsc", "watch": "tsc -b --watch", - "update-veramo-next": "yarn add @veramo/core@next @veramo/did-resolver@next @veramo/did-jwt@next @veramo/credential-w3c@next @veramo/did-provider-ethr@next @veramo/did-provider-web@next @veramo/did-comm@next @veramo/kms-local@next @veramo/selective-disclosure@next @veramo/data-store@next @veramo/key-manager@next @veramo/message-handler@next @veramo/did-manager@next @veramo/url-handler@next", - "update-veramo-latest": "yarn add @veramo/core@latest @veramo/did-resolver@latest @veramo/did-jwt@latest @veramo/credential-w3c@latest @veramo/did-provider-ethr@latest @veramo/did-provider-web@latest @veramo/did-comm@latest @veramo/kms-local@latest @veramo/selective-disclosure@latest @veramo/data-store@latest @veramo/key-manager@latest @veramo/message-handler@latest @veramo/did-manager@latest @veramo/url-handler@latest" + "update-veramo-next": "yarn add @veramo/core@next @veramo/remote-client@next @veramo/remote-server@next @veramo/did-provider-key@next @veramo/did-resolver@next @veramo/did-jwt@next @veramo/credential-w3c@next @veramo/did-provider-ethr@next @veramo/did-provider-web@next @veramo/did-comm@next @veramo/kms-local@next @veramo/selective-disclosure@next @veramo/data-store@next @veramo/key-manager@next @veramo/message-handler@next @veramo/did-manager@next @veramo/url-handler@next", + "update-veramo-latest": "yarn add @veramo/core@latest @veramo/remote-client@latest @veramo/remote-server@latest @veramo/did-provider-key@latest @veramo/did-resolver@latest @veramo/did-jwt@latest @veramo/credential-w3c@latest @veramo/did-provider-ethr@latest @veramo/did-provider-web@latest @veramo/did-comm@latest @veramo/kms-local@latest @veramo/selective-disclosure@latest @veramo/data-store@latest @veramo/key-manager@latest @veramo/message-handler@latest @veramo/did-manager@latest @veramo/url-handler@latest" }, "dependencies": { "@microsoft/api-extractor": "7.14.0", @@ -25,6 +25,7 @@ "@veramo/did-jwt": "^1.2.0", "@veramo/did-manager": "^1.2.0", "@veramo/did-provider-ethr": "^1.2.0", + "@veramo/did-provider-key": "^1.2.0", "@veramo/did-provider-web": "^1.2.0", "@veramo/did-resolver": "^1.2.0", "@veramo/key-manager": "^1.2.0", diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 61ed6b4e0..dde2a0e91 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -12,6 +12,7 @@ { "path": "../did-jwt" }, { "path": "../did-manager" }, { "path": "../did-provider-ethr" }, + { "path": "../did-provider-key" }, { "path": "../did-provider-web" }, { "path": "../did-resolver" }, { "path": "../key-manager" },