Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

feat: Transport Return Route - Framework Configuration #896

Merged
merged 1 commit into from
Nov 29, 2019

Conversation

rolsonquadras
Copy link
Contributor

  • Aries framework level option to set the transport return route value [none, all, thread]; Added the option at framework level(edge agent doesn't have inbound capability) rather than each DIDComm message type.
  • Pass the framework option to Outbound Dispatcher
  • Outbound dispatcher injects the transport decorator to the outbound message before packing

Part of #858

Signed-off-by: Rolson Quadras [email protected]

@codecov
Copy link

codecov bot commented Nov 28, 2019

Codecov Report

Merging #896 into master will increase coverage by 0.01%.
The diff coverage is 95.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #896      +/-   ##
==========================================
+ Coverage   91.17%   91.18%   +0.01%     
==========================================
  Files          86       86              
  Lines        5268     5300      +32     
==========================================
+ Hits         4803     4833      +30     
- Misses        249      250       +1     
- Partials      216      217       +1
Impacted Files Coverage Δ
pkg/framework/aries/framework.go 85.1% <100%> (+1.01%) ⬆️
pkg/framework/context/context.go 97.8% <100%> (+0.15%) ⬆️
pkg/didcomm/transport/ws/outbound.go 91.66% <100%> (ø) ⬆️
pkg/didcomm/transport/http/outbound.go 90.9% <100%> (+0.21%) ⬆️
pkg/didcomm/dispatcher/outbound.go 87.09% <88.23%> (-1.8%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dafab6e...106115c. Read the comment docs.

@@ -12,6 +12,8 @@ import (
"fmt"
"testing"

"github.com/hyperledger/aries-framework-go/pkg/didcomm/common/service"
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong location

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -18,6 +18,8 @@ import (
"strings"
"testing"

"github.com/hyperledger/aries-framework-go/pkg/didcomm/protocol/decorator"
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong location

Copy link
Contributor Author

Choose a reason for hiding this comment

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

- Aries framework level option to set the transport return route value [none, all, thread]; Added the option at framework level(edge agent doesn't have inbound capability) rather than each DIDComm message type.
- Pass the framework option to Outbound Dispatcher
- Outbound dispatcher injects the transport decorator to the outbound message before packing

Signed-off-by: Rolson Quadras <[email protected]>
@@ -128,6 +130,21 @@ func WithInboundTransport(inboundTransport transport.InboundTransport) Option {
}
}

// WithTransportReturnRoute injects transport return route option to the Aries framework. Acceptable values - "none",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a TODO for more dynamically setting the TransportReturnRoute (in the protocol clients) or do we expect to always use the same setting (for a particular framework?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can enhance this to support route option at message/protocol layer by passing a {messageType, returnValue} config. eg, {didexchange, all},{introduce, none}. Created an issue - #899

@@ -128,6 +130,21 @@ func WithInboundTransport(inboundTransport transport.InboundTransport) Option {
}
}

// WithTransportReturnRoute injects transport return route option to the Aries framework. Acceptable values - "none",
// "all" or "thread". RFC - https://github.com/hyperledger/aries-rfcs/tree/master/features/0092-transport-return-route
Copy link
Contributor

Choose a reason for hiding this comment

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

Does thread actually work at a global level? Also I don't see return_route_thread attribute :).

thread: Send all messages matching the cryptographic key and thread specified in the return_route_thread attribute.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can intercept Thread at inbound layer as it's a decorator. Currently planning to use senderKey for all to map it with incoming conection. For thread, we can map senderKey-threadID combo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants