Skip to content

Commit

Permalink
Merge branch 'main' into feat/message-sent-event
Browse files Browse the repository at this point in the history
  • Loading branch information
genaris authored Nov 23, 2022
2 parents 628c968 + 03cdf39 commit 15133b1
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 16 deletions.
12 changes: 10 additions & 2 deletions packages/core/src/agent/AgentConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/modules/common/messages/AckMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { IsValidMessageType, parseMessageType } from '../../../utils/messageType
*/
export enum AckStatus {
OK = 'OK',
FAIL = 'FAIL',
PENDING = 'PENDING',
}

Expand Down
15 changes: 10 additions & 5 deletions packages/core/src/modules/proofs/protocol/v2/V2ProofService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -71,10 +72,14 @@ export class V2ProofService<PFs extends ProofFormat[] = ProofFormat[]> 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<PFs>
}

/**
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion packages/core/src/modules/proofs/repository/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './ProofExchangeRecord'
export * from './ProofRepository'
export * from './PresentationExchangeRecord'
9 changes: 8 additions & 1 deletion packages/core/src/wallet/WalletApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ export class WalletApi {
}

public async initialize(walletConfig: WalletConfig): Promise<void> {
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(
Expand Down
6 changes: 4 additions & 2 deletions packages/node/src/transport/HttpInboundTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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
Expand Down

0 comments on commit 15133b1

Please sign in to comment.