-
Notifications
You must be signed in to change notification settings - Fork 2
Experimental p2panda-spaces
integration (not to be merged)
#114
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
Draft
sandreae
wants to merge
21
commits into
main
Choose a base branch
from
basic-spaces-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or 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
aa2b3eb
to
4b14d5a
Compare
p2panda-spaces
integrationp2panda-spaces
integration (not to be merged)
Users of the `p2panda-spaces` API should not need to pull in more dependencies than necessary.
4ed5c95
to
43f341f
Compare
* Store operations outside of the forge, for this i've introduced an `insert_operation` method * We didn't persist the "create message" yet (for sync), this is fixed now * Write everything into one log as we don't have an orderer yet (which would help with getting a partial ordering on top of multiple logs)
To run the demo users need to set the SPACES_PEER_ID to "alice" on one, and to "bob" on the other peer.
Space ids are actor ids which again are public keys. We use the gossip overlay to learn about changes around a topic, which can be both a space id or the network-wide gossip overlay. The latter is not a public key, this is why the conversion fails (due to an invalid edwards point).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is an "proof of concept" integration of the new, in-progress
p2panda-spaces
crate, which brings access control and group encryption into Reflection.Documents are "spaces" now, allowing "managers" to add and remove other members into the space, assigning read, write and manage permissions. Every delta or snapshot operation is encrypted towards the shared secrets inside that space and sent to every other peer. When they're part of the space they're able to decrypt the payload and apply it to the Loro CRDT.
Things will likely change a bit until we're integrating this for real, this serve as a playground to explore the API and identify potential refactorings.
How to use this
Since we're not having any UI yet to handle user identities (address book etc.) and to add them to a document (give read / write / admin access) we're hard-coding private keys and the regarding key bundles (for encryption) in this POC.
There are two existing identities: "alice" and "bob". Set the
SPACES_PEER_ID
env var inorg.p2panda.reflection.json
to either of them for two Reflection instances to try out sending encrypted messages inside of an "space" to each other.Known Issues
We've identified a couple of shortcomings with the current spaces API which will be reflected in future work (see TODOs in code), otherwise there's a bunch of strange database constraint errors happening, likely because of us messing with the storage layer a bit. They don't seem to affect the encryption and collaborative editing of documents, so we've decided to ignore these errors for now.