Skip to content

Commit 8530cd3

Browse files
GHkrishnaankita-p17KambleSahil3Sheetal-ayanworkstipusinghaw
authored
merge: qa to prod 30 august 2024 (credebl#199)
* Added proof and credential record Id in oob offer output Signed-off-by: ankita_patidar <[email protected]> * Remove unnecessary details Signed-off-by: ankita_patidar <[email protected]> * fix prettier Signed-off-by: ankita_patidar <[email protected]> * add record threadId in output Signed-off-by: Ankita Patidar <[email protected]> * chore: package update (credebl#124) * added taskdef Signed-off-by: KambleSahil3 <[email protected]> * Added credo taskdef.json file for ECS Signed-off-by: KambleSahil3 <[email protected]> * Delete taskdef/credo-ecs-credo-taskdef.json-taskdef.json Signed-off-by: KambleSahil3 <[email protected]> * Update credo-ecs-taskdef.json Signed-off-by: KambleSahil3 <[email protected]> * Update credo-ecs-taskdef.json Signed-off-by: KambleSahil3 <[email protected]> * Update credo-ecs-taskdef.json Signed-off-by: KambleSahil3 <[email protected]> * Update credo-ecs-taskdef.json Signed-off-by: KambleSahil3 <[email protected]> * Update credo-ecs-taskdef.json Signed-off-by: KambleSahil3 <[email protected]> * Update credo-ecs-taskdef.json Signed-off-by: KambleSahil3 <[email protected]> * chore: updated contract address and packages for major package release (credebl#126) * fix: TAA versioning for indicio testnet (credebl#127) * chore: fix naming Signed-off-by: Krishna Waske <[email protected]> * chore: fix naming Signed-off-by: Krishna Waske <[email protected]> * fix: add prestart Signed-off-by: Krishna Waske <[email protected]> * fix: update packages Signed-off-by: Krishna Waske <[email protected]> * fix: patch for conflicts in model Extensible Signed-off-by: Krishna Waske <[email protected]> * chore: fix DCO Signed-off-by: Krishna Waske <[email protected]> * chore: fix DCO Signed-off-by: Krishna Waske <[email protected]> * chore: fix DCO Signed-off-by: Krishna Waske <[email protected]> * chore: fix DCO Signed-off-by: Krishna Waske <[email protected]> * fix: error handling for Agent controller Signed-off-by: Krishna Waske <[email protected]> * fix: error handling for Basic Message controller Signed-off-by: Krishna Waske <[email protected]> * fix: error handling for Connection Controller Signed-off-by: Krishna Waske <[email protected]> * fix: spacing Signed-off-by: Krishna Waske <[email protected]> * fix: error handling for Credential Controller Signed-off-by: Krishna Waske <[email protected]> * fix: error handling for CredentialDEfinition Controller Signed-off-by: Krishna Waske <[email protected]> * fix: error handling for Schema Controller Signed-off-by: Krishna Waske <[email protected]> * fix: error handling for Did Controller Signed-off-by: Krishna Waske <[email protected]> * fix: error handling for Endorse Transaction Controller Signed-off-by: Krishna Waske <[email protected]> * fix: add examples Signed-off-by: Krishna Waske <[email protected]> * fix: error handling for Question Answer Controller Signed-off-by: Krishna Waske <[email protected]> * chore: fix DCO Signed-off-by: Krishna Waske <[email protected]> * chore: fix DCO Signed-off-by: Krishna Waske <[email protected]> * chore: fix DCO Signed-off-by: Krishna Waske <[email protected]> * chore: fix DCO Signed-off-by: Krishna Waske <[email protected]> * chore: fix DCO Signed-off-by: Krishna Waske <[email protected]> * fix: redirection Signed-off-by: Krishna Waske <[email protected]> * fix: error handling Signed-off-by: Krishna Waske <[email protected]> * chore: fix DCO Signed-off-by: Krishna Waske <[email protected]> * chore: fix DCO Signed-off-by: Krishna Waske <[email protected]> * chore: fix DCO Signed-off-by: Krishna Waske <[email protected]> * chore: fix DCO Signed-off-by: Krishna Waske <[email protected]> * refactor:added condition for insufficient balance Signed-off-by: tipusinghaw <[email protected]> * fix: removed string type for the create schema Signed-off-by: tipusinghaw <[email protected]> * fix: matching return type according to previous implementation Signed-off-by: Krishna Waske <[email protected]> * fix: matching return type according to previous implementation for Schema Controller Signed-off-by: Krishna Waske <[email protected]> * fix: remove commented code Signed-off-by: Krishna Waske <[email protected]> * fix: remove commented code Signed-off-by: Krishna Waske <[email protected]> * chore: add TODOs Signed-off-by: Krishna Waske <[email protected]> * refactor: improve typing Signed-off-by: Krishna Waske <[email protected]> * fix: error handling for Credential controller Signed-off-by: Krishna Waske <[email protected]> * chore: update auto generated files Signed-off-by: Krishna Waske <[email protected]> * refactor: updated docker file Signed-off-by: [email protected] <[email protected]> * refactor: error handling for proof controller (credebl#139) * refactor: error handling oob controller (credebl#137) Co-authored-by: Sai Ranjit Tummalapalli <[email protected]> * refactor: error handling of polygon controller (credebl#143) Signed-off-by: pranalidhanavade <[email protected]> * refactor: error handling for endorser controller (credebl#141) * refactor: error handling of endorser controller Signed-off-by: pranalidhanavade <[email protected]> * resolved: comments on pull request Signed-off-by: pranalidhanavade <[email protected]> --------- Signed-off-by: pranalidhanavade <[email protected]> * Refactor/error handling for multi-tenancy controller (credebl#144) * refactor: error handling of polygon controller Signed-off-by: pranalidhanavade <[email protected]> * refactor: error handling of multi-tenancy-question-answer APIs Signed-off-by: pranalidhanavade <[email protected]> * refactor: error handling for did-key and did-web APIs of multi-tenancy controller Signed-off-by: pranalidhanavade <[email protected]> * resolved: comments on pull request Signed-off-by: pranalidhanavade <[email protected]> * resolved: fixed comments on pull request Signed-off-by: pranalidhanavade <[email protected]> --------- Signed-off-by: pranalidhanavade <[email protected]> * Refactor/error handling for multi tenancy controller (credebl#145) * refactor: error handling of polygon controller Signed-off-by: pranalidhanavade <[email protected]> * refactor: error handling of multi-tenancy-question-answer APIs Signed-off-by: pranalidhanavade <[email protected]> * refactor: error handling for did-key and did-web APIs of multi-tenancy controller Signed-off-by: pranalidhanavade <[email protected]> * resolved: comments on pull request Signed-off-by: pranalidhanavade <[email protected]> * resolved: fixed comments on pull request Signed-off-by: pranalidhanavade <[email protected]> * refactor: error handling for proof APIs in multi-tenancy controller Signed-off-by: pranalidhanavade <[email protected]> --------- Signed-off-by: pranalidhanavade <[email protected]> * wip: refactor exception handling for multi-tenancy controller (credebl#142) * wip: applied validations for network type Signed-off-by: bhavanakarwade <[email protected]> * refactor: added swagger and route file Signed-off-by: bhavanakarwade <[email protected]> * wip: exception-handling-multi-tenancy Signed-off-by: bhavanakarwade <[email protected]> * wip: added routes and json file Signed-off-by: bhavanakarwade <[email protected]> * refactor: added routes and json files Signed-off-by: bhavanakarwade <[email protected]> * wip: error handling for multitenancy controller Signed-off-by: bhavanakarwade <[email protected]> * fix: resolved conflicts Signed-off-by: bhavanakarwade <[email protected]> --------- Signed-off-by: bhavanakarwade <[email protected]> * fix:schema file server url Signed-off-by: tipusinghaw <[email protected]> * feat: created new event for reuse connection (credebl#148) Signed-off-by: tipusinghaw <[email protected]> * removed yarn.lock file to solve frozen-lockfile error Signed-off-by: [email protected] <[email protected]> * resolved frozen-lockfile error Signed-off-by: [email protected] <[email protected]> * deleted config.json Signed-off-by: [email protected] <[email protected]> * changes in taskdef.json for fargate Signed-off-by: [email protected] <[email protected]> * changes family name in taskdef.json Signed-off-by: [email protected] <[email protected]> * fix: externalise env Signed-off-by: Krishna Waske <[email protected]> * fix: externalise env Signed-off-by: Krishna Waske <[email protected]> * fix: number conversion Signed-off-by: Krishna Waske <[email protected]> * fix: remove logs Signed-off-by: Krishna Waske <[email protected]> * fix: sample env variable Signed-off-by: Krishna Waske <[email protected]> * fix: remove comments Signed-off-by: Krishna Waske <[email protected]> * fix: remove comments Signed-off-by: Krishna Waske <[email protected]> * chore: github warnings Signed-off-by: Krishna Waske <[email protected]> * chore: fix preetier Signed-off-by: Krishna Waske <[email protected]> * chore: fix preetier Signed-off-by: Krishna Waske <[email protected]> * feat: multi-tenancy basic message Signed-off-by: KulkarniShashank <[email protected]> * feat: added formData in credential webhook Signed-off-by: pallavicoder <[email protected]> * fix:added-patch Signed-off-by: pallavicoder <[email protected]> * wip: added json limit configurations Signed-off-by: bhavanakarwade <[email protected]> * fix:added patch for prettyVc Signed-off-by: pallavicoder <[email protected]> * fix:added patch for prettyVc Signed-off-by: pallavicoder <[email protected]> * fix: provision to default to 'Infinity' if required Signed-off-by: Krishna Waske <[email protected]> * fix: yarn lock Signed-off-by: Krishna Waske <[email protected]> * Update .env.sample file Signed-off-by: KulkarniShashank <[email protected]> * fix: added assertion method in did web Signed-off-by: tipusinghaw <[email protected]> * merge: DEV to QA (credebl#196) * fix:added-reuse-connection-event Signed-off-by: pallavicoder <[email protected]> * fix: added patch for avoiding proof abandoned issue (credebl#177) * fix:added cache tenant record patch Signed-off-by: pallavicoder <[email protected]> * fix: w3c issuance without holderDID (credebl#179) * updated Taskdef.json Signed-off-by: [email protected] <[email protected]> * updated Taskdef.json Signed-off-by: [email protected] <[email protected]> Signed-off-by: Krishna Waske <[email protected]> * fix:added-reuse-connection-event Signed-off-by: pallavicoder <[email protected]> Signed-off-by: Krishna Waske <[email protected]> * fix: added patch for avoiding proof abandoned issue (credebl#177) Signed-off-by: Krishna Waske <[email protected]> * fix:added cache tenant record patch Signed-off-by: pallavicoder <[email protected]> Signed-off-by: Krishna Waske <[email protected]> * fix: w3c issuance without holderDID (credebl#179) Signed-off-by: Krishna Waske <[email protected]> * Update .env.sample file Signed-off-by: KulkarniShashank <[email protected]> Signed-off-by: Krishna Waske <[email protected]> * refactor: Implemented white labeling in taskdef.json file Signed-off-by: [email protected] <[email protected]> * fix: sign off develop (credebl#190) Co-authored-by: [email protected] <[email protected]> Co-authored-by: bhavanakarwade <[email protected]> Co-authored-by: pallavicoder <[email protected]> Co-authored-by: tipusinghaw <[email protected]> Co-authored-by: pallavighule <[email protected]> Co-authored-by: KulkarniShashank <[email protected]> fix: added patch for avoiding proof abandoned issue (credebl#177) fix: w3c issuance without holderDID (credebl#179) * refactor: Updated taskdef.josn file Signed-off-by: [email protected] <[email protected]> * feat: added reuse connection for dedicated agent (credebl#193) * feat: added reuse connection for dedicated agent Signed-off-by: bhavanakarwade <[email protected]> * fix: remove goalcode from oob issuance Signed-off-by: bhavanakarwade <[email protected]> --------- Signed-off-by: bhavanakarwade <[email protected]> * refactor: replace the bcovrin network url Signed-off-by: KulkarniShashank <[email protected]> --------- Signed-off-by: pallavicoder <[email protected]> Signed-off-by: [email protected] <[email protected]> Signed-off-by: Krishna Waske <[email protected]> Signed-off-by: KulkarniShashank <[email protected]> Signed-off-by: bhavanakarwade <[email protected]> Co-authored-by: pallavicoder <[email protected]> Co-authored-by: pallavighule <[email protected]> Co-authored-by: Krishna <[email protected]> Co-authored-by: [email protected] <[email protected]> Co-authored-by: KambleSahil3 <[email protected]> Co-authored-by: KulkarniShashank <[email protected]> Co-authored-by: tipusinghaw <[email protected]> Co-authored-by: Sai Ranjit Tummalapalli <[email protected]> Co-authored-by: Shashank Kulkarni <[email protected]> --------- Signed-off-by: ankita_patidar <[email protected]> Signed-off-by: Ankita Patidar <[email protected]> Signed-off-by: KambleSahil3 <[email protected]> Signed-off-by: KambleSahil3 <[email protected]> Signed-off-by: Krishna Waske <[email protected]> Signed-off-by: tipusinghaw <[email protected]> Signed-off-by: [email protected] <[email protected]> Signed-off-by: pranalidhanavade <[email protected]> Signed-off-by: bhavanakarwade <[email protected]> Signed-off-by: KulkarniShashank <[email protected]> Signed-off-by: pallavicoder <[email protected]> Co-authored-by: ankita_patidar <[email protected]> Co-authored-by: KambleSahil3 <[email protected]> Co-authored-by: KambleSahil3 <[email protected]> Co-authored-by: Sheetal-ayanworks <[email protected]> Co-authored-by: tipusinghaw <[email protected]> Co-authored-by: tipusinghaw <[email protected]> Co-authored-by: Sai Ranjit Tummalapalli <[email protected]> Co-authored-by: pranalidhanavade <[email protected]> Co-authored-by: bhavanakarwade <[email protected]> Co-authored-by: KulkarniShashank <[email protected]> Co-authored-by: pallavicoder <[email protected]> Co-authored-by: pallavighule <[email protected]> Co-authored-by: bhavanakarwade <[email protected]> Co-authored-by: Shashank Kulkarni <[email protected]>
1 parent 2c8f63b commit 8530cd3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+5487
-5968
lines changed

.env.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ windowMs=
2626
maxRateLimit=
2727
# Specify Did contract address
2828
DID_CONTRACT_ADDRESS=
29+
2930
# Specify Bcovrin test genesis
3031
BCOVRIN_TEST_GENESIS=`{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","blskey_pop":"RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1","client_ip":"138.197.138.255","client_port":9702,"node_ip":"138.197.138.255","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"}
3132
{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node2","blskey":"37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk","blskey_pop":"Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5","client_ip":"138.197.138.255","client_port":9704,"node_ip":"138.197.138.255","node_port":9703,"services":["VALIDATOR"]},"dest":"8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"},"metadata":{"from":"EbP4aYNeTHL6q385GuVpRV"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"},"ver":"1"}

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ WORKDIR /app
5151
# Copy package.json and yarn.lock files
5252
COPY package.json yarn.lock ./
5353

54-
# Install dependencies
55-
RUN yarn install --frozen-lockfile
56-
5754
# Copy the rest of the application code
5855
COPY . .
5956

57+
# Install dependencies
58+
RUN yarn install --frozen-lockfile
59+
6060
RUN yarn global add patch-package
6161

6262
# Build the application

jest.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import base from './jest.config.base'
44

55
const config: Config.InitialOptions = {
66
...base,
7-
name: 'afj-controller',
8-
displayName: 'afj-controller',
7+
name: 'credo-controller',
8+
displayName: 'credo-controller',
99
testTimeout: 120000,
1010
}
1111

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@aries-framework/rest",
2+
"name": "credo-controller",
33
"main": "build/index",
44
"types": "build/index",
55
"version": "0.9.4",
@@ -28,6 +28,8 @@
2828
"tsoa": "tsoa spec-and-routes",
2929
"dev": "tsoa spec-and-routes && tsnd --respawn samples/sampleWithApp.ts",
3030
"build": "yarn run clean && yarn run compile",
31+
"prestart:dev": "yarn run clean && yarn run compile",
32+
"start:dev": "./bin/afj-rest.js --config ./samples/cliConfig.json",
3133
"clean": "rimraf -rf ./build",
3234
"compile": "tsoa spec-and-routes && tsc -p tsconfig.build.json",
3335
"prepublishOnly": "yarn run build",
@@ -37,7 +39,7 @@
3739
"validate": "yarn lint && yarn check-types && yarn check-format"
3840
},
3941
"dependencies": {
40-
"@ayanworks/credo-polygon-w3c-module": "0.0.2-alpha.10",
42+
"@ayanworks/credo-polygon-w3c-module": "1.0.0",
4143
"@credo-ts/anoncreds": "0.5.3",
4244
"@credo-ts/askar": "0.5.3",
4345
"@credo-ts/core": "0.5.3",
@@ -92,15 +94,15 @@
9294
"eslint-import-resolver-typescript": "^3.5.5",
9395
"eslint-plugin-import": "^2.27.5",
9496
"eslint-plugin-prettier": "^4.2.1",
95-
"jest": "^27.3.1",
97+
"jest": "^29.7.0",
9698
"ngrok": "^4.3.1",
9799
"prettier": "^2.8.8",
98100
"supertest": "^6.2.3",
99-
"ts-jest": "^27.0.7",
101+
"ts-jest": "^29.1.2",
100102
"ts-node-dev": "^2.0.0",
101103
"typescript": "^5.3.3"
102104
},
103105
"engines": {
104-
"node": ">=18"
106+
"node": "18.19.0"
105107
}
106108
}

patches/@credo-ts+anoncreds+0.5.3+001+fix: Extensible model confict in Anoncreds and Did.patch

Lines changed: 272 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/@credo-ts/core/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts b/node_modules/@credo-ts/core/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts
2+
index d12468b..ae70f36 100644
3+
--- a/node_modules/@credo-ts/core/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts
4+
+++ b/node_modules/@credo-ts/core/build/modules/credentials/formats/jsonld/JsonLdCredentialFormat.d.ts
5+
@@ -10,6 +10,8 @@ export interface JsonCredential {
6+
issuanceDate: string;
7+
expirationDate?: string;
8+
credentialSubject: SingleOrArray<JsonObject>;
9+
+ //TODO change type
10+
+ prettyVc?: any;
11+
[key: string]: unknown;
12+
}
13+
/**
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/node_modules/@credo-ts/core/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js b/node_modules/@credo-ts/core/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js
2+
index 006d870..da56801 100644
3+
--- a/node_modules/@credo-ts/core/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js
4+
+++ b/node_modules/@credo-ts/core/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js
5+
@@ -170,7 +170,8 @@ class DifPresentationExchangeProofFormatService {
6+
try {
7+
ps.validatePresentationDefinition(request.presentation_definition);
8+
ps.validatePresentationSubmission(jsonPresentation.presentation_submission);
9+
- ps.validatePresentation(request.presentation_definition, parsedPresentation);
10+
+ // FIXME: Commenting validatePresentation() for now due to intermittent abandoned issue
11+
+ //ps.validatePresentation(request.presentation_definition, parsedPresentation);
12+
let verificationResult;
13+
// FIXME: for some reason it won't accept the input if it doesn't know
14+
// whether it's a JWT or JSON-LD VP even though the input is the same.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/node_modules/@credo-ts/core/build/modules/credentials/protocol/v2/V2CredentialProtocol.js b/node_modules/@credo-ts/core/build/modules/credentials/protocol/v2/V2CredentialProtocol.js
2+
index fb1fb9d..b519694 100644
3+
--- a/node_modules/@credo-ts/core/build/modules/credentials/protocol/v2/V2CredentialProtocol.js
4+
+++ b/node_modules/@credo-ts/core/build/modules/credentials/protocol/v2/V2CredentialProtocol.js
5+
@@ -97,7 +97,6 @@ class V2CredentialProtocol extends BaseCredentialProtocol_1.BaseCredentialProtoc
6+
let credentialRecord = await this.findByProperties(messageContext.agentContext, {
7+
threadId: proposalMessage.threadId,
8+
role: models_1.CredentialRole.Issuer,
9+
- connectionId: connection === null || connection === void 0 ? void 0 : connection.id,
10+
});
11+
const formatServices = this.getFormatServicesFromMessage(proposalMessage.formats);
12+
if (formatServices.length === 0) {
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
diff --git a/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.d.ts b/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.d.ts
2+
index 91bb8f4..b4dae61 100644
3+
--- a/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.d.ts
4+
+++ b/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.d.ts
5+
@@ -1,5 +1,5 @@
6+
import type { TenantRecord } from '../repository';
7+
-import type { AgentContextProvider, UpdateAssistantUpdateOptions } from '@credo-ts/core';
8+
+import type { AgentContextProvider, UpdateAssistantUpdateOptions , CacheModule, InMemoryLruCache } from '@credo-ts/core';
9+
import { AgentContext, EventEmitter, Logger } from '@credo-ts/core';
10+
import { TenantRecordService } from '../services';
11+
import { TenantSessionCoordinator } from './TenantSessionCoordinator';
12+
@@ -9,7 +9,9 @@ export declare class TenantAgentContextProvider implements AgentContextProvider
13+
private eventEmitter;
14+
private logger;
15+
private tenantSessionCoordinator;
16+
- constructor(tenantRecordService: TenantRecordService, rootAgentContext: AgentContext, eventEmitter: EventEmitter, tenantSessionCoordinator: TenantSessionCoordinator, logger: Logger);
17+
+ private cacheModule;
18+
+ private inMemoryLruCache;
19+
+ constructor(tenantRecordService: TenantRecordService, rootAgentContext: AgentContext, eventEmitter: EventEmitter, tenantSessionCoordinator: TenantSessionCoordinator, logger: Logger, cache: InMemoryLruCache);
20+
getAgentContextForContextCorrelationId(contextCorrelationId: string): Promise<AgentContext>;
21+
getContextForInboundMessage(inboundMessage: unknown, options?: {
22+
contextCorrelationId?: string;
23+
diff --git a/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.js b/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.js
24+
index d491d4e..d60ec79 100644
25+
--- a/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.js
26+
+++ b/node_modules/@credo-ts/tenants/build/context/TenantAgentContextProvider.js
27+
@@ -24,16 +24,28 @@ let TenantAgentContextProvider = class TenantAgentContextProvider {
28+
this.eventEmitter = eventEmitter;
29+
this.tenantSessionCoordinator = tenantSessionCoordinator;
30+
this.logger = logger;
31+
+ this.cache = new core_1.CacheModule({
32+
+ cache: new core_1.InMemoryLruCache({ limit: 100 }),
33+
+ });
34+
// Start listener for newly created routing keys, so we can register a mapping for each new key for the tenant
35+
this.listenForRoutingKeyCreatedEvents();
36+
}
37+
async getAgentContextForContextCorrelationId(contextCorrelationId) {
38+
+ this.logger.debug('debug ========= Inside getAgentContextForContextCorrelationId')
39+
// It could be that the root agent context is requested, in that case we return the root agent context
40+
if (contextCorrelationId === this.rootAgentContext.contextCorrelationId) {
41+
return this.rootAgentContext;
42+
}
43+
// TODO: maybe we can look at not having to retrieve the tenant record if there's already a context available.
44+
- const tenantRecord = await this.tenantRecordService.getTenantById(this.rootAgentContext, contextCorrelationId);
45+
+ this.logger.debug('debug ========= Get tenantRecord from cache')
46+
+ let tenantRecord = await this.cache.config.cache.get(this.rootAgentContext, `contextCorrelationId-${contextCorrelationId}`)
47+
+ if(!tenantRecord) {
48+
+ // TODO: maybe we can look at not having to retrieve the tenant record if there's already a context available.
49+
+ this.logger.debug('debug ========= TenantRecord not found in cache')
50+
+ tenantRecord = await this.tenantRecordService.getTenantById(this.rootAgentContext, contextCorrelationId)
51+
+ await this.cache.config.cache.set(this.rootAgentContext,`contextCorrelationId-${contextCorrelationId}`,tenantRecord)
52+
+ this.logger.debug(`debug ========= Cached tenant agent context for tenant '${contextCorrelationId}'`)
53+
+ }
54+
const shouldUpdate = !(0, core_1.isStorageUpToDate)(tenantRecord.storageVersion);
55+
// If the tenant storage is not up to date, and autoUpdate is disabled we throw an error
56+
if (shouldUpdate && !this.rootAgentContext.config.autoUpdateStorageOnStartup) {

samples/cliConfig.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"walletPassword": "postgres",
99
"walletAdminAccount": "postgres",
1010
"walletAdminPassword": "postgres",
11-
"walletScheme": "DatabasePerWallet",
11+
"walletScheme": "ProfilePerWallet",
1212
"indyLedger": [
1313
{
1414
"genesisTransactions": "https://raw.githubusercontent.com/Indicio-tech/indicio-network/main/genesis_files/pool_transactions_testnet_genesis",
@@ -19,30 +19,28 @@
1919
"indyNamespace": "indicio:demonet"
2020
},
2121
{
22-
"genesisTransactions": "http://test.bcovrin.vonx.io/genesis",
22+
"genesisTransactions": "https://raw.githubusercontent.com/bcgov/von-network/main/BCovrin/genesis_test",
2323
"indyNamespace": "bcovrin:testnet"
2424
}
2525
],
2626
"endpoint": ["http://localhost:4002"],
2727
"autoAcceptConnections": true,
28-
"autoAcceptCredentials": "contentApproved",
28+
"autoAcceptCredentials": "always",
2929
"autoAcceptProofs": "contentApproved",
30-
"useLegacyDidSovPrefix": true,
31-
"logLevel": 5,
30+
"logLevel": 2,
3231
"inboundTransport": [
3332
{
3433
"transport": "http",
3534
"port": 4002
3635
}
3736
],
3837
"outboundTransport": ["http"],
39-
"autoAcceptMediationRequests": false,
4038
"adminPort": 4001,
4139
"tenancy": true,
4240
"schemaFileServerURL": "https://schema.credebl.id/schemas/",
43-
"didRegistryContractAddress": "0x1adeA199dCf07E17232415Cb232442BE52517Add",
44-
"schemaManagerContractAddress": "0x289c7Bd4C7d38cC54bff370d6f9f01b74Df51b11",
41+
"didRegistryContractAddress": "0xcB80F37eDD2bE3570c6C9D5B0888614E04E1e49E",
42+
"schemaManagerContractAddress": "0x4742d43C2dFCa5a1d4238240Afa8547Daf87Ee7a",
4543
"rpcUrl": "https://rpc-amoy.polygon.technology",
46-
"fileServerUrl": "https://schema.credebl.id/",
44+
"fileServerUrl": "https://schema.credebl.id",
4745
"fileServerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk"
48-
}
46+
}

0 commit comments

Comments
 (0)