Skip to content

Conversation

@gabriel-indik
Copy link
Contributor

No description provided.

Signed-off-by: Gabriel Indik <gabriel.indik@kaleido.io>
Signed-off-by: Gabriel Indik <gabriel.indik@kaleido.io>
Signed-off-by: Gabriel Indik <gabriel.indik@kaleido.io>
Signed-off-by: Gabriel Indik <gabriel.indik@kaleido.io>
Signed-off-by: Gabriel Indik <gabriel.indik@kaleido.io>
@gabriel-indik
Copy link
Contributor Author

Changes included in this PR:
The PUT /api/v1/peers endpoint has been expanded to accept an optional segment that corresponds to a destination. For example: /api/v1/peers/org-a/destination1. This makes Data Exchange aware of the full identifier which includes the DX ID as well as the destination ID. With this information Data Exchange can validate the sender and recipient destinations whenever a message is sent or a blob is transferred. This happens at both the API and P2P levels. The reason the check is performed in both places is to cover the unexpected scenario where the Data Exchange instances get out of sync e.g. FireFly did not send the peer information.

Note that Data Exchange automatically associates destinations with peer information. This is for optimization purposes. More specifically, Data Exchange will not create multiple copies of the same certificate file. Instead each certificate will continue to be associated with a peer, and each peer can have 0-to-many destinations.

Similarly to how peers work, one can optionally pre-populate destinations in the Data Exchange configuration file for both sender and recipients (see changes in the configuration schema and sample config files). When invoking the PUT /api/v1/peers/id1/id2 endpoint, Data Exchange will persist on disk the destination (if it hadn't been already added) under destinations/data.json. Removing that file would be the equivalent of doing a "factory reset" where Data Exchange would fall back to the defaults set in the configuration file.

With these changes any call with an unknown destination on either the sender or the recipient will raise an error. The error messages are very detailed, showing what the valid destinations are (for sender and/or recipient) and which one was provided.

Finally, backward compatibility is preserved, making it possible to use Data Exchange seamlessly with and without destinations.

Copy link
Contributor

@awrichar awrichar left a comment

Choose a reason for hiding this comment

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

Tested and working with hyperledger/firefly#942

@gabriel-indik gabriel-indik changed the title Dest round trips Destinations with verification and round trips Aug 8, 2022
Copy link
Contributor

@peterbroadhurst peterbroadhurst left a comment

Choose a reason for hiding this comment

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

👍

@peterbroadhurst peterbroadhurst merged commit 0e7fb94 into main Aug 8, 2022
@peterbroadhurst peterbroadhurst deleted the dest-round-trips branch August 8, 2022 20:49
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.

4 participants