-
Notifications
You must be signed in to change notification settings - Fork 26
feat: pubsub: add global signature policy #66
Conversation
BREAKING CHANGE: `signMessages` and `strictSigning` pubsub configuration options replaced with a `globalSignaturePolicy` option
|
@wemeetagain is this ready for review? If so, can you get the linting fixed? |
|
@vasco-santos should be ready for a review One thing that might be nice to add here, that isn't yet included:
Do you have a preference for which library/hash could/should be used in this case? |
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.
Overall this looks good. Just needs some minor changes and docs/examples update.
Can you update https://github.com/libp2p/js-libp2p-interfaces/tree/master/src/pubsub#example to use the policy? Might be worth documenting the constructor params in the API docs as well.
As the end goal is to support topic based policies, I think we should have tests for it, as well as an example in the README for the applications
This is not included in go, right? We should leverage multiformats/js-multihashing-async |
Yea i don't think the go impl includes default msg id functions. Is there a reason why we need the async version? Somehow it seems that a message id would be something that is always synchronously retrieved. |
Ok, either way I think this is a nice addition!
Good point, we should use the base module then: https://github.com/multiformats/js-multihash Furthermore, we should create an issue to track updating this to the topic level per the spec |
|
@wemeetagain Can you get the lint job fixed? |
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.
LGTM
|
bump |
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.
LGTM 🚢
See libp2p/specs#294 and libp2p/specs#299
Add a "global" signature policy to pubsub. This is a first-step towards having a "topic-specific" signature policy as described in the specs.
This "signature policy" replaces the ad-hoc options
signMessagesandstrictSigningthat were previously in use.Only 'StrictSign' and 'StrictNoSign' signature policies are implemented, the 'LaxSign' and 'LaxNoSign' signature policies are not recommended and will be deprecated, so are not included.
BREAKING CHANGE:
signMessagesandstrictSigningpubsub configuration options replacedwith a
globalSignaturePolicyoption