Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enable in-memory cache when in multi-tenant mode #277

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,12 @@ function createInboundMessageContext<T extends AgentMessage>(message: T) {
} {
throw new Error('Function not implemented.')
},
receivedAt: new Date(),
setMessageHandler: () => {
throw new Error('Function not implemented.')
},
setResponseMessage: () => {
throw new Error('Function not implemented.')
},
}
}
22 changes: 11 additions & 11 deletions packages/rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
"test": "jest"
},
"dependencies": {
"@credo-ts/anoncreds": "^0.5.1",
"@credo-ts/askar": "^0.5.1",
"@credo-ts/cheqd": "^0.5.1",
"@credo-ts/core": "^0.5.1",
"@credo-ts/indy-vdr": "^0.5.1",
"@credo-ts/node": "^0.5.1",
"@credo-ts/openid4vc": "^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",
"@credo-ts/anoncreds": "^0.5.7",
"@credo-ts/askar": "^0.5.7",
"@credo-ts/cheqd": "^0.5.7",
"@credo-ts/core": "^0.5.7",
"@credo-ts/indy-vdr": "^0.5.7",
"@credo-ts/node": "^0.5.7",
"@credo-ts/openid4vc": "^0.5.7",
"@credo-ts/tenants": "^0.5.7",
"@hyperledger/anoncreds-nodejs": "^0.2.2",
"@hyperledger/aries-askar-nodejs": "^0.2.3",
"@hyperledger/indy-vdr-nodejs": "^0.2.2",
"@types/ref-array-di": "^1.2.8",
"@types/ws": "^7.4.7",
"body-parser": "^1.20.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/rest/src/utils/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import {
KeyDidResolver,
JwkDidResolver,
PeerDidResolver,
CacheModule,
InMemoryLruCache,
} from '@credo-ts/core'
import {
IndyVdrAnonCredsRegistry,
Expand Down Expand Up @@ -133,6 +135,7 @@ export function getAgentModules(options: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
disclosureFrame: firstCredential.disclosureFrame as any,
hashingAlgorithm: 'sha-256',
credentialSupportedId: 'test',
}
}

Expand All @@ -151,12 +154,17 @@ export function getAgentModules(options: {
tenants?: TenantsModule<typeof baseModules>
indyVdr?: IndyVdrModule
cheqd?: CheqdModule
cache?: CacheModule
} = baseModules

if (options.multiTenant) {
modules.tenants = new TenantsModule({
sessionLimit: Infinity,
})
// Disable SingleContextStorageLruCache
modules.cache = new CacheModule({
cache: new InMemoryLruCache({ limit: 100 }),
})
}

// Register indy module and related resolvers/registrars
Expand Down
Loading
Loading