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: Added support for sending messages through simple HTTP-based transports #610

Merged
merged 13 commits into from
Jul 8, 2021

Conversation

awoie
Copy link
Member

@awoie awoie commented Jul 8, 2021

Potentially closes #552 and potentially closes #469

Contains:

  • Added transport interfaces to be used with DIDComm module.
  • Added simple implementation of an HTTP-based transport
  • Implemented sending DIDComm messages

Add a list of supported transports to the DIDComm plugin:

new DIDComm([new DIDCommHttpTransport()])

Then, use the DIDComm module to send messages to a DID:

const message = {
  type: 'test',
  to: receiver.did,
  from: sender.did,
  id: 'test',
  body: { hello: 'world' },
}
const packedMessage = await agent.packDIDCommMessage({
  packing: 'authcrypt',
  message,
})
const result = await agent.sendDIDCommMessage({
  messageId: '123',
  packedMessage,
  recipientDidUrl: receiver.did
})

@awoie awoie requested a review from mirceanis July 8, 2021 10:00
@codecov
Copy link

codecov bot commented Jul 8, 2021

Codecov Report

Merging #610 (844baab) into next (0bf7b24) will increase coverage by 10.33%.
The diff coverage is 92.45%.

@@             Coverage Diff             @@
##             next     #610       +/-   ##
===========================================
+ Coverage   67.58%   77.91%   +10.33%     
===========================================
  Files          62       78       +16     
  Lines        1530     2318      +788     
  Branches      247      415      +168     
===========================================
+ Hits         1034     1806      +772     
- Misses        400      510      +110     
+ Partials       96        2       -94     

Copy link
Member

@mirceanis mirceanis left a comment

Choose a reason for hiding this comment

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

looks great

@mirceanis mirceanis merged commit 78836a4 into next Jul 8, 2021
@mirceanis mirceanis deleted the feat/add-didcomm-v2 branch July 8, 2021 13:26
@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
Development

Successfully merging this pull request may close these issues.

Implement DIDComm Module for sending messages Implement MessageHandler for handling DIDCommV2 envelopes
3 participants