ssbc / secret-stack

connect peers to each other using secret-handshakes
MIT License
90 stars 19 forks source link

assert that plugins expose their scope correctly #28

Closed dominictarr closed 5 years ago

dominictarr commented 6 years ago

I was trying to figure out what sbot getAddress public was reporting a ws address, when I had configured that in the device scope. Looking at the code I realized that it wasn't passing the configuration through! Looking at the other plugins, I also saw that several of them did not handle scopes correctly.

So this throws an error if the proto.scope() !== conf.scope (with helpful message)

And this helped me find that unix-socket, net and ws where all reporting scopes incorrectly.

I've also added a method multiserver.scopes which all your scoped address: {<scope>: <getAddress(scope)>,..}

I think this whole multiserver thing is on the verge of being a very excellent basis for building p2p applications, just a few more rough spots to polish!

dominictarr commented 5 years ago

merged into 5.0.0

christianbundy commented 5 years ago

@dominictarr I see "merged into 5.0.0" on three PRs, but none of the commits are showing up. Are these in master, or should I be looking in another branch?

dominictarr commented 5 years ago

@christianbundy maybe I rebased... c77a11a91b487b604f7e5f5cf0d5e6a3bb7bf03a is now 545d0b86e0c267a49aee65273bb9a08417bbb006

christianbundy commented 5 years ago

@dominictarr Sweet, does that mean this is good to close?