Skip to content

Commit

Permalink
refactor: merge tag 0.4.2 into develop (#5)
Browse files Browse the repository at this point in the history
* fix: listen to incoming messages on agent initialize not constructor (openwallet-foundation#1542)

Signed-off-by: Niall Shaw <niall.shaw@absa.africa>

* fix(cheqd): make cosmos payer seed optional (openwallet-foundation#1547)

Signed-off-by: Timo Glastra <timo@animo.id>

* fix: create message subscription first (openwallet-foundation#1549)

Signed-off-by: Timo Glastra <timo@animo.id>

* fix(transport): Use connection in WebSocket ID (openwallet-foundation#1551)

* fix: priority sorting for didcomm services (openwallet-foundation#1555)

Signed-off-by: Timo Glastra <timo@animo.id>

* fix: bump missing dependencies version (openwallet-foundation#1557)

Signed-off-by: Eric Vergnaud <eric.vergnaud@wanadoo.fr>

* chore(release): v0.4.1 (openwallet-foundation#1548)

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix: do not send package via outdated session (openwallet-foundation#1559)

Signed-off-by: Niall Shaw <niall.shaw@absa.africa>

* build(deps): bump @types/indy-sdk from 1.16.26 to 1.16.27 (openwallet-foundation#1564)

Signed-off-by: dependabot[bot] <support@github.com>

* fix(cheqd): changed the name formatting to a encoded hex value (openwallet-foundation#1574)

Signed-off-by: Tom Lanser <tom@animo.id>

* build(deps): bump @cheqd/ts-proto from 2.2.0 to 2.2.2 (openwallet-foundation#1568)

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump @cosmjs/proto-signing from 0.31.0 to 0.31.1 (openwallet-foundation#1566)

Signed-off-by: dependabot[bot] <support@github.com>

* fix(core): remove node-fetch dependency (openwallet-foundation#1578)

Signed-off-by: Ariel Gentile <gentilester@gmail.com>

* fix: log and throw on WebSocket sending errors (openwallet-foundation#1573)

Signed-off-by: Eric Vergnaud <eric.vergnaud@wanadoo.fr>

* fix(oob): support oob with connection and messages (openwallet-foundation#1558)

Signed-off-by: Timo Glastra <timo@animo.id>

* feat: allow connection invitation encoded in oob url param (openwallet-foundation#1583)

Signed-off-by: Ariel Gentile <gentilester@gmail.com>

* fix: duplicate service ids in connections protocol (openwallet-foundation#1589)

* fix: implicit invitation to specific service (openwallet-foundation#1592)

Signed-off-by: Ariel Gentile <gentilester@gmail.com>

* fix(askar): throw error if imported wallet exists (openwallet-foundation#1593)

Signed-off-by: Ariel Gentile <gentilester@gmail.com>

* fix: service validation in OOB invitation objects (openwallet-foundation#1575)

Signed-off-by: Ariel Gentile <gentilester@gmail.com>

* fix: update tsyringe for ts 5 support (openwallet-foundation#1588)

Signed-off-by: Timo Glastra <timo@animo.id>

* chore(release): v0.4.2 (openwallet-foundation#1591)

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: update yarn.lock

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

---------

Signed-off-by: Niall Shaw <niall.shaw@absa.africa>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Eric Vergnaud <eric.vergnaud@wanadoo.fr>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Tom Lanser <tom@animo.id>
Signed-off-by: Ariel Gentile <gentilester@gmail.com>
Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
Co-authored-by: Niall Shaw <100220424+niall-shaw@users.noreply.github.com>
Co-authored-by: Timo Glastra <timo@animo.id>
Co-authored-by: Alexander Shenshin <93187809+AlexanderShenshin@users.noreply.github.com>
Co-authored-by: ericvergnaud <eric.vergnaud@wanadoo.fr>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tom Lanser <tommy.lanser@gmail.com>
Co-authored-by: Ariel Gentile <gentilester@gmail.com>
  • Loading branch information
9 people authored Nov 29, 2023
1 parent ac8f6fc commit c0df4ef
Show file tree
Hide file tree
Showing 84 changed files with 1,273 additions and 295 deletions.
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,50 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.4.2](https://github.com/hyperledger/aries-framework-javascript/compare/v0.4.1...v0.4.2) (2023-10-05)

### Bug Fixes

- **askar:** throw error if imported wallet exists ([#1593](https://github.com/hyperledger/aries-framework-javascript/issues/1593)) ([c2bb2a5](https://github.com/hyperledger/aries-framework-javascript/commit/c2bb2a52f10add35de883c9a27716db01b9028df))
- **cheqd:** changed the name formatting to a encoded hex value ([#1574](https://github.com/hyperledger/aries-framework-javascript/issues/1574)) ([d299f55](https://github.com/hyperledger/aries-framework-javascript/commit/d299f55113cb4c59273ae9fbbb8773b6f0009192))
- **core:** remove node-fetch dependency ([#1578](https://github.com/hyperledger/aries-framework-javascript/issues/1578)) ([9ee2ce7](https://github.com/hyperledger/aries-framework-javascript/commit/9ee2ce7f0913510fc5b36aef1b7eeffb259b4aed))
- do not send package via outdated session ([#1559](https://github.com/hyperledger/aries-framework-javascript/issues/1559)) ([de6a735](https://github.com/hyperledger/aries-framework-javascript/commit/de6a735a900b6d7444b17d79e63acaca19cb812a))
- duplicate service ids in connections protocol ([#1589](https://github.com/hyperledger/aries-framework-javascript/issues/1589)) ([dd75be8](https://github.com/hyperledger/aries-framework-javascript/commit/dd75be88c4e257b6ca76868ceaeb3a8b7d67c185))
- implicit invitation to specific service ([#1592](https://github.com/hyperledger/aries-framework-javascript/issues/1592)) ([4071dc9](https://github.com/hyperledger/aries-framework-javascript/commit/4071dc97b8ca779e6def3711a538ae821e1e513c))
- log and throw on WebSocket sending errors ([#1573](https://github.com/hyperledger/aries-framework-javascript/issues/1573)) ([11050af](https://github.com/hyperledger/aries-framework-javascript/commit/11050afc7965adfa9b00107ba34abfbe3afaf874))
- **oob:** support oob with connection and messages ([#1558](https://github.com/hyperledger/aries-framework-javascript/issues/1558)) ([9732ce4](https://github.com/hyperledger/aries-framework-javascript/commit/9732ce436a0ddee8760b02ac5182e216a75176c2))
- service validation in OOB invitation objects ([#1575](https://github.com/hyperledger/aries-framework-javascript/issues/1575)) ([91a9434](https://github.com/hyperledger/aries-framework-javascript/commit/91a9434efd53ccbaf80f5613cd908913ad3b806b))
- update tsyringe for ts 5 support ([#1588](https://github.com/hyperledger/aries-framework-javascript/issues/1588)) ([296955b](https://github.com/hyperledger/aries-framework-javascript/commit/296955b3a648416ac6b502da05a10001920af222))

### Features

- allow connection invitation encoded in oob url param ([#1583](https://github.com/hyperledger/aries-framework-javascript/issues/1583)) ([9d789fa](https://github.com/hyperledger/aries-framework-javascript/commit/9d789fa4e9d159312872f45089d73609eb3d6835))

## [0.4.1](https://github.com/hyperledger/aries-framework-javascript/compare/v0.4.0...v0.4.1) (2023-08-28)

### Bug Fixes

- **anoncreds:** wrong key name for predicates in proof object ([#1517](https://github.com/hyperledger/aries-framework-javascript/issues/1517)) ([d895c78](https://github.com/hyperledger/aries-framework-javascript/commit/d895c78e0e02954a95ad1fd7e2251ee9a02445dc))
- **askar:** in memory wallet creation ([#1498](https://github.com/hyperledger/aries-framework-javascript/issues/1498)) ([4a158e6](https://github.com/hyperledger/aries-framework-javascript/commit/4a158e64b97595be0733d4277c28c462bd47c908))
- check if URL already encoded ([#1485](https://github.com/hyperledger/aries-framework-javascript/issues/1485)) ([38a0578](https://github.com/hyperledger/aries-framework-javascript/commit/38a0578011896cfcf217713d34f285cd381ad72c))
- **cheqd:** make cosmos payer seed optional ([#1547](https://github.com/hyperledger/aries-framework-javascript/issues/1547)) ([9377378](https://github.com/hyperledger/aries-framework-javascript/commit/9377378b0124bf2f593342dba95a13ea5d8944c8))
- create message subscription first ([#1549](https://github.com/hyperledger/aries-framework-javascript/issues/1549)) ([93276de](https://github.com/hyperledger/aries-framework-javascript/commit/93276debeff1e56c9803e7700875c4254a48236b))
- encode tails url ([#1479](https://github.com/hyperledger/aries-framework-javascript/issues/1479)) ([fd190b9](https://github.com/hyperledger/aries-framework-javascript/commit/fd190b96106ca4916539d96ff6c4ecef7833f148))
- force did:key resolver/registrar presence ([#1535](https://github.com/hyperledger/aries-framework-javascript/issues/1535)) ([aaa13dc](https://github.com/hyperledger/aries-framework-javascript/commit/aaa13dc77d6d5133cd02e768e4173462fa65064a))
- **indy-vdr:** role property not included in nym request ([#1488](https://github.com/hyperledger/aries-framework-javascript/issues/1488)) ([002be4f](https://github.com/hyperledger/aries-framework-javascript/commit/002be4f578729aed1c8ae337f3d2eeecce9e3725))
- listen to incoming messages on agent initialize not constructor ([#1542](https://github.com/hyperledger/aries-framework-javascript/issues/1542)) ([8f2d593](https://github.com/hyperledger/aries-framework-javascript/commit/8f2d593bcda0bb2d7bea25ad06b9e37784961997))
- priority sorting for didcomm services ([#1555](https://github.com/hyperledger/aries-framework-javascript/issues/1555)) ([80c37b3](https://github.com/hyperledger/aries-framework-javascript/commit/80c37b30eb9ac3b438288e14c252f79f619dd12f))
- race condition singleton records ([#1495](https://github.com/hyperledger/aries-framework-javascript/issues/1495)) ([6c2dda5](https://github.com/hyperledger/aries-framework-javascript/commit/6c2dda544bf5f5d3a972a778c389340da6df97c4))
- **samples:** mediator wallet and http transport ([#1508](https://github.com/hyperledger/aries-framework-javascript/issues/1508)) ([04a8058](https://github.com/hyperledger/aries-framework-javascript/commit/04a80589b19725fb493e51e52a7345915b2c7341))
- **transport:** Use connection in WebSocket ID ([#1551](https://github.com/hyperledger/aries-framework-javascript/issues/1551)) ([8d2057f](https://github.com/hyperledger/aries-framework-javascript/commit/8d2057f3fe6f3ba236ba5a811b57a7256eae92bf))

### Features

- **anoncreds:** auto create link secret ([#1521](https://github.com/hyperledger/aries-framework-javascript/issues/1521)) ([c6f03e4](https://github.com/hyperledger/aries-framework-javascript/commit/c6f03e49d79a33b1c4b459cef11add93dee051d0))
- oob without handhsake improvements and routing ([#1511](https://github.com/hyperledger/aries-framework-javascript/issues/1511)) ([9e69cf4](https://github.com/hyperledger/aries-framework-javascript/commit/9e69cf441a75bf7a3c5556cf59e730ee3fce8c28))
- support askar profiles for multi-tenancy ([#1538](https://github.com/hyperledger/aries-framework-javascript/issues/1538)) ([e448a2a](https://github.com/hyperledger/aries-framework-javascript/commit/e448a2a58dddff2cdf80c4549ea2d842a54b43d1))
- **w3c:** add convenience methods to vc and vp ([#1477](https://github.com/hyperledger/aries-framework-javascript/issues/1477)) ([83cbfe3](https://github.com/hyperledger/aries-framework-javascript/commit/83cbfe38e788366b616dc244fe34cc49a5a4d331))

# [0.4.0](https://github.com/hyperledger/aries-framework-javascript/compare/v0.3.3...v0.4.0) (2023-06-03)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ ENV PACKAGES software-properties-common ca-certificates \
RUN apt-get update -y \
&& apt-get install -y $PACKAGES

RUN curl http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.21_amd64.deb -o libssl1.1.deb \
RUN curl http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.23_amd64.deb -o libssl1.1.deb \
# libssl1.1 (required by libindy)
&& dpkg -i libssl1.1.deb \
&& curl http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_1.1.1-1ubuntu2.1~18.04.21_amd64.deb -o libssl-dev1.1.deb \
&& curl http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_1.1.1-1ubuntu2.1~18.04.23_amd64.deb -o libssl-dev1.1.deb \
# libssl-dev1.1 (required to compile libindy with posgres plugin)
&& dpkg -i libssl-dev1.1.deb

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": ["packages/*"],
"version": "0.4.0",
"version": "0.4.2",
"useWorkspaces": true,
"npmClient": "yarn",
"command": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"ts-jest": "^29.0.5",
"ts-node": "^10.0.0",
"tsconfig-paths": "^4.1.2",
"tsyringe": "^4.7.0",
"tsyringe": "^4.8.0",
"typescript": "~4.9.5",
"ws": "^8.13.0"
},
Expand Down
10 changes: 10 additions & 0 deletions packages/action-menu/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.4.2](https://github.com/hyperledger/aries-framework-javascript/compare/v0.4.1...v0.4.2) (2023-10-05)

**Note:** Version bump only for package @aries-framework/action-menu

## [0.4.1](https://github.com/hyperledger/aries-framework-javascript/compare/v0.4.0...v0.4.1) (2023-08-28)

### Features

- oob without handhsake improvements and routing ([#1511](https://github.com/hyperledger/aries-framework-javascript/issues/1511)) ([9e69cf4](https://github.com/hyperledger/aries-framework-javascript/commit/9e69cf441a75bf7a3c5556cf59e730ee3fce8c28))

# [0.4.0](https://github.com/hyperledger/aries-framework-javascript/compare/v0.3.3...v0.4.0) (2023-06-03)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions packages/action-menu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@aries-framework/action-menu",
"main": "build/index",
"types": "build/index",
"version": "0.4.0",
"version": "0.4.2",
"files": [
"build"
],
Expand All @@ -24,7 +24,7 @@
"test": "jest"
},
"dependencies": {
"@aries-framework/core": "0.4.0",
"@aries-framework/core": "0.4.2",
"class-transformer": "0.5.1",
"class-validator": "0.14.0",
"rxjs": "^7.2.0"
Expand Down
12 changes: 12 additions & 0 deletions packages/anoncreds-rs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.4.2](https://github.com/hyperledger/aries-framework-javascript/compare/v0.4.1...v0.4.2) (2023-10-05)

### Bug Fixes

- update tsyringe for ts 5 support ([#1588](https://github.com/hyperledger/aries-framework-javascript/issues/1588)) ([296955b](https://github.com/hyperledger/aries-framework-javascript/commit/296955b3a648416ac6b502da05a10001920af222))

## [0.4.1](https://github.com/hyperledger/aries-framework-javascript/compare/v0.4.0...v0.4.1) (2023-08-28)

### Features

- **anoncreds:** auto create link secret ([#1521](https://github.com/hyperledger/aries-framework-javascript/issues/1521)) ([c6f03e4](https://github.com/hyperledger/aries-framework-javascript/commit/c6f03e49d79a33b1c4b459cef11add93dee051d0))

# [0.4.0](https://github.com/hyperledger/aries-framework-javascript/compare/v0.3.3...v0.4.0) (2023-06-03)

### Bug Fixes
Expand Down
8 changes: 4 additions & 4 deletions packages/anoncreds-rs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@aries-framework/anoncreds-rs",
"main": "build/index",
"types": "build/index",
"version": "0.4.0",
"version": "0.4.2",
"files": [
"build"
],
Expand All @@ -24,12 +24,12 @@
"test": "jest"
},
"dependencies": {
"@aries-framework/anoncreds": "0.4.0",
"@aries-framework/core": "0.4.0",
"@aries-framework/anoncreds": "0.4.2",
"@aries-framework/core": "0.4.2",
"class-transformer": "^0.5.1",
"class-validator": "0.14.0",
"rxjs": "^7.2.0",
"tsyringe": "^4.7.0"
"tsyringe": "^4.8.0"
},
"devDependencies": {
"@hyperledger/anoncreds-nodejs": "^0.1.0",
Expand Down
17 changes: 17 additions & 0 deletions packages/anoncreds/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.4.2](https://github.com/hyperledger/aries-framework-javascript/compare/v0.4.1...v0.4.2) (2023-10-05)

### Bug Fixes

- **oob:** support oob with connection and messages ([#1558](https://github.com/hyperledger/aries-framework-javascript/issues/1558)) ([9732ce4](https://github.com/hyperledger/aries-framework-javascript/commit/9732ce436a0ddee8760b02ac5182e216a75176c2))

## [0.4.1](https://github.com/hyperledger/aries-framework-javascript/compare/v0.4.0...v0.4.1) (2023-08-28)

### Bug Fixes

- **anoncreds:** wrong key name for predicates in proof object ([#1517](https://github.com/hyperledger/aries-framework-javascript/issues/1517)) ([d895c78](https://github.com/hyperledger/aries-framework-javascript/commit/d895c78e0e02954a95ad1fd7e2251ee9a02445dc))

### Features

- **anoncreds:** auto create link secret ([#1521](https://github.com/hyperledger/aries-framework-javascript/issues/1521)) ([c6f03e4](https://github.com/hyperledger/aries-framework-javascript/commit/c6f03e49d79a33b1c4b459cef11add93dee051d0))
- oob without handhsake improvements and routing ([#1511](https://github.com/hyperledger/aries-framework-javascript/issues/1511)) ([9e69cf4](https://github.com/hyperledger/aries-framework-javascript/commit/9e69cf441a75bf7a3c5556cf59e730ee3fce8c28))

# [0.4.0](https://github.com/hyperledger/aries-framework-javascript/compare/v0.3.3...v0.4.0) (2023-06-03)

### Bug Fixes
Expand Down
6 changes: 3 additions & 3 deletions packages/anoncreds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@aries-framework/anoncreds",
"main": "build/index",
"types": "build/index",
"version": "0.4.0",
"version": "0.4.2",
"files": [
"build"
],
Expand All @@ -24,14 +24,14 @@
"test": "jest"
},
"dependencies": {
"@aries-framework/core": "0.4.0",
"@aries-framework/core": "0.4.2",
"bn.js": "^5.2.1",
"class-transformer": "0.5.1",
"class-validator": "0.14.0",
"reflect-metadata": "^0.1.13"
},
"devDependencies": {
"@aries-framework/node": "0.4.0",
"@aries-framework/node": "0.4.2",
"indy-sdk": "^1.16.0-dev-1636",
"rimraf": "^4.4.0",
"rxjs": "^7.8.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export class V1CredentialProtocol
attachments: credentialRecord.linkedAttachments,
})

message.setThread({ threadId: credentialRecord.threadId })
message.setThread({ threadId: credentialRecord.threadId, parentThreadId: credentialRecord.parentThreadId })

credentialRecord.credentialAttributes = message.credentialPreview.attributes
credentialRecord.autoAcceptCredential = autoAcceptCredential ?? credentialRecord.autoAcceptCredential
Expand Down Expand Up @@ -384,7 +384,7 @@ export class V1CredentialProtocol
}),
attachments: credentialRecord.linkedAttachments,
})
message.setThread({ threadId: credentialRecord.threadId })
message.setThread({ threadId: credentialRecord.threadId, parentThreadId: credentialRecord.parentThreadId })

credentialRecord.credentialAttributes = message.credentialPreview.attributes
credentialRecord.autoAcceptCredential = autoAcceptCredential ?? credentialRecord.autoAcceptCredential
Expand Down Expand Up @@ -541,6 +541,7 @@ export class V1CredentialProtocol
credentialRecord = new CredentialExchangeRecord({
connectionId: connection?.id,
threadId: offerMessage.threadId,
parentThreadId: offerMessage.thread?.parentThreadId,
state: CredentialState.OfferReceived,
protocolVersion: 'v1',
})
Expand Down Expand Up @@ -612,7 +613,7 @@ export class V1CredentialProtocol
requestAttachments: [attachment],
attachments: offerMessage.appendedAttachments?.filter((attachment) => isLinkedAttachment(attachment)),
})
requestMessage.setThread({ threadId: credentialRecord.threadId })
requestMessage.setThread({ threadId: credentialRecord.threadId, parentThreadId: credentialRecord.parentThreadId })

credentialRecord.credentialAttributes = offerMessage.credentialPreview.attributes
credentialRecord.autoAcceptCredential = autoAcceptCredential ?? credentialRecord.autoAcceptCredential
Expand Down Expand Up @@ -691,7 +692,7 @@ export class V1CredentialProtocol
comment,
})

message.setThread({ threadId: credentialRecord.threadId })
message.setThread({ threadId: credentialRecord.threadId, parentThreadId: credentialRecord.parentThreadId })

await didCommMessageRepository.saveOrUpdateAgentMessage(agentContext, {
agentMessage: message,
Expand Down Expand Up @@ -731,11 +732,7 @@ export class V1CredentialProtocol

agentContext.config.logger.debug(`Processing credential request with id ${requestMessage.id}`)

const credentialRecord = await this.getByThreadAndConnectionId(
messageContext.agentContext,
requestMessage.threadId,
connection?.id
)
const credentialRecord = await this.getByThreadAndConnectionId(messageContext.agentContext, requestMessage.threadId)
agentContext.config.logger.trace('Credential record found when processing credential request', credentialRecord)

const proposalMessage = await didCommMessageRepository.findAgentMessage(messageContext.agentContext, {
Expand All @@ -755,6 +752,15 @@ export class V1CredentialProtocol
lastSentMessage: offerMessage ?? undefined,
})

// This makes sure that the sender of the incoming message is authorized to do so.
if (!credentialRecord.connectionId) {
await connectionService.matchIncomingMessageToRequestMessageInOutOfBandExchange(messageContext, {
expectedConnectionId: credentialRecord.connectionId,
})

credentialRecord.connectionId = connection?.id
}

const requestAttachment = requestMessage.getRequestAttachmentById(INDY_CREDENTIAL_REQUEST_ATTACHMENT_ID)

if (!requestAttachment) {
Expand Down Expand Up @@ -833,7 +839,7 @@ export class V1CredentialProtocol
attachments: credentialRecord.linkedAttachments,
})

issueMessage.setThread({ threadId: credentialRecord.threadId })
issueMessage.setThread({ threadId: credentialRecord.threadId, parentThreadId: credentialRecord.parentThreadId })
issueMessage.setPleaseAck()

await didCommMessageRepository.saveAgentMessage(agentContext, {
Expand Down Expand Up @@ -938,6 +944,8 @@ export class V1CredentialProtocol
threadId: credentialRecord.threadId,
})

ackMessage.setThread({ threadId: credentialRecord.threadId, parentThreadId: credentialRecord.parentThreadId })

await this.updateState(agentContext, credentialRecord, CredentialState.Done)

return { message: ackMessage, credentialRecord }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ describe('V1CredentialProtocol', () => {
// then
expect(credentialRepository.getSingleByQuery).toHaveBeenNthCalledWith(1, agentContext, {
threadId: 'somethreadid',
connectionId: connection.id,
})
expect(repositoryUpdateSpy).toHaveBeenCalledTimes(1)
expect(returnedCredentialRecord.state).toEqual(CredentialState.RequestReceived)
Expand All @@ -360,7 +359,6 @@ describe('V1CredentialProtocol', () => {
// then
expect(credentialRepository.getSingleByQuery).toHaveBeenNthCalledWith(1, agentContext, {
threadId: 'somethreadid',
connectionId: connection.id,
})
expect(returnedCredentialRecord.state).toEqual(CredentialState.RequestReceived)
})
Expand Down
Loading

0 comments on commit c0df4ef

Please sign in to comment.