From 6626122f7457b67b88c6b5dbaaad7d384f251466 Mon Sep 17 00:00:00 2001 From: Krishna Date: Wed, 10 Apr 2024 16:41:28 +0530 Subject: [PATCH 01/13] fix: agent authentication Signed-off-by: Krishna --- src/controllers/agent/AgentController.ts | 2 +- src/routes/routes.ts | 2 +- src/routes/swagger.json | 2 +- src/securityMiddleware.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/controllers/agent/AgentController.ts b/src/controllers/agent/AgentController.ts index a7ec6fc6..79f42b26 100644 --- a/src/controllers/agent/AgentController.ts +++ b/src/controllers/agent/AgentController.ts @@ -19,7 +19,7 @@ export class AgentController extends Controller { /** * Retrieve basic agent information */ - @Get('/') + @Get('/info') public async getAgentInfo(): Promise { return { label: this.agent.config.label, diff --git a/src/routes/routes.ts b/src/routes/routes.ts index b206b41e..fcd74380 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -3747,7 +3747,7 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/agent', + app.get('/agent/info', ...(fetchMiddlewares(AgentController)), ...(fetchMiddlewares(AgentController.prototype.getAgentInfo)), diff --git a/src/routes/swagger.json b/src/routes/swagger.json index f31073a1..2b0de93a 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -9085,7 +9085,7 @@ } } }, - "/agent": { + "/agent/info": { "get": { "operationId": "GetAgentInfo", "responses": { diff --git a/src/securityMiddleware.ts b/src/securityMiddleware.ts index ea8a5199..c9cc000c 100644 --- a/src/securityMiddleware.ts +++ b/src/securityMiddleware.ts @@ -15,7 +15,7 @@ export class SecurityMiddleware { const routePath = request.path // List of paths for which authentication should be skipped - const pathsToSkipAuthentication = ['/url/', '/multi-tenancy/url/', '/agent'] + const pathsToSkipAuthentication = ['/url/', '/multi-tenancy/url/', '/agent/info'] // Check if authentication should be skipped for this route or controller const skipAuthentication = pathsToSkipAuthentication.some((path) => routePath.includes(path)) From 7baffd4c1d591812cdf7112081b9ad7c595c47b2 Mon Sep 17 00:00:00 2001 From: Krishna Date: Wed, 10 Apr 2024 17:04:28 +0530 Subject: [PATCH 02/13] fix: agent auth Signed-off-by: Krishna --- src/controllers/agent/AgentController.ts | 2 +- src/routes/routes.ts | 2 +- src/routes/swagger.json | 2 +- src/securityMiddleware.ts | 11 +++++++++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/controllers/agent/AgentController.ts b/src/controllers/agent/AgentController.ts index 79f42b26..a7ec6fc6 100644 --- a/src/controllers/agent/AgentController.ts +++ b/src/controllers/agent/AgentController.ts @@ -19,7 +19,7 @@ export class AgentController extends Controller { /** * Retrieve basic agent information */ - @Get('/info') + @Get('/') public async getAgentInfo(): Promise { return { label: this.agent.config.label, diff --git a/src/routes/routes.ts b/src/routes/routes.ts index fcd74380..b206b41e 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -3747,7 +3747,7 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/agent/info', + app.get('/agent', ...(fetchMiddlewares(AgentController)), ...(fetchMiddlewares(AgentController.prototype.getAgentInfo)), diff --git a/src/routes/swagger.json b/src/routes/swagger.json index 2b0de93a..f31073a1 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -9085,7 +9085,7 @@ } } }, - "/agent/info": { + "/agent": { "get": { "operationId": "GetAgentInfo", "responses": { diff --git a/src/securityMiddleware.ts b/src/securityMiddleware.ts index c9cc000c..75654c49 100644 --- a/src/securityMiddleware.ts +++ b/src/securityMiddleware.ts @@ -13,12 +13,19 @@ export class SecurityMiddleware { // Extract route path or controller name from the request const routePath = request.path + const requestMethod = request.method // List of paths for which authentication should be skipped - const pathsToSkipAuthentication = ['/url/', '/multi-tenancy/url/', '/agent/info'] + const pathsToSkipAuthentication = [ + { path: '/url/', method: 'GET' }, + { path: '/multi-tenancy/url/', method: 'GET' }, + { path: '/agent', method: 'GET' }, + ] // Check if authentication should be skipped for this route or controller - const skipAuthentication = pathsToSkipAuthentication.some((path) => routePath.includes(path)) + const skipAuthentication = pathsToSkipAuthentication.some( + ({ path, method }) => routePath.includes(path) && requestMethod === method + ) if (skipAuthentication) { // Skip authentication for this route or controller From 153010e60aa153628e47d0eb8259c574ef8b1106 Mon Sep 17 00:00:00 2001 From: KulkarniShashank Date: Fri, 12 Apr 2024 18:31:16 +0530 Subject: [PATCH 03/13] fix: specify Node.js version 18.19.0 in engines Signed-off-by: KulkarniShashank --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f67626f3..cf24a53a 100644 --- a/package.json +++ b/package.json @@ -100,6 +100,6 @@ "typescript": "^5.3.3" }, "engines": { - "node": ">= 18" + "node": "18.19.0" } } From 542e4a0324458c89b7e47bd4a5defe7f62e73575 Mon Sep 17 00:00:00 2001 From: KulkarniShashank Date: Fri, 12 Apr 2024 19:08:04 +0530 Subject: [PATCH 04/13] fix: specify Node.js version 18.19.0 in yaml file Signed-off-by: KulkarniShashank --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3d4bb2f1..de3f5b0a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -22,7 +22,7 @@ jobs: - name: Setup NodeJS uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 18.19.0 cache: 'yarn' - name: Install dependencies From 0bb1cfc52b1a8f24334e8cc02021a31145ddef47 Mon Sep 17 00:00:00 2001 From: pallavighule <61926403+pallavighule@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:44:12 +0530 Subject: [PATCH 05/13] refactor:add outOfBandId into issuance webhook event (#94) --- src/events/CredentialEvents.ts | 20 ++++++++++++++++++-- src/routes/routes.ts | 1 + src/routes/swagger.json | 6 +++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/events/CredentialEvents.ts b/src/events/CredentialEvents.ts index 10b1cb36..1d60b558 100644 --- a/src/events/CredentialEvents.ts +++ b/src/events/CredentialEvents.ts @@ -1,3 +1,4 @@ +import type { RestMultiTenantAgentModules } from '../cliAgent' import type { ServerConfig } from '../utils/ServerConfig' import type { Agent, CredentialStateChangedEvent } from '@credo-ts/core' @@ -6,11 +7,26 @@ import { CredentialEventTypes } from '@credo-ts/core' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' -export const credentialEvents = async (agent: Agent, config: ServerConfig) => { +export const credentialEvents = async (agent: Agent, config: ServerConfig) => { agent.events.on(CredentialEventTypes.CredentialStateChanged, async (event: CredentialStateChangedEvent) => { const record = event.payload.credentialRecord - const body = { ...record.toJSON(), ...event.metadata } + const body: Record = { + ...record.toJSON(), + ...event.metadata, + outOfBandId: null, + } + + if (event.metadata.contextCorrelationId !== 'default' && record?.connectionId) { + await agent.modules.tenants.withTenantAgent( + { tenantId: event.metadata.contextCorrelationId }, + async (tenantAgent) => { + const connectionRecord = await tenantAgent.connections.findById(record.connectionId!) + + body.outOfBandId = connectionRecord?.outOfBandId + } + ) + } // Only send webhook if webhook url is configured if (config.webhookUrl) { await sendWebhookEvent(config.webhookUrl + '/credentials', body, agent.config.logger) diff --git a/src/routes/routes.ts b/src/routes/routes.ts index b206b41e..98a5f1db 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -131,6 +131,7 @@ const models: TsoaRoute.Models = { "@type": {"dataType":"string","required":true}, "@id": {"dataType":"string","required":true}, "~thread": {"dataType":"nestedObjectLiteral","nestedProperties":{"pthid":{"dataType":"string"},"thid":{"dataType":"string"}}}, + "messageType": {"dataType":"string","required":true}, }, "additionalProperties": {"dataType":"any"}, }, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index f31073a1..2eb97060 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -284,11 +284,15 @@ } }, "type": "object" + }, + "messageType": { + "type": "string" } }, "required": [ "@type", - "@id" + "@id", + "messageType" ], "type": "object", "additionalProperties": {} From e913052686e3a94d5b65bc5115d8326cc723600f Mon Sep 17 00:00:00 2001 From: tipusinghaw <126460794+tipusinghaw@users.noreply.github.com> Date: Fri, 19 Apr 2024 13:17:30 +0530 Subject: [PATCH 06/13] feat: migrated to amoy (#96) --- package.json | 16 +- ...polygon-did-resolver+0.0.16-alpha.10.patch | 13 -- samples/cliConfig.json | 6 +- src/cliAgent.ts | 6 +- src/routes/routes.ts | 1 + src/routes/swagger.json | 6 +- yarn.lock | 160 +++++++++++------- 7 files changed, 120 insertions(+), 88 deletions(-) delete mode 100644 patches/@ayanworks+polygon-did-resolver+0.0.16-alpha.10.patch diff --git a/package.json b/package.json index cf24a53a..611db9c0 100644 --- a/package.json +++ b/package.json @@ -37,15 +37,15 @@ "validate": "yarn lint && yarn check-types && yarn check-format" }, "dependencies": { - "@ayanworks/credo-polygon-w3c-module": "0.0.2-alpha.3", - "@credo-ts/anoncreds": "0.5.0", - "@credo-ts/askar": "0.5.0", - "@credo-ts/core": "0.5.0", - "@credo-ts/indy-vdr": "0.5.0", - "@credo-ts/node": "0.5.0", + "@ayanworks/credo-polygon-w3c-module": "0.0.2-alpha.7", + "@credo-ts/anoncreds": "0.5.1", + "@credo-ts/askar": "0.5.1", + "@credo-ts/core": "0.5.1", + "@credo-ts/indy-vdr": "0.5.1", + "@credo-ts/node": "0.5.1", "@credo-ts/push-notifications": "^0.7.0", - "@credo-ts/question-answer": "0.5.0", - "@credo-ts/tenants": "0.5.0", + "@credo-ts/question-answer": "0.5.1", + "@credo-ts/tenants": "0.5.1", "@hyperledger/anoncreds-nodejs": "0.2.1", "@hyperledger/aries-askar-nodejs": "0.2.0", "@hyperledger/indy-vdr-nodejs": "0.2.0", diff --git a/patches/@ayanworks+polygon-did-resolver+0.0.16-alpha.10.patch b/patches/@ayanworks+polygon-did-resolver+0.0.16-alpha.10.patch deleted file mode 100644 index 8256de9e..00000000 --- a/patches/@ayanworks+polygon-did-resolver+0.0.16-alpha.10.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/node_modules/@ayanworks/polygon-did-resolver/build/config.js b/node_modules/@ayanworks/polygon-did-resolver/build/config.js -index 6362a6b..a83b612 100644 ---- a/node_modules/@ayanworks/polygon-did-resolver/build/config.js -+++ b/node_modules/@ayanworks/polygon-did-resolver/build/config.js -@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); - exports.networkConfig = void 0; - exports.networkConfig = { - testnet: { -- URL: 'https://rpc-mumbai.maticvigil.com/', -+ URL: 'https://polygon-mumbai.infura.io/v3/0579d305568d404e996e49695e9272a3', - CONTRACT_ADDRESS: '0x12513116875BB3E4F098Ce74624739Ee51bAf023', - }, - mainnet: { \ No newline at end of file diff --git a/samples/cliConfig.json b/samples/cliConfig.json index 2e5ef5f6..4b274743 100644 --- a/samples/cliConfig.json +++ b/samples/cliConfig.json @@ -39,9 +39,9 @@ "autoAcceptMediationRequests": false, "adminPort": 4001, "tenancy": true, - "didRegistryContractAddress": "0x12513116875BB3E4F098Ce74624739Ee51bAf023", - "schemaManagerContractAddress": "0x552992e9f14b15bBd76488cD4c38c89B80259f37", - "rpcUrl": "https://polygon-mumbai.infura.io/v3/0579d305568d404e996e49695e9272a3", + "didRegistryContractAddress": "0xc087766218b885C6283072BA316a2Bc31B5c17db", + "schemaManagerContractAddress": "0xD6f235F1159970211B3628CbC15e6c75D4Fb6e6e", + "rpcUrl": "https://rpc-amoy.polygon.technology", "fileServerUrl": "https://schema.credebl.id/", "fileServerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk" } diff --git a/src/cliAgent.ts b/src/cliAgent.ts index b9a0179b..ba00685d 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -176,11 +176,11 @@ const getModules = (networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]]) questionAnswer: new QuestionAnswerModule(), polygon: new PolygonModule({ - didContractAddress: '0x12513116875BB3E4F098Ce74624739Ee51bAf023', - schemaManagerContractAddress: '0x552992e9f14b15bBd76488cD4c38c89B80259f37', + didContractAddress: '0xc087766218b885C6283072BA316a2Bc31B5c17db', + schemaManagerContractAddress: '0xD6f235F1159970211B3628CbC15e6c75D4Fb6e6e', fileServerToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk', - rpcUrl: 'https://polygon-mumbai.infura.io/v3/0579d305568d404e996e49695e9272a3', + rpcUrl: 'https://rpc-amoy.polygon.technology', serverUrl: 'https://schema.credebl.id', }), } diff --git a/src/routes/routes.ts b/src/routes/routes.ts index b206b41e..98a5f1db 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -131,6 +131,7 @@ const models: TsoaRoute.Models = { "@type": {"dataType":"string","required":true}, "@id": {"dataType":"string","required":true}, "~thread": {"dataType":"nestedObjectLiteral","nestedProperties":{"pthid":{"dataType":"string"},"thid":{"dataType":"string"}}}, + "messageType": {"dataType":"string","required":true}, }, "additionalProperties": {"dataType":"any"}, }, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index f31073a1..2eb97060 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -284,11 +284,15 @@ } }, "type": "object" + }, + "messageType": { + "type": "string" } }, "required": [ "@type", - "@id" + "@id", + "messageType" ], "type": "object", "additionalProperties": {} diff --git a/yarn.lock b/yarn.lock index f67adfff..0bcb84ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -49,27 +49,27 @@ dependencies: static-eval "2.0.2" -"@ayanworks/credo-polygon-w3c-module@0.0.2-alpha.3": - version "0.0.2-alpha.3" - resolved "https://registry.yarnpkg.com/@ayanworks/credo-polygon-w3c-module/-/credo-polygon-w3c-module-0.0.2-alpha.3.tgz#c3ee5d71944427de99e777b5828e9864720acf4d" - integrity sha512-YMyPo4sEh1KWxeZ5fdGSZv+41Tm1zmnD+dSn53alHGx30KuwxSFzZnmw45Z0OM8imfjBuIsaLpGgZcl6i2A/Qw== - dependencies: - "@ayanworks/polygon-did-registrar" "0.0.16-alpha.13" - "@ayanworks/polygon-did-resolver" "0.0.16-alpha.10" - "@ayanworks/polygon-schema-manager" "0.0.2-alpha.5" - "@credo-ts/askar" "0.5.0" - "@credo-ts/core" "0.5.0" +"@ayanworks/credo-polygon-w3c-module@0.0.2-alpha.7": + version "0.0.2-alpha.7" + resolved "https://registry.yarnpkg.com/@ayanworks/credo-polygon-w3c-module/-/credo-polygon-w3c-module-0.0.2-alpha.7.tgz#003e09a4249a4618da914d3504ffafb522c74133" + integrity sha512-AK9rBqFYUvV8/VaD/X7b+/simfasbPuUgJCi1L1V4SIc2lJhJ2cxaI8OdEv5V1xBytmBdSC+THfSaKg0py3QRA== + dependencies: + "@ayanworks/polygon-did-registrar" "0.0.16-alpha.16" + "@ayanworks/polygon-did-resolver" "0.0.16-alpha.11" + "@ayanworks/polygon-schema-manager" "0.0.2-alpha.6" + "@credo-ts/askar" "0.5.1" + "@credo-ts/core" "0.5.1" did-resolver "^4.1.0" ethers "^6.9.0" -"@ayanworks/polygon-did-registrar@0.0.16-alpha.13": - version "0.0.16-alpha.13" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registrar/-/polygon-did-registrar-0.0.16-alpha.13.tgz#cdb7f4dfee1f6e97006630d57c3a520051c09aeb" - integrity sha512-fihShp7HMMtzwuxV0VAVk/piktr/auig2Gj0rGq0S1x0GWP0NbZy7baLZvsVx4/kjgFNqu6cv3p42dmYVnRuIg== +"@ayanworks/polygon-did-registrar@0.0.16-alpha.16": + version "0.0.16-alpha.16" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registrar/-/polygon-did-registrar-0.0.16-alpha.16.tgz#8467412a8138ffb8b2305bf4ea7914a4ce979267" + integrity sha512-q3Y1bzeHmCAxRpbA6rXKaO9CQhLjlP4aMZuJxYiiicPlQ6plkRt+Icxdp1ozsCEcMouj3l4E5kgzjK48bhOxrw== dependencies: "@ayanworks/polygon-did-registry-contract" "2.0.1-alpha.3" - "@ayanworks/polygon-did-resolver" "^0.0.16-alpha.10" - "@credo-ts/core" "0.5.0" + "@ayanworks/polygon-did-resolver" "^0.0.16-alpha.11" + "@credo-ts/core" "0.5.1" "@ethersproject/basex" "^5.7.0" "@ethersproject/signing-key" "^5.7.0" "@ethersproject/transactions" "^5.7.0" @@ -83,22 +83,22 @@ resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registry-contract/-/polygon-did-registry-contract-2.0.1-alpha.3.tgz#7bb932b712a4c48df857682f27adfb08154c4358" integrity sha512-8FZZVAmzXZn0pjZasuxdRblL0obK91JoaoXzpM4oZ7hD5VRUbiWf7BTh17WsWc6Oaf6XtafT4csuBo11fZiUoQ== -"@ayanworks/polygon-did-resolver@0.0.16-alpha.10", "@ayanworks/polygon-did-resolver@^0.0.16-alpha.10", "@ayanworks/polygon-did-resolver@^0.0.16-alpha.3": - version "0.0.16-alpha.10" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-resolver/-/polygon-did-resolver-0.0.16-alpha.10.tgz#85eb53f2f6dd53c5e6342e9d6d0c70bb560fa281" - integrity sha512-RfxDr+bggYcLsdN6nK+VKwjVLZzy3AqGULSsYT2bU+4n8obptufVIDg1cjbI4zi0eQIVmtkUeaHcJMlaR6wvvA== +"@ayanworks/polygon-did-resolver@0.0.16-alpha.11", "@ayanworks/polygon-did-resolver@^0.0.16-alpha.11": + version "0.0.16-alpha.11" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-resolver/-/polygon-did-resolver-0.0.16-alpha.11.tgz#fe115f9a63eea5e0604712549e9c573dcef7d55c" + integrity sha512-rQ6iVz0uht/hLkYA29E2iHN7xW0EusG6ognndBJF0QUxuPBB2kbmcr/4kW1E1m8FJLPvmEX/ed5v0pbBnGSJwA== dependencies: "@ayanworks/polygon-did-registry-contract" "2.0.1-alpha.3" did-resolver "^4.1.0" ethers "^5.1.0" -"@ayanworks/polygon-schema-manager@0.0.2-alpha.5": - version "0.0.2-alpha.5" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-schema-manager/-/polygon-schema-manager-0.0.2-alpha.5.tgz#f5b29b513c07f28eb52f52d6fa33ffec0b919370" - integrity sha512-0BnJ2FxmHnLia2zDxj7MPRnD7u5FA3LZF8xwuZf5vlHE9Jh/sgV6dQg5XMnPYmyhdlxSrTQ8FpNZbAir2PuMGQ== +"@ayanworks/polygon-schema-manager@0.0.2-alpha.6": + version "0.0.2-alpha.6" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-schema-manager/-/polygon-schema-manager-0.0.2-alpha.6.tgz#a872afc1166e39561dba63f0ba83f898376bb874" + integrity sha512-H8W0eS//Q3eDCiwtEqfqPhGW3bRLWOkJU1EYOuiwZGaIuZb4kWbYqAGdgl0s5g0ZP1rjirk4Ztx1w10cWqsZWw== dependencies: "@ayanworks/polygon-did-registry-contract" "2.0.1-alpha.3" - "@ayanworks/polygon-did-resolver" "^0.0.16-alpha.3" + "@ayanworks/polygon-did-resolver" "^0.0.16-alpha.11" "@nomicfoundation/hardhat-verify" "^2.0.3" axios "^1.6.3" did-resolver "^4.1.0" @@ -603,35 +603,35 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@credo-ts/anoncreds@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/anoncreds/-/anoncreds-0.5.0.tgz#74bcaec9b3e5f75fd03924efc2e8bd67b905b035" - integrity sha512-fYPYxGV2S99dTCb0LHcHnJrVL3FLgrON5tFiv6U7By6aR9paT70Gwep/Lyp0WNzssg2vZ+a4gEf2gKjQiBE8pA== +"@credo-ts/anoncreds@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/anoncreds/-/anoncreds-0.5.1.tgz#d1ba19e5764e1de5982a0a7e51cd5bc1badce6ad" + integrity sha512-d97wELxvt7jOqgr21FOVfFqHFSu487L+qF0QObOVCl9xElsST9sYl1iaRPHHW2GzYUMWLlnSwZm8fN4pLo9UVA== dependencies: "@astronautlabs/jsonpath" "^1.1.2" - "@credo-ts/core" "0.5.0" + "@credo-ts/core" "0.5.1" big-integer "^1.6.51" bn.js "^5.2.1" class-transformer "0.5.1" class-validator "0.14.1" reflect-metadata "^0.1.13" -"@credo-ts/askar@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/askar/-/askar-0.5.0.tgz#5fa2e6443fe3ae1b15c8b66eb73e63beb5c096a1" - integrity sha512-84wxDU6GbucBTe4HV7gUbCieFdhXVX19q8o6dNK8a3zl87yiV3OVwPwtnzghjh47vv14Xr+gWRvqbRvZrhRsaA== +"@credo-ts/askar@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/askar/-/askar-0.5.1.tgz#107d2f91f6afecb77fc7f24556725ec0e7597989" + integrity sha512-O3XWnmpnEe5U/a0kGQHigzXPw6/SXKp2v4ob3DJdHA0kiK3DywANNeG/Hw44lxdg24nNpizmVlO5EjRa6ULcmw== dependencies: - "@credo-ts/core" "0.5.0" + "@credo-ts/core" "0.5.1" bn.js "^5.2.1" class-transformer "0.5.1" class-validator "0.14.1" rxjs "^7.8.0" tsyringe "^4.8.0" -"@credo-ts/core@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/core/-/core-0.5.0.tgz#a6366df4b176a492f4f45b7e2f45b8c905e1eeca" - integrity sha512-7SJBgs1yd2gpwv8BnCO+U63Uu06v6Cxzg+ypWpqyNkkG4nTsQZSI8r0oSQ+DgbiqwN/AZKsn9HuNISFftf5yKQ== +"@credo-ts/core@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/core/-/core-0.5.1.tgz#bb38e2f5451753cea1d3a73b1d407255af02c4ed" + integrity sha512-ywwFw6wwiMft3A994Y91LAm8CrEg2G7CJQRyLD8UzneU4coMWZTeED63thAEX6XK/tyDmv2MAcrO04hE3KQPcA== dependencies: "@digitalcredentials/jsonld" "^6.0.0" "@digitalcredentials/jsonld-signatures" "^9.4.0" @@ -665,22 +665,22 @@ varint "^6.0.0" web-did-resolver "^2.0.21" -"@credo-ts/indy-vdr@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/indy-vdr/-/indy-vdr-0.5.0.tgz#1799b2a90599d000a43c5dc59e7bd1e1eda68fe1" - integrity sha512-hW7xDdL6fVIgTIclmJRfVz3mlpo87Cwk6hCiRY1/lWV62bsKs6RHGLv6RUp+WPwTIpPpbBs6T1Dm85ditBbxpA== +"@credo-ts/indy-vdr@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/indy-vdr/-/indy-vdr-0.5.1.tgz#1fe4719235f3e586e770e57aa46bba7182d53c10" + integrity sha512-pXRAKzLlwijaNaCOPheV9dHeZm0FAfiJw9kYEvpjBn+d/ARygb92kr9lJizUGK3cPtF9dbhrNBuLWwskM39fCw== dependencies: - "@credo-ts/anoncreds" "0.5.0" - "@credo-ts/core" "0.5.0" + "@credo-ts/anoncreds" "0.5.1" + "@credo-ts/core" "0.5.1" -"@credo-ts/node@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/node/-/node-0.5.0.tgz#d28ed5040f9925777a65f66f55abed7c2d2e53de" - integrity sha512-/44SrgmjuRDE4Sjb6QDMvquPTUsH5DkIp8pbN7csLe0GEDDzPOUvzCaf4yI7TRnuSZN9Nh9/f6C2UGn0JuQ0Sg== +"@credo-ts/node@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/node/-/node-0.5.1.tgz#adf24f931fd80848722f8f313012be00da405deb" + integrity sha512-F/PA3wyKN9MvH2JFSUmYGqQT+JaeSGKWNJxT+OkQzqseCZnCbErAnr8oNWlTwBWogp6ECx31FEn9wMq9zAMLaw== dependencies: "@2060.io/ffi-napi" "^4.0.8" "@2060.io/ref-napi" "^3.0.6" - "@credo-ts/core" "0.5.0" + "@credo-ts/core" "0.5.1" "@types/express" "^4.17.15" express "^4.17.1" ws "^8.13.0" @@ -694,22 +694,22 @@ class-validator "0.14.1" tsyringe "^4.6.0" -"@credo-ts/question-answer@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/question-answer/-/question-answer-0.5.0.tgz#d3871127a36f783c7977c3cbcca8a23523453a32" - integrity sha512-cF4RRoVIS05ssIMk4iNQcn53k5E3G4jHVTSrBr3ZoV5EAGHTQ0Y5NMlLCx7kLlY31KGvhdiPXxeECG/uSiS3sg== +"@credo-ts/question-answer@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/question-answer/-/question-answer-0.5.1.tgz#538dbfec8fc866de188c11ede9860bf0ef712937" + integrity sha512-yPjOl3tUfK5GT9BvX70hiTq86Fi5WTxB0pL42e17evq7+puBOMqhwQ1nv7dhDSWC2Oy+r0D0mF7Lz2hGulrJJg== dependencies: - "@credo-ts/core" "0.5.0" + "@credo-ts/core" "0.5.1" class-transformer "0.5.1" class-validator "0.14.1" rxjs "^7.8.0" -"@credo-ts/tenants@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/tenants/-/tenants-0.5.0.tgz#e32943d66580af3b7bf6970fb3321329a479271d" - integrity sha512-SB2btH9adWLBwBs2d3od9VTF6AA2Bfzl3oJovlrcdWHXSYQWf0Hm+PRkvmL8+RYwdGtDM8uBKQrkbdPBGWEWAA== +"@credo-ts/tenants@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/tenants/-/tenants-0.5.1.tgz#63ca79eb0a6c7d4bdf43ea00ed712d7399c25421" + integrity sha512-+wJ+Wd3rThY6eP9e3WYFeFlJKQEUrmJPhN5t+vr4zyhB5T7pM5Nsg53pzugWoCeWsMUNCqmHo12Tc9edQTH0bg== dependencies: - "@credo-ts/core" "0.5.0" + "@credo-ts/core" "0.5.1" async-mutex "^0.4.0" "@cspotcode/source-map-support@^0.8.0": @@ -1276,6 +1276,18 @@ resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.0.tgz#0709e9f4cb252351c609c6e6d8d6779a8d25edff" integrity sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA== +"@hapi/hoek@^9.0.0", "@hapi/hoek@^9.3.0": + version "9.3.0" + resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb" + integrity sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ== + +"@hapi/topo@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012" + integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg== + dependencies: + "@hapi/hoek" "^9.0.0" + "@humanwhocodes/config-array@^0.5.0": version "0.5.0" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" @@ -1759,6 +1771,23 @@ "@sd-jwt/types" "0.3.0" buffer "*" +"@sideway/address@^4.1.5": + version "4.1.5" + resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.5.tgz#4bc149a0076623ced99ca8208ba780d65a99b9d5" + integrity sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q== + dependencies: + "@hapi/hoek" "^9.0.0" + +"@sideway/formula@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.1.tgz#80fcbcbaf7ce031e0ef2dd29b1bfc7c3f583611f" + integrity sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg== + +"@sideway/pinpoint@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" + integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== + "@sindresorhus/is@^4.0.0": version "4.6.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" @@ -5584,6 +5613,17 @@ jest@^27.3.1: import-local "^3.0.2" jest-cli "^27.5.1" +joi@^17.12.3: + version "17.12.3" + resolved "https://registry.yarnpkg.com/joi/-/joi-17.12.3.tgz#944646979cd3b460178547b12ba37aca8482f63d" + integrity sha512-2RRziagf555owrm9IRVtdKynOBeITiDpuZqIpgwqXShPncPKNiRQoiGsl/T8SQdq+8ugRzH2LqY67irr2y/d+g== + dependencies: + "@hapi/hoek" "^9.3.0" + "@hapi/topo" "^5.1.0" + "@sideway/address" "^4.1.5" + "@sideway/formula" "^3.0.1" + "@sideway/pinpoint" "^2.0.0" + js-sha3@0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" From 81e66a38a46ab210d46f5975d174ebadda290eee Mon Sep 17 00:00:00 2001 From: tipusinghaw <126460794+tipusinghaw@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:14:37 +0530 Subject: [PATCH 07/13] merge: develop to main (#98) Co-authored-by: Sai Ranjit Tummalapalli --- package.json | 16 +- ...polygon-did-resolver+0.0.16-alpha.10.patch | 13 -- samples/cliConfig.json | 6 +- src/cliAgent.ts | 6 +- yarn.lock | 160 +++++++++++------- 5 files changed, 114 insertions(+), 87 deletions(-) delete mode 100644 patches/@ayanworks+polygon-did-resolver+0.0.16-alpha.10.patch diff --git a/package.json b/package.json index cf24a53a..611db9c0 100644 --- a/package.json +++ b/package.json @@ -37,15 +37,15 @@ "validate": "yarn lint && yarn check-types && yarn check-format" }, "dependencies": { - "@ayanworks/credo-polygon-w3c-module": "0.0.2-alpha.3", - "@credo-ts/anoncreds": "0.5.0", - "@credo-ts/askar": "0.5.0", - "@credo-ts/core": "0.5.0", - "@credo-ts/indy-vdr": "0.5.0", - "@credo-ts/node": "0.5.0", + "@ayanworks/credo-polygon-w3c-module": "0.0.2-alpha.7", + "@credo-ts/anoncreds": "0.5.1", + "@credo-ts/askar": "0.5.1", + "@credo-ts/core": "0.5.1", + "@credo-ts/indy-vdr": "0.5.1", + "@credo-ts/node": "0.5.1", "@credo-ts/push-notifications": "^0.7.0", - "@credo-ts/question-answer": "0.5.0", - "@credo-ts/tenants": "0.5.0", + "@credo-ts/question-answer": "0.5.1", + "@credo-ts/tenants": "0.5.1", "@hyperledger/anoncreds-nodejs": "0.2.1", "@hyperledger/aries-askar-nodejs": "0.2.0", "@hyperledger/indy-vdr-nodejs": "0.2.0", diff --git a/patches/@ayanworks+polygon-did-resolver+0.0.16-alpha.10.patch b/patches/@ayanworks+polygon-did-resolver+0.0.16-alpha.10.patch deleted file mode 100644 index 8256de9e..00000000 --- a/patches/@ayanworks+polygon-did-resolver+0.0.16-alpha.10.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/node_modules/@ayanworks/polygon-did-resolver/build/config.js b/node_modules/@ayanworks/polygon-did-resolver/build/config.js -index 6362a6b..a83b612 100644 ---- a/node_modules/@ayanworks/polygon-did-resolver/build/config.js -+++ b/node_modules/@ayanworks/polygon-did-resolver/build/config.js -@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); - exports.networkConfig = void 0; - exports.networkConfig = { - testnet: { -- URL: 'https://rpc-mumbai.maticvigil.com/', -+ URL: 'https://polygon-mumbai.infura.io/v3/0579d305568d404e996e49695e9272a3', - CONTRACT_ADDRESS: '0x12513116875BB3E4F098Ce74624739Ee51bAf023', - }, - mainnet: { \ No newline at end of file diff --git a/samples/cliConfig.json b/samples/cliConfig.json index 2e5ef5f6..4b274743 100644 --- a/samples/cliConfig.json +++ b/samples/cliConfig.json @@ -39,9 +39,9 @@ "autoAcceptMediationRequests": false, "adminPort": 4001, "tenancy": true, - "didRegistryContractAddress": "0x12513116875BB3E4F098Ce74624739Ee51bAf023", - "schemaManagerContractAddress": "0x552992e9f14b15bBd76488cD4c38c89B80259f37", - "rpcUrl": "https://polygon-mumbai.infura.io/v3/0579d305568d404e996e49695e9272a3", + "didRegistryContractAddress": "0xc087766218b885C6283072BA316a2Bc31B5c17db", + "schemaManagerContractAddress": "0xD6f235F1159970211B3628CbC15e6c75D4Fb6e6e", + "rpcUrl": "https://rpc-amoy.polygon.technology", "fileServerUrl": "https://schema.credebl.id/", "fileServerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk" } diff --git a/src/cliAgent.ts b/src/cliAgent.ts index b9a0179b..ba00685d 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -176,11 +176,11 @@ const getModules = (networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]]) questionAnswer: new QuestionAnswerModule(), polygon: new PolygonModule({ - didContractAddress: '0x12513116875BB3E4F098Ce74624739Ee51bAf023', - schemaManagerContractAddress: '0x552992e9f14b15bBd76488cD4c38c89B80259f37', + didContractAddress: '0xc087766218b885C6283072BA316a2Bc31B5c17db', + schemaManagerContractAddress: '0xD6f235F1159970211B3628CbC15e6c75D4Fb6e6e', fileServerToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk', - rpcUrl: 'https://polygon-mumbai.infura.io/v3/0579d305568d404e996e49695e9272a3', + rpcUrl: 'https://rpc-amoy.polygon.technology', serverUrl: 'https://schema.credebl.id', }), } diff --git a/yarn.lock b/yarn.lock index f67adfff..0bcb84ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -49,27 +49,27 @@ dependencies: static-eval "2.0.2" -"@ayanworks/credo-polygon-w3c-module@0.0.2-alpha.3": - version "0.0.2-alpha.3" - resolved "https://registry.yarnpkg.com/@ayanworks/credo-polygon-w3c-module/-/credo-polygon-w3c-module-0.0.2-alpha.3.tgz#c3ee5d71944427de99e777b5828e9864720acf4d" - integrity sha512-YMyPo4sEh1KWxeZ5fdGSZv+41Tm1zmnD+dSn53alHGx30KuwxSFzZnmw45Z0OM8imfjBuIsaLpGgZcl6i2A/Qw== - dependencies: - "@ayanworks/polygon-did-registrar" "0.0.16-alpha.13" - "@ayanworks/polygon-did-resolver" "0.0.16-alpha.10" - "@ayanworks/polygon-schema-manager" "0.0.2-alpha.5" - "@credo-ts/askar" "0.5.0" - "@credo-ts/core" "0.5.0" +"@ayanworks/credo-polygon-w3c-module@0.0.2-alpha.7": + version "0.0.2-alpha.7" + resolved "https://registry.yarnpkg.com/@ayanworks/credo-polygon-w3c-module/-/credo-polygon-w3c-module-0.0.2-alpha.7.tgz#003e09a4249a4618da914d3504ffafb522c74133" + integrity sha512-AK9rBqFYUvV8/VaD/X7b+/simfasbPuUgJCi1L1V4SIc2lJhJ2cxaI8OdEv5V1xBytmBdSC+THfSaKg0py3QRA== + dependencies: + "@ayanworks/polygon-did-registrar" "0.0.16-alpha.16" + "@ayanworks/polygon-did-resolver" "0.0.16-alpha.11" + "@ayanworks/polygon-schema-manager" "0.0.2-alpha.6" + "@credo-ts/askar" "0.5.1" + "@credo-ts/core" "0.5.1" did-resolver "^4.1.0" ethers "^6.9.0" -"@ayanworks/polygon-did-registrar@0.0.16-alpha.13": - version "0.0.16-alpha.13" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registrar/-/polygon-did-registrar-0.0.16-alpha.13.tgz#cdb7f4dfee1f6e97006630d57c3a520051c09aeb" - integrity sha512-fihShp7HMMtzwuxV0VAVk/piktr/auig2Gj0rGq0S1x0GWP0NbZy7baLZvsVx4/kjgFNqu6cv3p42dmYVnRuIg== +"@ayanworks/polygon-did-registrar@0.0.16-alpha.16": + version "0.0.16-alpha.16" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registrar/-/polygon-did-registrar-0.0.16-alpha.16.tgz#8467412a8138ffb8b2305bf4ea7914a4ce979267" + integrity sha512-q3Y1bzeHmCAxRpbA6rXKaO9CQhLjlP4aMZuJxYiiicPlQ6plkRt+Icxdp1ozsCEcMouj3l4E5kgzjK48bhOxrw== dependencies: "@ayanworks/polygon-did-registry-contract" "2.0.1-alpha.3" - "@ayanworks/polygon-did-resolver" "^0.0.16-alpha.10" - "@credo-ts/core" "0.5.0" + "@ayanworks/polygon-did-resolver" "^0.0.16-alpha.11" + "@credo-ts/core" "0.5.1" "@ethersproject/basex" "^5.7.0" "@ethersproject/signing-key" "^5.7.0" "@ethersproject/transactions" "^5.7.0" @@ -83,22 +83,22 @@ resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registry-contract/-/polygon-did-registry-contract-2.0.1-alpha.3.tgz#7bb932b712a4c48df857682f27adfb08154c4358" integrity sha512-8FZZVAmzXZn0pjZasuxdRblL0obK91JoaoXzpM4oZ7hD5VRUbiWf7BTh17WsWc6Oaf6XtafT4csuBo11fZiUoQ== -"@ayanworks/polygon-did-resolver@0.0.16-alpha.10", "@ayanworks/polygon-did-resolver@^0.0.16-alpha.10", "@ayanworks/polygon-did-resolver@^0.0.16-alpha.3": - version "0.0.16-alpha.10" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-resolver/-/polygon-did-resolver-0.0.16-alpha.10.tgz#85eb53f2f6dd53c5e6342e9d6d0c70bb560fa281" - integrity sha512-RfxDr+bggYcLsdN6nK+VKwjVLZzy3AqGULSsYT2bU+4n8obptufVIDg1cjbI4zi0eQIVmtkUeaHcJMlaR6wvvA== +"@ayanworks/polygon-did-resolver@0.0.16-alpha.11", "@ayanworks/polygon-did-resolver@^0.0.16-alpha.11": + version "0.0.16-alpha.11" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-resolver/-/polygon-did-resolver-0.0.16-alpha.11.tgz#fe115f9a63eea5e0604712549e9c573dcef7d55c" + integrity sha512-rQ6iVz0uht/hLkYA29E2iHN7xW0EusG6ognndBJF0QUxuPBB2kbmcr/4kW1E1m8FJLPvmEX/ed5v0pbBnGSJwA== dependencies: "@ayanworks/polygon-did-registry-contract" "2.0.1-alpha.3" did-resolver "^4.1.0" ethers "^5.1.0" -"@ayanworks/polygon-schema-manager@0.0.2-alpha.5": - version "0.0.2-alpha.5" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-schema-manager/-/polygon-schema-manager-0.0.2-alpha.5.tgz#f5b29b513c07f28eb52f52d6fa33ffec0b919370" - integrity sha512-0BnJ2FxmHnLia2zDxj7MPRnD7u5FA3LZF8xwuZf5vlHE9Jh/sgV6dQg5XMnPYmyhdlxSrTQ8FpNZbAir2PuMGQ== +"@ayanworks/polygon-schema-manager@0.0.2-alpha.6": + version "0.0.2-alpha.6" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-schema-manager/-/polygon-schema-manager-0.0.2-alpha.6.tgz#a872afc1166e39561dba63f0ba83f898376bb874" + integrity sha512-H8W0eS//Q3eDCiwtEqfqPhGW3bRLWOkJU1EYOuiwZGaIuZb4kWbYqAGdgl0s5g0ZP1rjirk4Ztx1w10cWqsZWw== dependencies: "@ayanworks/polygon-did-registry-contract" "2.0.1-alpha.3" - "@ayanworks/polygon-did-resolver" "^0.0.16-alpha.3" + "@ayanworks/polygon-did-resolver" "^0.0.16-alpha.11" "@nomicfoundation/hardhat-verify" "^2.0.3" axios "^1.6.3" did-resolver "^4.1.0" @@ -603,35 +603,35 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@credo-ts/anoncreds@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/anoncreds/-/anoncreds-0.5.0.tgz#74bcaec9b3e5f75fd03924efc2e8bd67b905b035" - integrity sha512-fYPYxGV2S99dTCb0LHcHnJrVL3FLgrON5tFiv6U7By6aR9paT70Gwep/Lyp0WNzssg2vZ+a4gEf2gKjQiBE8pA== +"@credo-ts/anoncreds@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/anoncreds/-/anoncreds-0.5.1.tgz#d1ba19e5764e1de5982a0a7e51cd5bc1badce6ad" + integrity sha512-d97wELxvt7jOqgr21FOVfFqHFSu487L+qF0QObOVCl9xElsST9sYl1iaRPHHW2GzYUMWLlnSwZm8fN4pLo9UVA== dependencies: "@astronautlabs/jsonpath" "^1.1.2" - "@credo-ts/core" "0.5.0" + "@credo-ts/core" "0.5.1" big-integer "^1.6.51" bn.js "^5.2.1" class-transformer "0.5.1" class-validator "0.14.1" reflect-metadata "^0.1.13" -"@credo-ts/askar@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/askar/-/askar-0.5.0.tgz#5fa2e6443fe3ae1b15c8b66eb73e63beb5c096a1" - integrity sha512-84wxDU6GbucBTe4HV7gUbCieFdhXVX19q8o6dNK8a3zl87yiV3OVwPwtnzghjh47vv14Xr+gWRvqbRvZrhRsaA== +"@credo-ts/askar@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/askar/-/askar-0.5.1.tgz#107d2f91f6afecb77fc7f24556725ec0e7597989" + integrity sha512-O3XWnmpnEe5U/a0kGQHigzXPw6/SXKp2v4ob3DJdHA0kiK3DywANNeG/Hw44lxdg24nNpizmVlO5EjRa6ULcmw== dependencies: - "@credo-ts/core" "0.5.0" + "@credo-ts/core" "0.5.1" bn.js "^5.2.1" class-transformer "0.5.1" class-validator "0.14.1" rxjs "^7.8.0" tsyringe "^4.8.0" -"@credo-ts/core@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/core/-/core-0.5.0.tgz#a6366df4b176a492f4f45b7e2f45b8c905e1eeca" - integrity sha512-7SJBgs1yd2gpwv8BnCO+U63Uu06v6Cxzg+ypWpqyNkkG4nTsQZSI8r0oSQ+DgbiqwN/AZKsn9HuNISFftf5yKQ== +"@credo-ts/core@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/core/-/core-0.5.1.tgz#bb38e2f5451753cea1d3a73b1d407255af02c4ed" + integrity sha512-ywwFw6wwiMft3A994Y91LAm8CrEg2G7CJQRyLD8UzneU4coMWZTeED63thAEX6XK/tyDmv2MAcrO04hE3KQPcA== dependencies: "@digitalcredentials/jsonld" "^6.0.0" "@digitalcredentials/jsonld-signatures" "^9.4.0" @@ -665,22 +665,22 @@ varint "^6.0.0" web-did-resolver "^2.0.21" -"@credo-ts/indy-vdr@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/indy-vdr/-/indy-vdr-0.5.0.tgz#1799b2a90599d000a43c5dc59e7bd1e1eda68fe1" - integrity sha512-hW7xDdL6fVIgTIclmJRfVz3mlpo87Cwk6hCiRY1/lWV62bsKs6RHGLv6RUp+WPwTIpPpbBs6T1Dm85ditBbxpA== +"@credo-ts/indy-vdr@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/indy-vdr/-/indy-vdr-0.5.1.tgz#1fe4719235f3e586e770e57aa46bba7182d53c10" + integrity sha512-pXRAKzLlwijaNaCOPheV9dHeZm0FAfiJw9kYEvpjBn+d/ARygb92kr9lJizUGK3cPtF9dbhrNBuLWwskM39fCw== dependencies: - "@credo-ts/anoncreds" "0.5.0" - "@credo-ts/core" "0.5.0" + "@credo-ts/anoncreds" "0.5.1" + "@credo-ts/core" "0.5.1" -"@credo-ts/node@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/node/-/node-0.5.0.tgz#d28ed5040f9925777a65f66f55abed7c2d2e53de" - integrity sha512-/44SrgmjuRDE4Sjb6QDMvquPTUsH5DkIp8pbN7csLe0GEDDzPOUvzCaf4yI7TRnuSZN9Nh9/f6C2UGn0JuQ0Sg== +"@credo-ts/node@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/node/-/node-0.5.1.tgz#adf24f931fd80848722f8f313012be00da405deb" + integrity sha512-F/PA3wyKN9MvH2JFSUmYGqQT+JaeSGKWNJxT+OkQzqseCZnCbErAnr8oNWlTwBWogp6ECx31FEn9wMq9zAMLaw== dependencies: "@2060.io/ffi-napi" "^4.0.8" "@2060.io/ref-napi" "^3.0.6" - "@credo-ts/core" "0.5.0" + "@credo-ts/core" "0.5.1" "@types/express" "^4.17.15" express "^4.17.1" ws "^8.13.0" @@ -694,22 +694,22 @@ class-validator "0.14.1" tsyringe "^4.6.0" -"@credo-ts/question-answer@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/question-answer/-/question-answer-0.5.0.tgz#d3871127a36f783c7977c3cbcca8a23523453a32" - integrity sha512-cF4RRoVIS05ssIMk4iNQcn53k5E3G4jHVTSrBr3ZoV5EAGHTQ0Y5NMlLCx7kLlY31KGvhdiPXxeECG/uSiS3sg== +"@credo-ts/question-answer@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/question-answer/-/question-answer-0.5.1.tgz#538dbfec8fc866de188c11ede9860bf0ef712937" + integrity sha512-yPjOl3tUfK5GT9BvX70hiTq86Fi5WTxB0pL42e17evq7+puBOMqhwQ1nv7dhDSWC2Oy+r0D0mF7Lz2hGulrJJg== dependencies: - "@credo-ts/core" "0.5.0" + "@credo-ts/core" "0.5.1" class-transformer "0.5.1" class-validator "0.14.1" rxjs "^7.8.0" -"@credo-ts/tenants@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/tenants/-/tenants-0.5.0.tgz#e32943d66580af3b7bf6970fb3321329a479271d" - integrity sha512-SB2btH9adWLBwBs2d3od9VTF6AA2Bfzl3oJovlrcdWHXSYQWf0Hm+PRkvmL8+RYwdGtDM8uBKQrkbdPBGWEWAA== +"@credo-ts/tenants@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/tenants/-/tenants-0.5.1.tgz#63ca79eb0a6c7d4bdf43ea00ed712d7399c25421" + integrity sha512-+wJ+Wd3rThY6eP9e3WYFeFlJKQEUrmJPhN5t+vr4zyhB5T7pM5Nsg53pzugWoCeWsMUNCqmHo12Tc9edQTH0bg== dependencies: - "@credo-ts/core" "0.5.0" + "@credo-ts/core" "0.5.1" async-mutex "^0.4.0" "@cspotcode/source-map-support@^0.8.0": @@ -1276,6 +1276,18 @@ resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.0.tgz#0709e9f4cb252351c609c6e6d8d6779a8d25edff" integrity sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA== +"@hapi/hoek@^9.0.0", "@hapi/hoek@^9.3.0": + version "9.3.0" + resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb" + integrity sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ== + +"@hapi/topo@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012" + integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg== + dependencies: + "@hapi/hoek" "^9.0.0" + "@humanwhocodes/config-array@^0.5.0": version "0.5.0" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" @@ -1759,6 +1771,23 @@ "@sd-jwt/types" "0.3.0" buffer "*" +"@sideway/address@^4.1.5": + version "4.1.5" + resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.5.tgz#4bc149a0076623ced99ca8208ba780d65a99b9d5" + integrity sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q== + dependencies: + "@hapi/hoek" "^9.0.0" + +"@sideway/formula@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.1.tgz#80fcbcbaf7ce031e0ef2dd29b1bfc7c3f583611f" + integrity sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg== + +"@sideway/pinpoint@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" + integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== + "@sindresorhus/is@^4.0.0": version "4.6.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" @@ -5584,6 +5613,17 @@ jest@^27.3.1: import-local "^3.0.2" jest-cli "^27.5.1" +joi@^17.12.3: + version "17.12.3" + resolved "https://registry.yarnpkg.com/joi/-/joi-17.12.3.tgz#944646979cd3b460178547b12ba37aca8482f63d" + integrity sha512-2RRziagf555owrm9IRVtdKynOBeITiDpuZqIpgwqXShPncPKNiRQoiGsl/T8SQdq+8ugRzH2LqY67irr2y/d+g== + dependencies: + "@hapi/hoek" "^9.3.0" + "@hapi/topo" "^5.1.0" + "@sideway/address" "^4.1.5" + "@sideway/formula" "^3.0.1" + "@sideway/pinpoint" "^2.0.0" + js-sha3@0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" From f8ef8ca0a16cade723dbb548d6d95dca35569e50 Mon Sep 17 00:00:00 2001 From: KulkarniShashank Date: Mon, 29 Apr 2024 16:29:59 +0530 Subject: [PATCH 08/13] refactor: add the recipientKey in create invitation functionality Signed-off-by: KulkarniShashank --- .../multi-tenancy/MultiTenancyController.ts | 20 +++++++++++++-- .../outofband/OutOfBandController.ts | 25 +++++++++++++------ 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/controllers/multi-tenancy/MultiTenancyController.ts b/src/controllers/multi-tenancy/MultiTenancyController.ts index 9a3ccafc..5b78361e 100644 --- a/src/controllers/multi-tenancy/MultiTenancyController.ts +++ b/src/controllers/multi-tenancy/MultiTenancyController.ts @@ -639,12 +639,27 @@ export class MultiTenancyController extends Controller { public async createInvitation( @Res() internalServerError: TsoaResponse<500, { message: string }>, @Path('tenantId') tenantId: string, - @Body() config?: Omit // props removed because of issues with serialization + @Body() config?: Omit & RecipientKeyOption // Remove routing property from type ) { let outOfBandRecord: OutOfBandRecord | undefined + let finalConfig: Omit & RecipientKeyOption & { routing?: Routing } = {} // Initialize finalConfig + try { await this.agent.modules.tenants.withTenantAgent({ tenantId }, async (tenantAgent) => { - outOfBandRecord = await tenantAgent.oob.createInvitation(config) + if (config?.recipientKey) { + const routing: Routing = { + // Initialize routing object + endpoints: tenantAgent.config.endpoints, + routingKeys: [], + recipientKey: Key.fromPublicKeyBase58(config.recipientKey, KeyType.Ed25519), + mediatorId: undefined, + } + finalConfig = { ...config, routing } // Assign finalConfig + } else { + finalConfig = { ...config, routing: await tenantAgent.mediationRecipient.getRouting({}) } // Assign finalConfig + } + + outOfBandRecord = await tenantAgent.oob.createInvitation(finalConfig) }) return { @@ -655,6 +670,7 @@ export class MultiTenancyController extends Controller { useDidSovPrefixWhereAllowed: this.agent.config.useDidSovPrefixWhereAllowed, }), outOfBandRecord: outOfBandRecord?.toJSON(), + ...(finalConfig?.recipientKey ? {} : { recipientKey: finalConfig.routing?.recipientKey.publicKeyBase58 }), // Access recipientKey from routing } } catch (error) { return internalServerError(500, { message: `something went wrong: ${error}` }) diff --git a/src/controllers/outofband/OutOfBandController.ts b/src/controllers/outofband/OutOfBandController.ts index 96704fde..dbb23eb9 100644 --- a/src/controllers/outofband/OutOfBandController.ts +++ b/src/controllers/outofband/OutOfBandController.ts @@ -1,5 +1,5 @@ import type { OutOfBandInvitationProps, OutOfBandRecordWithInvitationProps } from '../examples' -import type { AgentMessageType, RecipientKeyOption } from '../types' +import type { AgentMessageType, RecipientKeyOption, CreateInvitationOptions } from '../types' import type { ConnectionRecordProps, CreateLegacyInvitationConfig, Routing } from '@credo-ts/core' import { @@ -14,12 +14,7 @@ import { import { injectable } from 'tsyringe' import { ConnectionRecordExample, outOfBandInvitationExample, outOfBandRecordExample, RecordId } from '../examples' -import { - AcceptInvitationConfig, - ReceiveInvitationByUrlProps, - ReceiveInvitationProps, - CreateInvitationOptions, -} from '../types' +import { AcceptInvitationConfig, ReceiveInvitationByUrlProps, ReceiveInvitationProps } from '../types' import { Body, @@ -101,9 +96,22 @@ export class OutOfBandController extends Controller { @Post('/create-invitation') public async createInvitation( @Res() internalServerError: TsoaResponse<500, { message: string }>, - @Body() config: CreateInvitationOptions // props removed because of issues with serialization + @Body() config: CreateInvitationOptions & RecipientKeyOption // props removed because of issues with serialization ) { try { + let routing: Routing + if (config?.recipientKey) { + routing = { + endpoints: this.agent.config.endpoints, + routingKeys: [], + recipientKey: Key.fromPublicKeyBase58(config.recipientKey, KeyType.Ed25519), + mediatorId: undefined, + } + } else { + routing = await this.agent.mediationRecipient.getRouting({}) + } + + config.routing = routing const outOfBandRecord = await this.agent.oob.createInvitation(config) return { invitationUrl: outOfBandRecord.outOfBandInvitation.toUrl({ @@ -113,6 +121,7 @@ export class OutOfBandController extends Controller { useDidSovPrefixWhereAllowed: this.agent.config.useDidSovPrefixWhereAllowed, }), outOfBandRecord: outOfBandRecord.toJSON(), + ...(config?.recipientKey ? {} : { recipientKey: routing.recipientKey.publicKeyBase58 }), } } catch (error) { return internalServerError(500, { message: `something went wrong: ${error}` }) From f9b3d163afa327cb76b8ba7543225a6d7dbbcdb6 Mon Sep 17 00:00:00 2001 From: KulkarniShashank Date: Fri, 12 Apr 2024 18:31:16 +0530 Subject: [PATCH 09/13] fix: specify Node.js version 18.19.0 in engines Signed-off-by: KulkarniShashank Signed-off-by: tipusinghaw --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f67626f3..cf24a53a 100644 --- a/package.json +++ b/package.json @@ -100,6 +100,6 @@ "typescript": "^5.3.3" }, "engines": { - "node": ">= 18" + "node": "18.19.0" } } From c586c1703661a29bee3222bf21f2d943d677ef7d Mon Sep 17 00:00:00 2001 From: KulkarniShashank Date: Fri, 12 Apr 2024 19:08:04 +0530 Subject: [PATCH 10/13] fix: specify Node.js version 18.19.0 in yaml file Signed-off-by: KulkarniShashank Signed-off-by: tipusinghaw --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3d4bb2f1..de3f5b0a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -22,7 +22,7 @@ jobs: - name: Setup NodeJS uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 18.19.0 cache: 'yarn' - name: Install dependencies From 5dc99ace6c7cdd98380427afaa0d3ee99b5736e2 Mon Sep 17 00:00:00 2001 From: tipusinghaw <126460794+tipusinghaw@users.noreply.github.com> Date: Fri, 19 Apr 2024 13:17:30 +0530 Subject: [PATCH 11/13] feat: migrated to amoy (#96) Signed-off-by: tipusinghaw --- package.json | 16 +- ...polygon-did-resolver+0.0.16-alpha.10.patch | 13 -- samples/cliConfig.json | 6 +- src/cliAgent.ts | 6 +- src/routes/routes.ts | 1 + src/routes/swagger.json | 6 +- yarn.lock | 160 +++++++++++------- 7 files changed, 120 insertions(+), 88 deletions(-) delete mode 100644 patches/@ayanworks+polygon-did-resolver+0.0.16-alpha.10.patch diff --git a/package.json b/package.json index cf24a53a..611db9c0 100644 --- a/package.json +++ b/package.json @@ -37,15 +37,15 @@ "validate": "yarn lint && yarn check-types && yarn check-format" }, "dependencies": { - "@ayanworks/credo-polygon-w3c-module": "0.0.2-alpha.3", - "@credo-ts/anoncreds": "0.5.0", - "@credo-ts/askar": "0.5.0", - "@credo-ts/core": "0.5.0", - "@credo-ts/indy-vdr": "0.5.0", - "@credo-ts/node": "0.5.0", + "@ayanworks/credo-polygon-w3c-module": "0.0.2-alpha.7", + "@credo-ts/anoncreds": "0.5.1", + "@credo-ts/askar": "0.5.1", + "@credo-ts/core": "0.5.1", + "@credo-ts/indy-vdr": "0.5.1", + "@credo-ts/node": "0.5.1", "@credo-ts/push-notifications": "^0.7.0", - "@credo-ts/question-answer": "0.5.0", - "@credo-ts/tenants": "0.5.0", + "@credo-ts/question-answer": "0.5.1", + "@credo-ts/tenants": "0.5.1", "@hyperledger/anoncreds-nodejs": "0.2.1", "@hyperledger/aries-askar-nodejs": "0.2.0", "@hyperledger/indy-vdr-nodejs": "0.2.0", diff --git a/patches/@ayanworks+polygon-did-resolver+0.0.16-alpha.10.patch b/patches/@ayanworks+polygon-did-resolver+0.0.16-alpha.10.patch deleted file mode 100644 index 8256de9e..00000000 --- a/patches/@ayanworks+polygon-did-resolver+0.0.16-alpha.10.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/node_modules/@ayanworks/polygon-did-resolver/build/config.js b/node_modules/@ayanworks/polygon-did-resolver/build/config.js -index 6362a6b..a83b612 100644 ---- a/node_modules/@ayanworks/polygon-did-resolver/build/config.js -+++ b/node_modules/@ayanworks/polygon-did-resolver/build/config.js -@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); - exports.networkConfig = void 0; - exports.networkConfig = { - testnet: { -- URL: 'https://rpc-mumbai.maticvigil.com/', -+ URL: 'https://polygon-mumbai.infura.io/v3/0579d305568d404e996e49695e9272a3', - CONTRACT_ADDRESS: '0x12513116875BB3E4F098Ce74624739Ee51bAf023', - }, - mainnet: { \ No newline at end of file diff --git a/samples/cliConfig.json b/samples/cliConfig.json index 2e5ef5f6..4b274743 100644 --- a/samples/cliConfig.json +++ b/samples/cliConfig.json @@ -39,9 +39,9 @@ "autoAcceptMediationRequests": false, "adminPort": 4001, "tenancy": true, - "didRegistryContractAddress": "0x12513116875BB3E4F098Ce74624739Ee51bAf023", - "schemaManagerContractAddress": "0x552992e9f14b15bBd76488cD4c38c89B80259f37", - "rpcUrl": "https://polygon-mumbai.infura.io/v3/0579d305568d404e996e49695e9272a3", + "didRegistryContractAddress": "0xc087766218b885C6283072BA316a2Bc31B5c17db", + "schemaManagerContractAddress": "0xD6f235F1159970211B3628CbC15e6c75D4Fb6e6e", + "rpcUrl": "https://rpc-amoy.polygon.technology", "fileServerUrl": "https://schema.credebl.id/", "fileServerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk" } diff --git a/src/cliAgent.ts b/src/cliAgent.ts index b9a0179b..ba00685d 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -176,11 +176,11 @@ const getModules = (networkConfig: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]]) questionAnswer: new QuestionAnswerModule(), polygon: new PolygonModule({ - didContractAddress: '0x12513116875BB3E4F098Ce74624739Ee51bAf023', - schemaManagerContractAddress: '0x552992e9f14b15bBd76488cD4c38c89B80259f37', + didContractAddress: '0xc087766218b885C6283072BA316a2Bc31B5c17db', + schemaManagerContractAddress: '0xD6f235F1159970211B3628CbC15e6c75D4Fb6e6e', fileServerToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk', - rpcUrl: 'https://polygon-mumbai.infura.io/v3/0579d305568d404e996e49695e9272a3', + rpcUrl: 'https://rpc-amoy.polygon.technology', serverUrl: 'https://schema.credebl.id', }), } diff --git a/src/routes/routes.ts b/src/routes/routes.ts index b206b41e..98a5f1db 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -131,6 +131,7 @@ const models: TsoaRoute.Models = { "@type": {"dataType":"string","required":true}, "@id": {"dataType":"string","required":true}, "~thread": {"dataType":"nestedObjectLiteral","nestedProperties":{"pthid":{"dataType":"string"},"thid":{"dataType":"string"}}}, + "messageType": {"dataType":"string","required":true}, }, "additionalProperties": {"dataType":"any"}, }, diff --git a/src/routes/swagger.json b/src/routes/swagger.json index f31073a1..2eb97060 100644 --- a/src/routes/swagger.json +++ b/src/routes/swagger.json @@ -284,11 +284,15 @@ } }, "type": "object" + }, + "messageType": { + "type": "string" } }, "required": [ "@type", - "@id" + "@id", + "messageType" ], "type": "object", "additionalProperties": {} diff --git a/yarn.lock b/yarn.lock index f67adfff..0bcb84ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -49,27 +49,27 @@ dependencies: static-eval "2.0.2" -"@ayanworks/credo-polygon-w3c-module@0.0.2-alpha.3": - version "0.0.2-alpha.3" - resolved "https://registry.yarnpkg.com/@ayanworks/credo-polygon-w3c-module/-/credo-polygon-w3c-module-0.0.2-alpha.3.tgz#c3ee5d71944427de99e777b5828e9864720acf4d" - integrity sha512-YMyPo4sEh1KWxeZ5fdGSZv+41Tm1zmnD+dSn53alHGx30KuwxSFzZnmw45Z0OM8imfjBuIsaLpGgZcl6i2A/Qw== - dependencies: - "@ayanworks/polygon-did-registrar" "0.0.16-alpha.13" - "@ayanworks/polygon-did-resolver" "0.0.16-alpha.10" - "@ayanworks/polygon-schema-manager" "0.0.2-alpha.5" - "@credo-ts/askar" "0.5.0" - "@credo-ts/core" "0.5.0" +"@ayanworks/credo-polygon-w3c-module@0.0.2-alpha.7": + version "0.0.2-alpha.7" + resolved "https://registry.yarnpkg.com/@ayanworks/credo-polygon-w3c-module/-/credo-polygon-w3c-module-0.0.2-alpha.7.tgz#003e09a4249a4618da914d3504ffafb522c74133" + integrity sha512-AK9rBqFYUvV8/VaD/X7b+/simfasbPuUgJCi1L1V4SIc2lJhJ2cxaI8OdEv5V1xBytmBdSC+THfSaKg0py3QRA== + dependencies: + "@ayanworks/polygon-did-registrar" "0.0.16-alpha.16" + "@ayanworks/polygon-did-resolver" "0.0.16-alpha.11" + "@ayanworks/polygon-schema-manager" "0.0.2-alpha.6" + "@credo-ts/askar" "0.5.1" + "@credo-ts/core" "0.5.1" did-resolver "^4.1.0" ethers "^6.9.0" -"@ayanworks/polygon-did-registrar@0.0.16-alpha.13": - version "0.0.16-alpha.13" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registrar/-/polygon-did-registrar-0.0.16-alpha.13.tgz#cdb7f4dfee1f6e97006630d57c3a520051c09aeb" - integrity sha512-fihShp7HMMtzwuxV0VAVk/piktr/auig2Gj0rGq0S1x0GWP0NbZy7baLZvsVx4/kjgFNqu6cv3p42dmYVnRuIg== +"@ayanworks/polygon-did-registrar@0.0.16-alpha.16": + version "0.0.16-alpha.16" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registrar/-/polygon-did-registrar-0.0.16-alpha.16.tgz#8467412a8138ffb8b2305bf4ea7914a4ce979267" + integrity sha512-q3Y1bzeHmCAxRpbA6rXKaO9CQhLjlP4aMZuJxYiiicPlQ6plkRt+Icxdp1ozsCEcMouj3l4E5kgzjK48bhOxrw== dependencies: "@ayanworks/polygon-did-registry-contract" "2.0.1-alpha.3" - "@ayanworks/polygon-did-resolver" "^0.0.16-alpha.10" - "@credo-ts/core" "0.5.0" + "@ayanworks/polygon-did-resolver" "^0.0.16-alpha.11" + "@credo-ts/core" "0.5.1" "@ethersproject/basex" "^5.7.0" "@ethersproject/signing-key" "^5.7.0" "@ethersproject/transactions" "^5.7.0" @@ -83,22 +83,22 @@ resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-registry-contract/-/polygon-did-registry-contract-2.0.1-alpha.3.tgz#7bb932b712a4c48df857682f27adfb08154c4358" integrity sha512-8FZZVAmzXZn0pjZasuxdRblL0obK91JoaoXzpM4oZ7hD5VRUbiWf7BTh17WsWc6Oaf6XtafT4csuBo11fZiUoQ== -"@ayanworks/polygon-did-resolver@0.0.16-alpha.10", "@ayanworks/polygon-did-resolver@^0.0.16-alpha.10", "@ayanworks/polygon-did-resolver@^0.0.16-alpha.3": - version "0.0.16-alpha.10" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-resolver/-/polygon-did-resolver-0.0.16-alpha.10.tgz#85eb53f2f6dd53c5e6342e9d6d0c70bb560fa281" - integrity sha512-RfxDr+bggYcLsdN6nK+VKwjVLZzy3AqGULSsYT2bU+4n8obptufVIDg1cjbI4zi0eQIVmtkUeaHcJMlaR6wvvA== +"@ayanworks/polygon-did-resolver@0.0.16-alpha.11", "@ayanworks/polygon-did-resolver@^0.0.16-alpha.11": + version "0.0.16-alpha.11" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-did-resolver/-/polygon-did-resolver-0.0.16-alpha.11.tgz#fe115f9a63eea5e0604712549e9c573dcef7d55c" + integrity sha512-rQ6iVz0uht/hLkYA29E2iHN7xW0EusG6ognndBJF0QUxuPBB2kbmcr/4kW1E1m8FJLPvmEX/ed5v0pbBnGSJwA== dependencies: "@ayanworks/polygon-did-registry-contract" "2.0.1-alpha.3" did-resolver "^4.1.0" ethers "^5.1.0" -"@ayanworks/polygon-schema-manager@0.0.2-alpha.5": - version "0.0.2-alpha.5" - resolved "https://registry.yarnpkg.com/@ayanworks/polygon-schema-manager/-/polygon-schema-manager-0.0.2-alpha.5.tgz#f5b29b513c07f28eb52f52d6fa33ffec0b919370" - integrity sha512-0BnJ2FxmHnLia2zDxj7MPRnD7u5FA3LZF8xwuZf5vlHE9Jh/sgV6dQg5XMnPYmyhdlxSrTQ8FpNZbAir2PuMGQ== +"@ayanworks/polygon-schema-manager@0.0.2-alpha.6": + version "0.0.2-alpha.6" + resolved "https://registry.yarnpkg.com/@ayanworks/polygon-schema-manager/-/polygon-schema-manager-0.0.2-alpha.6.tgz#a872afc1166e39561dba63f0ba83f898376bb874" + integrity sha512-H8W0eS//Q3eDCiwtEqfqPhGW3bRLWOkJU1EYOuiwZGaIuZb4kWbYqAGdgl0s5g0ZP1rjirk4Ztx1w10cWqsZWw== dependencies: "@ayanworks/polygon-did-registry-contract" "2.0.1-alpha.3" - "@ayanworks/polygon-did-resolver" "^0.0.16-alpha.3" + "@ayanworks/polygon-did-resolver" "^0.0.16-alpha.11" "@nomicfoundation/hardhat-verify" "^2.0.3" axios "^1.6.3" did-resolver "^4.1.0" @@ -603,35 +603,35 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@credo-ts/anoncreds@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/anoncreds/-/anoncreds-0.5.0.tgz#74bcaec9b3e5f75fd03924efc2e8bd67b905b035" - integrity sha512-fYPYxGV2S99dTCb0LHcHnJrVL3FLgrON5tFiv6U7By6aR9paT70Gwep/Lyp0WNzssg2vZ+a4gEf2gKjQiBE8pA== +"@credo-ts/anoncreds@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/anoncreds/-/anoncreds-0.5.1.tgz#d1ba19e5764e1de5982a0a7e51cd5bc1badce6ad" + integrity sha512-d97wELxvt7jOqgr21FOVfFqHFSu487L+qF0QObOVCl9xElsST9sYl1iaRPHHW2GzYUMWLlnSwZm8fN4pLo9UVA== dependencies: "@astronautlabs/jsonpath" "^1.1.2" - "@credo-ts/core" "0.5.0" + "@credo-ts/core" "0.5.1" big-integer "^1.6.51" bn.js "^5.2.1" class-transformer "0.5.1" class-validator "0.14.1" reflect-metadata "^0.1.13" -"@credo-ts/askar@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/askar/-/askar-0.5.0.tgz#5fa2e6443fe3ae1b15c8b66eb73e63beb5c096a1" - integrity sha512-84wxDU6GbucBTe4HV7gUbCieFdhXVX19q8o6dNK8a3zl87yiV3OVwPwtnzghjh47vv14Xr+gWRvqbRvZrhRsaA== +"@credo-ts/askar@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/askar/-/askar-0.5.1.tgz#107d2f91f6afecb77fc7f24556725ec0e7597989" + integrity sha512-O3XWnmpnEe5U/a0kGQHigzXPw6/SXKp2v4ob3DJdHA0kiK3DywANNeG/Hw44lxdg24nNpizmVlO5EjRa6ULcmw== dependencies: - "@credo-ts/core" "0.5.0" + "@credo-ts/core" "0.5.1" bn.js "^5.2.1" class-transformer "0.5.1" class-validator "0.14.1" rxjs "^7.8.0" tsyringe "^4.8.0" -"@credo-ts/core@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/core/-/core-0.5.0.tgz#a6366df4b176a492f4f45b7e2f45b8c905e1eeca" - integrity sha512-7SJBgs1yd2gpwv8BnCO+U63Uu06v6Cxzg+ypWpqyNkkG4nTsQZSI8r0oSQ+DgbiqwN/AZKsn9HuNISFftf5yKQ== +"@credo-ts/core@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/core/-/core-0.5.1.tgz#bb38e2f5451753cea1d3a73b1d407255af02c4ed" + integrity sha512-ywwFw6wwiMft3A994Y91LAm8CrEg2G7CJQRyLD8UzneU4coMWZTeED63thAEX6XK/tyDmv2MAcrO04hE3KQPcA== dependencies: "@digitalcredentials/jsonld" "^6.0.0" "@digitalcredentials/jsonld-signatures" "^9.4.0" @@ -665,22 +665,22 @@ varint "^6.0.0" web-did-resolver "^2.0.21" -"@credo-ts/indy-vdr@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/indy-vdr/-/indy-vdr-0.5.0.tgz#1799b2a90599d000a43c5dc59e7bd1e1eda68fe1" - integrity sha512-hW7xDdL6fVIgTIclmJRfVz3mlpo87Cwk6hCiRY1/lWV62bsKs6RHGLv6RUp+WPwTIpPpbBs6T1Dm85ditBbxpA== +"@credo-ts/indy-vdr@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/indy-vdr/-/indy-vdr-0.5.1.tgz#1fe4719235f3e586e770e57aa46bba7182d53c10" + integrity sha512-pXRAKzLlwijaNaCOPheV9dHeZm0FAfiJw9kYEvpjBn+d/ARygb92kr9lJizUGK3cPtF9dbhrNBuLWwskM39fCw== dependencies: - "@credo-ts/anoncreds" "0.5.0" - "@credo-ts/core" "0.5.0" + "@credo-ts/anoncreds" "0.5.1" + "@credo-ts/core" "0.5.1" -"@credo-ts/node@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/node/-/node-0.5.0.tgz#d28ed5040f9925777a65f66f55abed7c2d2e53de" - integrity sha512-/44SrgmjuRDE4Sjb6QDMvquPTUsH5DkIp8pbN7csLe0GEDDzPOUvzCaf4yI7TRnuSZN9Nh9/f6C2UGn0JuQ0Sg== +"@credo-ts/node@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/node/-/node-0.5.1.tgz#adf24f931fd80848722f8f313012be00da405deb" + integrity sha512-F/PA3wyKN9MvH2JFSUmYGqQT+JaeSGKWNJxT+OkQzqseCZnCbErAnr8oNWlTwBWogp6ECx31FEn9wMq9zAMLaw== dependencies: "@2060.io/ffi-napi" "^4.0.8" "@2060.io/ref-napi" "^3.0.6" - "@credo-ts/core" "0.5.0" + "@credo-ts/core" "0.5.1" "@types/express" "^4.17.15" express "^4.17.1" ws "^8.13.0" @@ -694,22 +694,22 @@ class-validator "0.14.1" tsyringe "^4.6.0" -"@credo-ts/question-answer@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/question-answer/-/question-answer-0.5.0.tgz#d3871127a36f783c7977c3cbcca8a23523453a32" - integrity sha512-cF4RRoVIS05ssIMk4iNQcn53k5E3G4jHVTSrBr3ZoV5EAGHTQ0Y5NMlLCx7kLlY31KGvhdiPXxeECG/uSiS3sg== +"@credo-ts/question-answer@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/question-answer/-/question-answer-0.5.1.tgz#538dbfec8fc866de188c11ede9860bf0ef712937" + integrity sha512-yPjOl3tUfK5GT9BvX70hiTq86Fi5WTxB0pL42e17evq7+puBOMqhwQ1nv7dhDSWC2Oy+r0D0mF7Lz2hGulrJJg== dependencies: - "@credo-ts/core" "0.5.0" + "@credo-ts/core" "0.5.1" class-transformer "0.5.1" class-validator "0.14.1" rxjs "^7.8.0" -"@credo-ts/tenants@0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@credo-ts/tenants/-/tenants-0.5.0.tgz#e32943d66580af3b7bf6970fb3321329a479271d" - integrity sha512-SB2btH9adWLBwBs2d3od9VTF6AA2Bfzl3oJovlrcdWHXSYQWf0Hm+PRkvmL8+RYwdGtDM8uBKQrkbdPBGWEWAA== +"@credo-ts/tenants@0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@credo-ts/tenants/-/tenants-0.5.1.tgz#63ca79eb0a6c7d4bdf43ea00ed712d7399c25421" + integrity sha512-+wJ+Wd3rThY6eP9e3WYFeFlJKQEUrmJPhN5t+vr4zyhB5T7pM5Nsg53pzugWoCeWsMUNCqmHo12Tc9edQTH0bg== dependencies: - "@credo-ts/core" "0.5.0" + "@credo-ts/core" "0.5.1" async-mutex "^0.4.0" "@cspotcode/source-map-support@^0.8.0": @@ -1276,6 +1276,18 @@ resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.0.tgz#0709e9f4cb252351c609c6e6d8d6779a8d25edff" integrity sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA== +"@hapi/hoek@^9.0.0", "@hapi/hoek@^9.3.0": + version "9.3.0" + resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb" + integrity sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ== + +"@hapi/topo@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012" + integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg== + dependencies: + "@hapi/hoek" "^9.0.0" + "@humanwhocodes/config-array@^0.5.0": version "0.5.0" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" @@ -1759,6 +1771,23 @@ "@sd-jwt/types" "0.3.0" buffer "*" +"@sideway/address@^4.1.5": + version "4.1.5" + resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.5.tgz#4bc149a0076623ced99ca8208ba780d65a99b9d5" + integrity sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q== + dependencies: + "@hapi/hoek" "^9.0.0" + +"@sideway/formula@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.1.tgz#80fcbcbaf7ce031e0ef2dd29b1bfc7c3f583611f" + integrity sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg== + +"@sideway/pinpoint@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" + integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== + "@sindresorhus/is@^4.0.0": version "4.6.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" @@ -5584,6 +5613,17 @@ jest@^27.3.1: import-local "^3.0.2" jest-cli "^27.5.1" +joi@^17.12.3: + version "17.12.3" + resolved "https://registry.yarnpkg.com/joi/-/joi-17.12.3.tgz#944646979cd3b460178547b12ba37aca8482f63d" + integrity sha512-2RRziagf555owrm9IRVtdKynOBeITiDpuZqIpgwqXShPncPKNiRQoiGsl/T8SQdq+8ugRzH2LqY67irr2y/d+g== + dependencies: + "@hapi/hoek" "^9.3.0" + "@hapi/topo" "^5.1.0" + "@sideway/address" "^4.1.5" + "@sideway/formula" "^3.0.1" + "@sideway/pinpoint" "^2.0.0" + js-sha3@0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" From 07de941d633f32bf34f7187970eb70bf8403d973 Mon Sep 17 00:00:00 2001 From: KulkarniShashank Date: Mon, 29 Apr 2024 16:29:59 +0530 Subject: [PATCH 12/13] refactor: add the recipientKey in create invitation functionality Signed-off-by: KulkarniShashank Signed-off-by: tipusinghaw --- .../multi-tenancy/MultiTenancyController.ts | 20 +++++++++++++-- .../outofband/OutOfBandController.ts | 25 +++++++++++++------ 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/controllers/multi-tenancy/MultiTenancyController.ts b/src/controllers/multi-tenancy/MultiTenancyController.ts index 9a3ccafc..5b78361e 100644 --- a/src/controllers/multi-tenancy/MultiTenancyController.ts +++ b/src/controllers/multi-tenancy/MultiTenancyController.ts @@ -639,12 +639,27 @@ export class MultiTenancyController extends Controller { public async createInvitation( @Res() internalServerError: TsoaResponse<500, { message: string }>, @Path('tenantId') tenantId: string, - @Body() config?: Omit // props removed because of issues with serialization + @Body() config?: Omit & RecipientKeyOption // Remove routing property from type ) { let outOfBandRecord: OutOfBandRecord | undefined + let finalConfig: Omit & RecipientKeyOption & { routing?: Routing } = {} // Initialize finalConfig + try { await this.agent.modules.tenants.withTenantAgent({ tenantId }, async (tenantAgent) => { - outOfBandRecord = await tenantAgent.oob.createInvitation(config) + if (config?.recipientKey) { + const routing: Routing = { + // Initialize routing object + endpoints: tenantAgent.config.endpoints, + routingKeys: [], + recipientKey: Key.fromPublicKeyBase58(config.recipientKey, KeyType.Ed25519), + mediatorId: undefined, + } + finalConfig = { ...config, routing } // Assign finalConfig + } else { + finalConfig = { ...config, routing: await tenantAgent.mediationRecipient.getRouting({}) } // Assign finalConfig + } + + outOfBandRecord = await tenantAgent.oob.createInvitation(finalConfig) }) return { @@ -655,6 +670,7 @@ export class MultiTenancyController extends Controller { useDidSovPrefixWhereAllowed: this.agent.config.useDidSovPrefixWhereAllowed, }), outOfBandRecord: outOfBandRecord?.toJSON(), + ...(finalConfig?.recipientKey ? {} : { recipientKey: finalConfig.routing?.recipientKey.publicKeyBase58 }), // Access recipientKey from routing } } catch (error) { return internalServerError(500, { message: `something went wrong: ${error}` }) diff --git a/src/controllers/outofband/OutOfBandController.ts b/src/controllers/outofband/OutOfBandController.ts index 96704fde..dbb23eb9 100644 --- a/src/controllers/outofband/OutOfBandController.ts +++ b/src/controllers/outofband/OutOfBandController.ts @@ -1,5 +1,5 @@ import type { OutOfBandInvitationProps, OutOfBandRecordWithInvitationProps } from '../examples' -import type { AgentMessageType, RecipientKeyOption } from '../types' +import type { AgentMessageType, RecipientKeyOption, CreateInvitationOptions } from '../types' import type { ConnectionRecordProps, CreateLegacyInvitationConfig, Routing } from '@credo-ts/core' import { @@ -14,12 +14,7 @@ import { import { injectable } from 'tsyringe' import { ConnectionRecordExample, outOfBandInvitationExample, outOfBandRecordExample, RecordId } from '../examples' -import { - AcceptInvitationConfig, - ReceiveInvitationByUrlProps, - ReceiveInvitationProps, - CreateInvitationOptions, -} from '../types' +import { AcceptInvitationConfig, ReceiveInvitationByUrlProps, ReceiveInvitationProps } from '../types' import { Body, @@ -101,9 +96,22 @@ export class OutOfBandController extends Controller { @Post('/create-invitation') public async createInvitation( @Res() internalServerError: TsoaResponse<500, { message: string }>, - @Body() config: CreateInvitationOptions // props removed because of issues with serialization + @Body() config: CreateInvitationOptions & RecipientKeyOption // props removed because of issues with serialization ) { try { + let routing: Routing + if (config?.recipientKey) { + routing = { + endpoints: this.agent.config.endpoints, + routingKeys: [], + recipientKey: Key.fromPublicKeyBase58(config.recipientKey, KeyType.Ed25519), + mediatorId: undefined, + } + } else { + routing = await this.agent.mediationRecipient.getRouting({}) + } + + config.routing = routing const outOfBandRecord = await this.agent.oob.createInvitation(config) return { invitationUrl: outOfBandRecord.outOfBandInvitation.toUrl({ @@ -113,6 +121,7 @@ export class OutOfBandController extends Controller { useDidSovPrefixWhereAllowed: this.agent.config.useDidSovPrefixWhereAllowed, }), outOfBandRecord: outOfBandRecord.toJSON(), + ...(config?.recipientKey ? {} : { recipientKey: routing.recipientKey.publicKeyBase58 }), } } catch (error) { return internalServerError(500, { message: `something went wrong: ${error}` }) From e4f0df608fa82f68f0c104cedc50f82b400bea57 Mon Sep 17 00:00:00 2001 From: pallavighule <61926403+pallavighule@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:44:12 +0530 Subject: [PATCH 13/13] refactor:add outOfBandId into issuance webhook event (#94) Signed-off-by: tipusinghaw --- src/events/CredentialEvents.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/events/CredentialEvents.ts b/src/events/CredentialEvents.ts index 10b1cb36..1d60b558 100644 --- a/src/events/CredentialEvents.ts +++ b/src/events/CredentialEvents.ts @@ -1,3 +1,4 @@ +import type { RestMultiTenantAgentModules } from '../cliAgent' import type { ServerConfig } from '../utils/ServerConfig' import type { Agent, CredentialStateChangedEvent } from '@credo-ts/core' @@ -6,11 +7,26 @@ import { CredentialEventTypes } from '@credo-ts/core' import { sendWebSocketEvent } from './WebSocketEvents' import { sendWebhookEvent } from './WebhookEvent' -export const credentialEvents = async (agent: Agent, config: ServerConfig) => { +export const credentialEvents = async (agent: Agent, config: ServerConfig) => { agent.events.on(CredentialEventTypes.CredentialStateChanged, async (event: CredentialStateChangedEvent) => { const record = event.payload.credentialRecord - const body = { ...record.toJSON(), ...event.metadata } + const body: Record = { + ...record.toJSON(), + ...event.metadata, + outOfBandId: null, + } + + if (event.metadata.contextCorrelationId !== 'default' && record?.connectionId) { + await agent.modules.tenants.withTenantAgent( + { tenantId: event.metadata.contextCorrelationId }, + async (tenantAgent) => { + const connectionRecord = await tenantAgent.connections.findById(record.connectionId!) + + body.outOfBandId = connectionRecord?.outOfBandId + } + ) + } // Only send webhook if webhook url is configured if (config.webhookUrl) { await sendWebhookEvent(config.webhookUrl + '/credentials', body, agent.config.logger)