From 64e20f1d694e4cbb38aca244e02980a12c7647df Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Mon, 20 Feb 2023 17:07:30 +0100 Subject: [PATCH] fix!: don't emit legacy did:sov prefix for new protocols (#1245) Signed-off-by: Timo Glastra --- .../v1/messages/V1CredentialAckMessage.ts | 2 ++ .../V1CredentialProblemReportMessage.ts | 2 ++ .../v1/messages/V1IssueCredentialMessage.ts | 2 ++ .../v1/messages/V1OfferCredentialMessage.ts | 2 ++ .../v1/messages/V1ProposeCredentialMessage.ts | 2 ++ .../v1/messages/V1RequestCredentialMessage.ts | 2 ++ .../v1/messages/V1PresentationAckMessage.ts | 2 ++ .../v1/messages/V1PresentationMessage.ts | 1 + .../V1PresentationProblemReportMessage.ts | 2 ++ .../messages/V1ProposePresentationMessage.ts | 1 + .../messages/V1RequestPresentationMessage.ts | 2 ++ packages/core/src/agent/AgentConfig.ts | 4 +-- packages/core/src/agent/AgentMessage.ts | 21 ++++++++++++-- packages/core/src/agent/EnvelopeService.ts | 6 ++-- .../src/agent/__tests__/AgentMessage.test.ts | 29 +++++++++++++++---- .../basic-messages/messages/BasicMessage.ts | 2 ++ .../ConnectionInvitationMessage.test.ts | 4 +-- .../messages/ConnectionInvitationMessage.ts | 12 ++++++-- .../ConnectionProblemReportMessage.ts | 2 ++ .../messages/ConnectionRequestMessage.ts | 2 ++ .../messages/ConnectionResponseMessage.ts | 2 ++ .../connections/messages/TrustPingMessage.ts | 2 ++ .../messages/TrustPingResponseMessage.ts | 2 ++ .../routing/messages/ForwardMessage.ts | 2 ++ packages/core/src/types.ts | 2 +- 25 files changed, 96 insertions(+), 16 deletions(-) diff --git a/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialAckMessage.ts b/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialAckMessage.ts index db9bba955d..540123584b 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialAckMessage.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialAckMessage.ts @@ -8,6 +8,8 @@ export type V1CredentialAckMessageOptions = AckMessageOptions * @see https://github.com/hyperledger/aries-rfcs/blob/master/features/0015-acks/README.md#explicit-acks */ export class V1CredentialAckMessage extends AckMessage { + public readonly allowDidSovPrefix = true + /** * Create new CredentialAckMessage instance. * @param options diff --git a/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.ts b/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.ts index 7b3a3c4c06..5e36d71381 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/messages/V1CredentialProblemReportMessage.ts @@ -8,6 +8,8 @@ export type V1CredentialProblemReportMessageOptions = ProblemReportMessageOption * @see https://github.com/hyperledger/aries-rfcs/blob/main/features/0035-report-problem/README.md */ export class V1CredentialProblemReportMessage extends ProblemReportMessage { + public readonly allowDidSovPrefix = true + /** * Create new CredentialProblemReportMessage instance. * @param options diff --git a/packages/anoncreds/src/protocols/credentials/v1/messages/V1IssueCredentialMessage.ts b/packages/anoncreds/src/protocols/credentials/v1/messages/V1IssueCredentialMessage.ts index a8727a355a..96f99da1c4 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/messages/V1IssueCredentialMessage.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/messages/V1IssueCredentialMessage.ts @@ -14,6 +14,8 @@ export interface V1IssueCredentialMessageOptions { } export class V1IssueCredentialMessage extends AgentMessage { + public readonly allowDidSovPrefix = true + public constructor(options: V1IssueCredentialMessageOptions) { super() diff --git a/packages/anoncreds/src/protocols/credentials/v1/messages/V1OfferCredentialMessage.ts b/packages/anoncreds/src/protocols/credentials/v1/messages/V1OfferCredentialMessage.ts index abb58f9aa1..b8d8c33e0c 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/messages/V1OfferCredentialMessage.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/messages/V1OfferCredentialMessage.ts @@ -22,6 +22,8 @@ export interface V1OfferCredentialMessageOptions { * @see https://github.com/hyperledger/aries-rfcs/blob/master/features/0036-issue-credential/README.md#offer-credential */ export class V1OfferCredentialMessage extends AgentMessage { + public readonly allowDidSovPrefix = true + public constructor(options: V1OfferCredentialMessageOptions) { super() diff --git a/packages/anoncreds/src/protocols/credentials/v1/messages/V1ProposeCredentialMessage.ts b/packages/anoncreds/src/protocols/credentials/v1/messages/V1ProposeCredentialMessage.ts index 7c50693cad..e6362c807b 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/messages/V1ProposeCredentialMessage.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/messages/V1ProposeCredentialMessage.ts @@ -32,6 +32,8 @@ export interface V1ProposeCredentialMessageOptions { * @see https://github.com/hyperledger/aries-rfcs/blob/master/features/0036-issue-credential/README.md#propose-credential */ export class V1ProposeCredentialMessage extends AgentMessage { + public readonly allowDidSovPrefix = true + public constructor(options: V1ProposeCredentialMessageOptions) { super() diff --git a/packages/anoncreds/src/protocols/credentials/v1/messages/V1RequestCredentialMessage.ts b/packages/anoncreds/src/protocols/credentials/v1/messages/V1RequestCredentialMessage.ts index 2814e6ebbf..5b55e8f206 100644 --- a/packages/anoncreds/src/protocols/credentials/v1/messages/V1RequestCredentialMessage.ts +++ b/packages/anoncreds/src/protocols/credentials/v1/messages/V1RequestCredentialMessage.ts @@ -14,6 +14,8 @@ export interface V1RequestCredentialMessageOptions { } export class V1RequestCredentialMessage extends AgentMessage { + public readonly allowDidSovPrefix = true + public constructor(options: V1RequestCredentialMessageOptions) { super() diff --git a/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationAckMessage.ts b/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationAckMessage.ts index 743fdba4fa..6c44d9db82 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationAckMessage.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationAckMessage.ts @@ -3,6 +3,8 @@ import type { AckMessageOptions } from '@aries-framework/core' import { AckMessage, IsValidMessageType, parseMessageType } from '@aries-framework/core' export class V1PresentationAckMessage extends AckMessage { + public readonly allowDidSovPrefix = true + public constructor(options: AckMessageOptions) { super(options) } diff --git a/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationMessage.ts b/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationMessage.ts index e27309111c..2b645e227d 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationMessage.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationMessage.ts @@ -20,6 +20,7 @@ export interface V1PresentationMessageOptions { * @see https://github.com/hyperledger/aries-rfcs/blob/master/features/0037-present-proof/README.md#presentation */ export class V1PresentationMessage extends AgentMessage { + public readonly allowDidSovPrefix = true public constructor(options: V1PresentationMessageOptions) { super() diff --git a/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.ts b/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.ts index baa7d1935e..479aade010 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/messages/V1PresentationProblemReportMessage.ts @@ -8,6 +8,8 @@ export type V1PresentationProblemReportMessageOptions = ProblemReportMessageOpti * @see https://github.com/hyperledger/aries-rfcs/blob/main/features/0035-report-problem/README.md */ export class V1PresentationProblemReportMessage extends ProblemReportMessage { + public readonly allowDidSovPrefix = true + /** * Create new PresentationProblemReportMessage instance. * @param options description of error and multiple optional fields for reporting problem diff --git a/packages/anoncreds/src/protocols/proofs/v1/messages/V1ProposePresentationMessage.ts b/packages/anoncreds/src/protocols/proofs/v1/messages/V1ProposePresentationMessage.ts index 12d94f73fa..d54a3f8d52 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/messages/V1ProposePresentationMessage.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/messages/V1ProposePresentationMessage.ts @@ -16,6 +16,7 @@ export interface V1ProposePresentationMessageOptions { * @see https://github.com/hyperledger/aries-rfcs/blob/master/features/0037-present-proof/README.md#propose-presentation */ export class V1ProposePresentationMessage extends AgentMessage { + public readonly allowDidSovPrefix = true public constructor(options: V1ProposePresentationMessageOptions) { super() diff --git a/packages/anoncreds/src/protocols/proofs/v1/messages/V1RequestPresentationMessage.ts b/packages/anoncreds/src/protocols/proofs/v1/messages/V1RequestPresentationMessage.ts index e49dfd9aaa..7486a469f4 100644 --- a/packages/anoncreds/src/protocols/proofs/v1/messages/V1RequestPresentationMessage.ts +++ b/packages/anoncreds/src/protocols/proofs/v1/messages/V1RequestPresentationMessage.ts @@ -18,6 +18,8 @@ export const INDY_PROOF_REQUEST_ATTACHMENT_ID = 'libindy-request-presentation-0' * @see https://github.com/hyperledger/aries-rfcs/blob/master/features/0037-present-proof/README.md#request-presentation */ export class V1RequestPresentationMessage extends AgentMessage { + public readonly allowDidSovPrefix = true + public constructor(options: V1RequestPresentationMessageOptions) { super() diff --git a/packages/core/src/agent/AgentConfig.ts b/packages/core/src/agent/AgentConfig.ts index 09f348652d..b234ed4efd 100644 --- a/packages/core/src/agent/AgentConfig.ts +++ b/packages/core/src/agent/AgentConfig.ts @@ -161,8 +161,8 @@ export class AgentConfig { return this.initConfig.clearDefaultMediator ?? false } - public get useLegacyDidSovPrefix() { - return this.initConfig.useLegacyDidSovPrefix ?? false + public get useDidSovPrefixWhereAllowed() { + return this.initConfig.useDidSovPrefixWhereAllowed ?? false } /** diff --git a/packages/core/src/agent/AgentMessage.ts b/packages/core/src/agent/AgentMessage.ts index 07cf8ee9db..9f081f3d18 100644 --- a/packages/core/src/agent/AgentMessage.ts +++ b/packages/core/src/agent/AgentMessage.ts @@ -1,6 +1,8 @@ import type { ParsedMessageType } from '../utils/messageType' import type { Constructor } from '../utils/mixins' +import { Exclude } from 'class-transformer' + import { AckDecorated } from '../decorators/ack/AckDecoratorExtension' import { AttachmentDecorated } from '../decorators/attachment/AttachmentExtension' import { L10nDecorated } from '../decorators/l10n/L10nDecoratorExtension' @@ -20,10 +22,25 @@ const Decorated = ThreadDecorated( ) export class AgentMessage extends Decorated { - public toJSON({ useLegacyDidSovPrefix = false }: { useLegacyDidSovPrefix?: boolean } = {}): Record { + /** + * Whether the protocol RFC was initially written using the legacy did:prefix instead of the + * new https://didcomm.org message type prefix. + * + * @see https://github.com/hyperledger/aries-rfcs/blob/main/features/0348-transition-msg-type-to-https/README.md + */ + @Exclude() + public readonly allowDidSovPrefix: boolean = false + + public toJSON({ useDidSovPrefixWhereAllowed }: { useDidSovPrefixWhereAllowed?: boolean } = {}): Record< + string, + unknown + > { const json = JsonTransformer.toJSON(this) - if (useLegacyDidSovPrefix) { + // If we have `useDidSovPrefixWhereAllowed` enabled, we want to replace the new https://didcomm.org prefix with the legacy did:sov prefix. + // However, we only do this if the protocol RFC was initially written with the did:sov message type prefix + // See https://github.com/hyperledger/aries-rfcs/blob/main/features/0348-transition-msg-type-to-https/README.md + if (this.allowDidSovPrefix && useDidSovPrefixWhereAllowed) { replaceNewDidCommPrefixWithLegacyDidSovOnMessage(json) } diff --git a/packages/core/src/agent/EnvelopeService.ts b/packages/core/src/agent/EnvelopeService.ts index df72e3d983..37b341cd6f 100644 --- a/packages/core/src/agent/EnvelopeService.ts +++ b/packages/core/src/agent/EnvelopeService.ts @@ -33,7 +33,7 @@ export class EnvelopeService { const senderKeyBase58 = senderKey && senderKey.publicKeyBase58 // pass whether we want to use legacy did sov prefix - const message = payload.toJSON({ useLegacyDidSovPrefix: agentContext.config.useLegacyDidSovPrefix }) + const message = payload.toJSON({ useDidSovPrefixWhereAllowed: agentContext.config.useDidSovPrefixWhereAllowed }) this.logger.debug(`Pack outbound message ${message['@type']}`) @@ -49,7 +49,9 @@ export class EnvelopeService { recipientKeysBase58 = [routingKeyBase58] this.logger.debug('Forward message created', forwardMessage) - const forwardJson = forwardMessage.toJSON({ useLegacyDidSovPrefix: agentContext.config.useLegacyDidSovPrefix }) + const forwardJson = forwardMessage.toJSON({ + useDidSovPrefixWhereAllowed: agentContext.config.useDidSovPrefixWhereAllowed, + }) // Forward messages are anon packed encryptedMessage = await agentContext.wallet.pack(forwardJson, [routingKeyBase58], undefined) diff --git a/packages/core/src/agent/__tests__/AgentMessage.test.ts b/packages/core/src/agent/__tests__/AgentMessage.test.ts index ec9f8e3d7a..da71db84f7 100644 --- a/packages/core/src/agent/__tests__/AgentMessage.test.ts +++ b/packages/core/src/agent/__tests__/AgentMessage.test.ts @@ -10,16 +10,35 @@ class CustomProtocolMessage extends AgentMessage { public static readonly type = parseMessageType('https://didcomm.org/fake-protocol/1.5/message') } +class LegacyDidSovPrefixMessage extends AgentMessage { + public readonly allowDidSovPrefix = true + + @IsValidMessageType(LegacyDidSovPrefixMessage.type) + public readonly type = LegacyDidSovPrefixMessage.type.messageTypeUri + public static readonly type = parseMessageType('https://didcomm.org/fake-protocol/1.5/another-message') +} + describe('AgentMessage', () => { describe('toJSON', () => { - it('should only use did:sov message prefix if useLegacyDidSovPrefix is true', () => { + it('should only use did:sov message prefix if useDidSovPrefixWhereAllowed and allowDidSovPrefix are both true', () => { const message = new TestMessage() + const legacyPrefixMessage = new LegacyDidSovPrefixMessage() + + // useDidSovPrefixWhereAllowed & allowDidSovPrefix are both false + let testMessageJson = message.toJSON() + expect(testMessageJson['@type']).toBe('https://didcomm.org/connections/1.0/invitation') + + // useDidSovPrefixWhereAllowed is true, but allowDidSovPrefix is false + testMessageJson = message.toJSON({ useDidSovPrefixWhereAllowed: true }) + expect(testMessageJson['@type']).toBe('https://didcomm.org/connections/1.0/invitation') - const jsonDidComm = message.toJSON() - expect(jsonDidComm['@type']).toBe('https://didcomm.org/connections/1.0/invitation') + // useDidSovPrefixWhereAllowed is false, but allowDidSovPrefix is true + testMessageJson = legacyPrefixMessage.toJSON() + expect(testMessageJson['@type']).toBe('https://didcomm.org/fake-protocol/1.5/another-message') - const jsonSov = message.toJSON({ useLegacyDidSovPrefix: true }) - expect(jsonSov['@type']).toBe('did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation') + // useDidSovPrefixWhereAllowed & allowDidSovPrefix are both true + testMessageJson = legacyPrefixMessage.toJSON({ useDidSovPrefixWhereAllowed: true }) + expect(testMessageJson['@type']).toBe('did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/fake-protocol/1.5/another-message') }) }) diff --git a/packages/core/src/modules/basic-messages/messages/BasicMessage.ts b/packages/core/src/modules/basic-messages/messages/BasicMessage.ts index cdae9d3fa6..7dd48b5dde 100644 --- a/packages/core/src/modules/basic-messages/messages/BasicMessage.ts +++ b/packages/core/src/modules/basic-messages/messages/BasicMessage.ts @@ -6,6 +6,8 @@ import { IsValidMessageType, parseMessageType } from '../../../utils/messageType import { DateParser } from '../../../utils/transformers' export class BasicMessage extends AgentMessage { + public readonly allowDidSovPrefix = true + /** * Create new BasicMessage instance. * sentTime will be assigned to new Date if not passed, id will be assigned to uuid/v4 if not passed diff --git a/packages/core/src/modules/connections/__tests__/ConnectionInvitationMessage.test.ts b/packages/core/src/modules/connections/__tests__/ConnectionInvitationMessage.test.ts index 839419b48f..188083309a 100644 --- a/packages/core/src/modules/connections/__tests__/ConnectionInvitationMessage.test.ts +++ b/packages/core/src/modules/connections/__tests__/ConnectionInvitationMessage.test.ts @@ -65,7 +65,7 @@ describe('ConnectionInvitationMessage', () => { expect(invitationUrl).toBe(`${domain}?c_i=${JsonEncoder.toBase64URL(json)}`) }) - it('should use did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation as type if useLegacyDidSovPrefix is set to true', async () => { + it('should use did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation as type if useDidSovPrefixWhereAllowed is set to true', async () => { const invitation = new ConnectionInvitationMessage({ id: '04a2c382-999e-4de9-a1d2-9dec0b2fa5e4', recipientKeys: ['recipientKeyOne', 'recipientKeyTwo'], @@ -86,7 +86,7 @@ describe('ConnectionInvitationMessage', () => { const invitationUrl = invitation.toUrl({ domain: 'https://example.com', - useLegacyDidSovPrefix: true, + useDidSovPrefixWhereAllowed: true, }) const parsedUrl = parseUrl(invitationUrl).query diff --git a/packages/core/src/modules/connections/messages/ConnectionInvitationMessage.ts b/packages/core/src/modules/connections/messages/ConnectionInvitationMessage.ts index ffbdf744d5..30cf5f1499 100644 --- a/packages/core/src/modules/connections/messages/ConnectionInvitationMessage.ts +++ b/packages/core/src/modules/connections/messages/ConnectionInvitationMessage.ts @@ -33,6 +33,8 @@ export interface DIDInvitationOptions { * @see https://github.com/hyperledger/aries-rfcs/blob/master/features/0160-connection-protocol/README.md#0-invitation-to-connect */ export class ConnectionInvitationMessage extends AgentMessage { + public readonly allowDidSovPrefix = true + /** * Create new ConnectionInvitationMessage instance. * @param options @@ -107,8 +109,14 @@ export class ConnectionInvitationMessage extends AgentMessage { * @param domain domain name to use for invitation url * @returns invitation url with base64 encoded invitation */ - public toUrl({ domain, useLegacyDidSovPrefix = false }: { domain: string; useLegacyDidSovPrefix?: boolean }) { - const invitationJson = this.toJSON({ useLegacyDidSovPrefix }) + public toUrl({ + domain, + useDidSovPrefixWhereAllowed = false, + }: { + domain: string + useDidSovPrefixWhereAllowed?: boolean + }) { + const invitationJson = this.toJSON({ useDidSovPrefixWhereAllowed }) const encodedInvitation = JsonEncoder.toBase64URL(invitationJson) const invitationUrl = `${domain}?c_i=${encodedInvitation}` diff --git a/packages/core/src/modules/connections/messages/ConnectionProblemReportMessage.ts b/packages/core/src/modules/connections/messages/ConnectionProblemReportMessage.ts index 3aaee94062..d6d84dcb0f 100644 --- a/packages/core/src/modules/connections/messages/ConnectionProblemReportMessage.ts +++ b/packages/core/src/modules/connections/messages/ConnectionProblemReportMessage.ts @@ -9,6 +9,8 @@ export type ConnectionProblemReportMessageOptions = ProblemReportMessageOptions * @see https://github.com/hyperledger/aries-rfcs/blob/main/features/0035-report-problem/README.md */ export class ConnectionProblemReportMessage extends ProblemReportMessage { + public readonly allowDidSovPrefix = true + /** * Create new ConnectionProblemReportMessage instance. * @param options diff --git a/packages/core/src/modules/connections/messages/ConnectionRequestMessage.ts b/packages/core/src/modules/connections/messages/ConnectionRequestMessage.ts index e86912966d..46a33fa221 100644 --- a/packages/core/src/modules/connections/messages/ConnectionRequestMessage.ts +++ b/packages/core/src/modules/connections/messages/ConnectionRequestMessage.ts @@ -21,6 +21,8 @@ export interface ConnectionRequestMessageOptions { * @see https://github.com/hyperledger/aries-rfcs/blob/master/features/0160-connection-protocol/README.md#1-connection-request */ export class ConnectionRequestMessage extends AgentMessage { + public readonly allowDidSovPrefix = true + /** * Create new ConnectionRequestMessage instance. * @param options diff --git a/packages/core/src/modules/connections/messages/ConnectionResponseMessage.ts b/packages/core/src/modules/connections/messages/ConnectionResponseMessage.ts index 91a3a48498..08e22a166b 100644 --- a/packages/core/src/modules/connections/messages/ConnectionResponseMessage.ts +++ b/packages/core/src/modules/connections/messages/ConnectionResponseMessage.ts @@ -17,6 +17,8 @@ export interface ConnectionResponseMessageOptions { * @see https://github.com/hyperledger/aries-rfcs/blob/master/features/0160-connection-protocol/README.md#2-connection-response */ export class ConnectionResponseMessage extends AgentMessage { + public readonly allowDidSovPrefix = true + /** * Create new ConnectionResponseMessage instance. * @param options diff --git a/packages/core/src/modules/connections/messages/TrustPingMessage.ts b/packages/core/src/modules/connections/messages/TrustPingMessage.ts index 036635eed6..a8719f0b34 100644 --- a/packages/core/src/modules/connections/messages/TrustPingMessage.ts +++ b/packages/core/src/modules/connections/messages/TrustPingMessage.ts @@ -19,6 +19,8 @@ export interface TrustPingMessageOptions { * @see https://github.com/hyperledger/aries-rfcs/blob/master/features/0048-trust-ping/README.md#messages */ export class TrustPingMessage extends AgentMessage { + public readonly allowDidSovPrefix = true + /** * Create new TrustPingMessage instance. * responseRequested will be true if not passed diff --git a/packages/core/src/modules/connections/messages/TrustPingResponseMessage.ts b/packages/core/src/modules/connections/messages/TrustPingResponseMessage.ts index 23ace28316..9fa465a836 100644 --- a/packages/core/src/modules/connections/messages/TrustPingResponseMessage.ts +++ b/packages/core/src/modules/connections/messages/TrustPingResponseMessage.ts @@ -18,6 +18,8 @@ export interface TrustPingResponseMessageOptions { * @see https://github.com/hyperledger/aries-rfcs/blob/master/features/0048-trust-ping/README.md#messages */ export class TrustPingResponseMessage extends AgentMessage { + public readonly allowDidSovPrefix = true + /** * Create new TrustPingResponseMessage instance. * responseRequested will be true if not passed diff --git a/packages/core/src/modules/routing/messages/ForwardMessage.ts b/packages/core/src/modules/routing/messages/ForwardMessage.ts index 9b4d6d658c..ea1e45a50c 100644 --- a/packages/core/src/modules/routing/messages/ForwardMessage.ts +++ b/packages/core/src/modules/routing/messages/ForwardMessage.ts @@ -15,6 +15,8 @@ export interface ForwardMessageOptions { * @see https://github.com/hyperledger/aries-rfcs/blob/master/concepts/0094-cross-domain-messaging/README.md#corerouting10forward */ export class ForwardMessage extends AgentMessage { + public readonly allowDidSovPrefix = true + /** * Create new ForwardMessage instance. * diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 4cd29a4ba2..c80de6c997 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -57,7 +57,7 @@ export interface InitConfig { logger?: Logger didCommMimeType?: DidCommMimeType useDidKeyInProtocols?: boolean - useLegacyDidSovPrefix?: boolean + useDidSovPrefixWhereAllowed?: boolean connectionImageUrl?: string autoUpdateStorageOnStartup?: boolean