-
Notifications
You must be signed in to change notification settings - Fork 135
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(did-comm) Support DIDComm Mediation #1095
feat(did-comm) Support DIDComm Mediation #1095
Conversation
Codecov ReportBase: 80.25% // Head: 84.65% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## next #1095 +/- ##
==========================================
+ Coverage 80.25% 84.65% +4.40%
==========================================
Files 118 145 +27
Lines 4056 14800 +10744
Branches 875 1548 +673
==========================================
+ Hits 3255 12529 +9274
- Misses 798 2271 +1473
+ Partials 3 0 -3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
], | ||
} | ||
|
||
context.agent.emit('DIDCommV2Message-forwarded', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we want to emit this message at some point, but probably not here, since this is just the message wrapping. this event shouldn't get emitted until after the message is actually forwarded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about if the event was DIDCommV2Message-wrappedForward
? In the case of their being more than one mediator, multiple messages would be wrapped but only one would be forwarded. Should this emit one message per wrap? Or only one message for the single forward?
// 2. Pack message for routingKey with anoncrypt | ||
if (shouldUseSpecificKid) { | ||
return this.packDIDCommMessageJWE( | ||
{ message: forwardMessage, packing: 'anoncrypt', options: { recipientKids: [routingKey] } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the forward protocol assume anoncrypt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see anywhere in the spec where this is mentioned explicitly. The example does not have a from
field, meaning anoncrypt is used. https://identity.foundation/didcomm-messaging/spec/#messages
This seems to mean either could be used?
c752ea1
to
de5353f
Compare
@nickreynolds This is ready for review. Here is a summary:
|
At first glance, this looks amazing. Thank you so much @codynhat ! This one might take a little while to fully review (and we're trying to finish up the ESM upgrade before merging in any other big features so might go unmerged even after it's approved) but thanks! |
Sounds good! |
@@ -137,6 +138,18 @@ export class DataStoreJson implements IAgentPlugin { | |||
} | |||
} | |||
|
|||
async dataStoreDeleteMessage(args: IDataStoreDeleteMessageArgs): Promise<boolean> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mirceanis I see that you originally removed this function, can you review this file's changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were some unpleasant consequences when deleting stuff because of some typeorm misconfiguration in our entities, causing a cascade effect and deleting more than just the message, or throwing foreign key errors.
This should not be the case now, but this is the reason why some "delete" methods are weirdly missing or commented out.
The missing methods were not added to the data-store-json plugin to keep the API uniform, but we need to review this and normalize the API.
…viceEndpoint uri is DID
b3dece3
to
a762bd2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Initial part of #1051. Adds support for forwarding messages to mediators. I am submitting a draft PR here to make sure I am on the right track.
Still to do is handling forwarded messages and setting up the relationship between a user and mediator.
What issue is this PR fixing
closes #1051
What is being changed
A clear description of what this PR brings.
Quality
Check all that apply:
yarn
,yarn build
,yarn test
,yarn test:browser
locally.