Skip to content

Commit

Permalink
Merge branch 'main' into karimStekelenburg/issueW3cCredentialService-…
Browse files Browse the repository at this point in the history
…Custom-Document-Loader-does-not-work-when-no-Internet-->-e2e-Tests-Fail
  • Loading branch information
TimoGlastra authored Dec 12, 2022
2 parents e17ab09 + 3c040b6 commit b7a0899
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/agent/AgentConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class AgentConfig {
* in a given protocol (i.e. it does not support Aries RFC 0360).
*/
public get useDidKeyInProtocols() {
return this.initConfig.useDidKeyInProtocols ?? false
return this.initConfig.useDidKeyInProtocols ?? true
}

public get endpoints(): [string, ...string[]] {
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/agent/models/OutboundMessageContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { Key } from '../../crypto'
import type { ConnectionRecord } from '../../modules/connections'
import type { ResolvedDidCommService } from '../../modules/didcomm'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export { InjectionSymbols } from './constants'
export * from './wallet'
export type { TransportSession } from './agent/TransportService'
export { TransportService } from './agent/TransportService'
export { Attachment } from './decorators/attachment/Attachment'
export { Attachment, AttachmentData } from './decorators/attachment/Attachment'
export { ReturnRouteTypes } from './decorators/transport/TransportDecorator'

export * from './plugins'
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/modules/discover-features/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './DiscoverFeaturesApi'
export * from './DiscoverFeaturesEvents'
export * from './DiscoverFeaturesModule'
export * from './protocol'
1 change: 1 addition & 0 deletions packages/core/src/modules/oob/domain/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './OutOfBandRole'
export * from './OutOfBandState'
export * from './OutOfBandDidCommService'
export * from './OutOfBandEvents'
6 changes: 3 additions & 3 deletions packages/core/src/modules/routing/__tests__/mediation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,17 @@ describe('mediator establishment', () => {
})
})

test('Mediation end-to-end flow (use did:key in both sides)', async () => {
test('Mediation end-to-end flow (not using did:key)', async () => {
await e2eMediationTest(
{
config: { ...mediatorAgentOptions.config, useDidKeyInProtocols: true },
config: { ...mediatorAgentOptions.config, useDidKeyInProtocols: false },
dependencies: mediatorAgentOptions.dependencies,
},
{
config: {
...recipientAgentOptions.config,
mediatorPickupStrategy: MediatorPickupStrategy.PickUpV1,
useDidKeyInProtocols: true,
useDidKeyInProtocols: false,
},
dependencies: recipientAgentOptions.dependencies,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('MediatorService - default config', () => {
)

describe('createGrantMediationMessage', () => {
test('sends base58 encoded recipient keys by default', async () => {
test('sends did:key encoded recipient keys by default', async () => {
const mediationRecord = new MediationRecord({
connectionId: 'connectionId',
role: MediationRole.Mediator,
Expand All @@ -64,7 +64,7 @@ describe('MediatorService - default config', () => {
const { message } = await mediatorService.createGrantMediationMessage(agentContext, mediationRecord)

expect(message.routingKeys.length).toBe(1)
expect(isDidKey(message.routingKeys[0])).toBeFalsy()
expect(isDidKey(message.routingKeys[0])).toBeTruthy()
})
})

Expand Down Expand Up @@ -155,8 +155,8 @@ describe('MediatorService - default config', () => {
})
})

describe('MediatorService - useDidKeyInProtocols set to true', () => {
const agentConfig = getAgentConfig('MediatorService', { useDidKeyInProtocols: true })
describe('MediatorService - useDidKeyInProtocols set to false', () => {
const agentConfig = getAgentConfig('MediatorService', { useDidKeyInProtocols: false })

const agentContext = getAgentContext({
agentConfig,
Expand All @@ -171,7 +171,7 @@ describe('MediatorService - useDidKeyInProtocols set to true', () => {
)

describe('createGrantMediationMessage', () => {
test('sends did:key encoded recipient keys when config is set', async () => {
test('sends base58 encoded recipient keys when config is set', async () => {
const mediationRecord = new MediationRecord({
connectionId: 'connectionId',
role: MediationRole.Mediator,
Expand All @@ -190,7 +190,7 @@ describe('MediatorService - useDidKeyInProtocols set to true', () => {
const { message } = await mediatorService.createGrantMediationMessage(agentContext, mediationRecord)

expect(message.routingKeys.length).toBe(1)
expect(isDidKey(message.routingKeys[0])).toBeTruthy()
expect(isDidKey(message.routingKeys[0])).toBeFalsy()
})
})
})
6 changes: 0 additions & 6 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import type { AgentMessage } from './agent/AgentMessage'
import type { Key } from './crypto'
import type { Logger } from './logger'
import type { ConnectionRecord } from './modules/connections'
import type { AutoAcceptCredential } from './modules/credentials/models/CredentialAutoAcceptType'
import type { ResolvedDidCommService } from './modules/didcomm'
import type { IndyPoolConfig } from './modules/ledger/IndyPool'
import type { OutOfBandRecord } from './modules/oob/repository'
import type { AutoAcceptProof } from './modules/proofs'
import type { MediatorPickupStrategy } from './modules/routing'
import type { BaseRecord } from './storage/BaseRecord'

export enum KeyDerivationMethod {
/** default value in indy-sdk. Will be used when no value is provided */
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4353,9 +4353,9 @@ decimal.js@^10.2.1:
integrity sha512-F29o+vci4DodHYT9UrR5IEbfBw9pE5eSapIJdTqXK5+6hq+t8VRxwQyKlW2i+KDKFkkJQRvFyI/QXD83h8LyQw==

decode-uri-component@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==
version "0.2.2"
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9"
integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==

dedent@^0.7.0:
version "0.7.0"
Expand Down

0 comments on commit b7a0899

Please sign in to comment.