-
Notifications
You must be signed in to change notification settings - Fork 208
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
fix: support mediation for connectionless exchange #577
Merged
TimoGlastra
merged 2 commits into
openwallet-foundation:main
from
TimoGlastra:fix/connectionless-mediation
Dec 15, 2021
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Would your fix work if we preserved the previous API? I'm asking because I don't like passing null and having different behavior based on the difference between
null
,undefined
or value.Although, I would welcome if we would not need to call
getDefaultMediator
before everygetRouting
, I don't think this is a good approach.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.
It seems like your goal is not to get routing but just to create new keys. Maybe, we need to have 2 separate methods.
The name
getRouting
is kind of misleading because it's actually not only about routing.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 agree on the
null
vsundefined
point. That's a nasty fix from me.I disagree however that the naming of
getRouting
is misleading as IMO mediation is routing. The protocol used for forward messages is called therouting
protocol (https://didcomm.org/routing/1.0/forward
) which is what is used when you use a mediator that adds extra keys to theroutingKeys
array.what if I add an optional parameter to the
getRouting
method to specify whether the default mediator should be taken into account. It will be true by default, but can be set to false?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.
That would be better 👍
As you wrote, mediation is routing. Then I would expect that routing returns things only related to routing/mediation. I was surprised by the following line in
createConnection
when I was looking at how we're creating a did and verkey for a new connection:const { endpoints, did, verkey, routingKeys, mediatorId } = options.routing
I thought that
endpoints, did, verkey
are somehow related just to mediation. But we use it to create a connection even if there is no mediation in use.Perhaps, it's not a big deal. We don't have to address that. I'm familiar with how it works now and can live with that :)
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.
It's a bit weird it lives in the mediation service, even thought it handled non-mediation stuff. I think the idea was to eventually move it to a routing service that handles everything related to routing (mediators, relays, other possible weird routing stuff). The connection service would then call the routing service whenever it needs keys for a connections.