Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement didcomm v2 packing/unpacking #575

Merged
merged 13 commits into from
Jun 26, 2021
Merged

Conversation

mirceanis
Copy link
Member

@mirceanis mirceanis commented Jun 17, 2021

Implement IDIDComm.packDIDCommMessage() and IDIDComm.unpackDIDCommMessage() for plaintext, signed and encrypted (auth and anon) DIDComm.

fixes #558
fixes #559

This also adds a getDIDComponentById method to the IResolver plugin, which can be used to get a VerificationMethod or a ServiceEndpoint object form a DID document using an id.

@mirceanis mirceanis force-pushed the feat/didcomm-v2-packing branch from 67e250f to 1e5b276 Compare June 17, 2021 16:00
@mirceanis mirceanis requested a review from awoie June 17, 2021 16:00
Copy link
Member

@awoie awoie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am not ready with the review yet but have already a few questions that need to be resolved before i would approve.

packages/core/src/types/IResolver.ts Outdated Show resolved Hide resolved
packages/did-comm/src/utils.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 22, 2021

Codecov Report

Merging #575 (0e1230a) into next (0bf7b24) will increase coverage by 10.19%.
The diff coverage is 91.48%.

❗ Current head 0e1230a differs from pull request most recent head 122834e. Consider uploading reports for the commit 122834e to get more accurate results

@@             Coverage Diff             @@
##             next     #575       +/-   ##
===========================================
+ Coverage   67.58%   77.77%   +10.19%     
===========================================
  Files          62       72       +10     
  Lines        1530     2227      +697     
  Branches      247      396      +149     
===========================================
+ Hits         1034     1732      +698     
- Misses        400      493       +93     
+ Partials       96        2       -94     

@mirceanis mirceanis marked this pull request as ready for review June 22, 2021 10:18
@mirceanis mirceanis force-pushed the feat/didcomm-v2-packing branch from 5ca3d15 to 46aa1eb Compare June 22, 2021 12:26
@mirceanis mirceanis requested a review from awoie June 22, 2021 14:28
@@ -59,4 +65,61 @@ export interface IResolver extends IPluginMethodMap {
* @public
*/
resolveDid(args: ResolveDidArgs): Promise<DIDResolutionResult>

/**
* Dereferences a DID URI fragment and return the corresponding DID document entry.
Copy link
Member

@awoie awoie Jun 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Dereferences a DID URI fragment and return the corresponding DID document entry.
* Dereferences a DID URL fragment and returns the corresponding DID document entry.

Copy link
Member

@awoie awoie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, it would be just nice to change the one argument of the getDIDCommMessageMediaType

@mirceanis mirceanis merged commit 249b07e into next Jun 26, 2021
@mirceanis mirceanis deleted the feat/didcomm-v2-packing branch June 26, 2021 05:11
@mirceanis mirceanis mentioned this pull request Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants