ipfs / go-ds-crdt

A distributed go-datastore implementation using Merkle-CRDTs.
Other
387 stars 42 forks source link

Permissions #66

Closed liminalitythree closed 4 years ago

liminalitythree commented 4 years ago

The globaldb example says it lets you join a permissionless db. Is there a way to make a db that has permissions with this library. Like, only people with certain permissions can edit a certain key or something like that?

welcome[bot] commented 4 years ago

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

Finally, remember to use https://discuss.ipfs.io if you just need general support.

hsanjuan commented 4 years ago

The approach to do this I use is to register a topic validator for the PubSub instance used for the PubSubBroadcaster, along with message signatures and verification enabled. The pubsub message carries the peer ID of the peer that issued it, thus you can simply disregard messages from some peers (https://github.com/ipfs/ipfs-cluster/blob/7ffd18e41b550e2adbb4f59885e9003b8c7bc332/consensus/crdt/consensus.go#L163).

This is an all or nothing approach, certainly it does not support per-key permissions etc.

For more advanced use cases, I suggest https://docs.textile.io/, or one of the OrbitDB implementations, which have more advanced permission systems.

hsanjuan commented 4 years ago

Closing as this general support and should have been asked in discuss.ipfs.io.