diff --git a/packages/core/src/agent/AgentConfig.ts b/packages/core/src/agent/AgentConfig.ts index 3b6297341b..5e20051ff8 100644 --- a/packages/core/src/agent/AgentConfig.ts +++ b/packages/core/src/agent/AgentConfig.ts @@ -191,8 +191,16 @@ export class AgentConfig { public toJSON() { return { ...this.initConfig, - logger: this.logger !== undefined, - agentDependencies: this.agentDependencies != undefined, + walletConfig: { + ...this.walletConfig, + key: this.walletConfig?.key ? '[*****]' : undefined, + storage: { + ...this.walletConfig?.storage, + credentials: this.walletConfig?.storage?.credentials ? '[*****]' : undefined, + }, + }, + logger: this.logger.logLevel, + agentDependencies: Boolean(this.agentDependencies), label: this.label, } } diff --git a/packages/core/src/modules/common/messages/AckMessage.ts b/packages/core/src/modules/common/messages/AckMessage.ts index 7e833a9513..933bfa7620 100644 --- a/packages/core/src/modules/common/messages/AckMessage.ts +++ b/packages/core/src/modules/common/messages/AckMessage.ts @@ -8,7 +8,6 @@ import { IsValidMessageType, parseMessageType } from '../../../utils/messageType */ export enum AckStatus { OK = 'OK', - FAIL = 'FAIL', PENDING = 'PENDING', } diff --git a/packages/core/src/modules/proofs/protocol/v2/V2ProofService.ts b/packages/core/src/modules/proofs/protocol/v2/V2ProofService.ts index 3a457ef538..38842b31a4 100644 --- a/packages/core/src/modules/proofs/protocol/v2/V2ProofService.ts +++ b/packages/core/src/modules/proofs/protocol/v2/V2ProofService.ts @@ -6,6 +6,7 @@ import type { Attachment } from '../../../../decorators/attachment/Attachment' import type { MediationRecipientService } from '../../../routing/services/MediationRecipientService' import type { RoutingService } from '../../../routing/services/RoutingService' import type { ProofResponseCoordinator } from '../../ProofResponseCoordinator' +import type { ProofFormatServiceMap } from '../../formats' import type { ProofFormat } from '../../formats/ProofFormat' import type { ProofFormatService } from '../../formats/ProofFormatService' import type { CreateProblemReportOptions } from '../../formats/models/ProofFormatServiceOptions' @@ -42,7 +43,7 @@ import { PresentationProblemReportReason } from '../../errors/PresentationProble import { V2_INDY_PRESENTATION_REQUEST } from '../../formats/ProofFormatConstants' import { IndyProofFormatService } from '../../formats/indy/IndyProofFormatService' import { ProofState } from '../../models/ProofState' -import { PresentationRecordType, ProofExchangeRecord, ProofRepository } from '../../repository' +import { ProofExchangeRecord, ProofRepository } from '../../repository' import { V2PresentationProblemReportError } from './errors' import { V2PresentationAckHandler } from './handlers/V2PresentationAckHandler' @@ -71,10 +72,14 @@ export class V2ProofService extends P ) { super(agentConfig, proofRepository, connectionService, didCommMessageRepository, wallet, eventEmitter) this.wallet = wallet - this.formatServiceMap = { - [PresentationRecordType.Indy]: indyProofFormatService, - // other format services to be added to the map - } + // Dynamically build format service map. This will be extracted once services are registered dynamically + this.formatServiceMap = [indyProofFormatService].reduce( + (formatServiceMap, formatService) => ({ + ...formatServiceMap, + [formatService.formatKey]: formatService, + }), + {} + ) as ProofFormatServiceMap } /** diff --git a/packages/core/src/modules/proofs/repository/PresentationExchangeRecord.ts b/packages/core/src/modules/proofs/repository/PresentationExchangeRecord.ts deleted file mode 100644 index f9fa20f6b9..0000000000 --- a/packages/core/src/modules/proofs/repository/PresentationExchangeRecord.ts +++ /dev/null @@ -1,4 +0,0 @@ -export enum PresentationRecordType { - Indy = 'indy', - PresentationExchange = 'presentationExchange', -} diff --git a/packages/core/src/modules/proofs/repository/index.ts b/packages/core/src/modules/proofs/repository/index.ts index f861fe0806..9937a507b5 100644 --- a/packages/core/src/modules/proofs/repository/index.ts +++ b/packages/core/src/modules/proofs/repository/index.ts @@ -1,3 +1,2 @@ export * from './ProofExchangeRecord' export * from './ProofRepository' -export * from './PresentationExchangeRecord' diff --git a/packages/core/src/wallet/WalletApi.ts b/packages/core/src/wallet/WalletApi.ts index a845123160..548df623cf 100644 --- a/packages/core/src/wallet/WalletApi.ts +++ b/packages/core/src/wallet/WalletApi.ts @@ -43,7 +43,14 @@ export class WalletApi { } public async initialize(walletConfig: WalletConfig): Promise { - this.logger.info(`Initializing wallet '${walletConfig.id}'`, walletConfig) + this.logger.info(`Initializing wallet '${walletConfig.id}'`, { + ...walletConfig, + key: walletConfig?.key ? '[*****]' : undefined, + storage: { + ...walletConfig?.storage, + credentials: walletConfig?.storage?.credentials ? '[*****]' : undefined, + }, + }) if (this.isInitialized) { throw new WalletError( diff --git a/packages/node/src/transport/HttpInboundTransport.ts b/packages/node/src/transport/HttpInboundTransport.ts index 4c7fea9fdf..2bc1161954 100644 --- a/packages/node/src/transport/HttpInboundTransport.ts +++ b/packages/node/src/transport/HttpInboundTransport.ts @@ -8,17 +8,19 @@ import express, { text } from 'express' export class HttpInboundTransport implements InboundTransport { public readonly app: Express private port: number + private path: string private _server?: Server public get server() { return this._server } - public constructor({ app, port }: { app?: Express; port: number }) { + public constructor({ app, path, port }: { app?: Express; path?: string; port: number }) { this.port = port // Create Express App this.app = app ?? express() + this.path = path ?? '/' this.app.use( text({ @@ -36,7 +38,7 @@ export class HttpInboundTransport implements InboundTransport { port: this.port, }) - this.app.post('/', async (req, res) => { + this.app.post(this.path, async (req, res) => { const session = new HttpTransportSession(utils.uuid(), req, res) try { const message = req.body