Skip to content
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

Support adding/removing access rights #292

Closed
haadcode opened this issue Dec 26, 2017 · 14 comments
Closed

Support adding/removing access rights #292

haadcode opened this issue Dec 26, 2017 · 14 comments

Comments

@haadcode
Copy link
Member

We currently only support "immutable" access rights in that the access rights are defined when the database is created and can't be modified afterwards without changing the address of the database. This is great for some use cases, but obviously it's not enough and we want to be able to add and remove access "dynamically".

Fortunately, we have a way to do this! The access controller is currently an IPFS object and the hash of the object is saved as part of the manifest file of the database. To support dynamic access rights, we can dogfood on our own tech: use an OrbitDB database for the access controller! :) This could be implemented in a way that instead of creating an IPFS object (ipfs-access-controller.js), we implement another access-controller class that resolves OrbitDB addresses. The address of the access controller database could always be for example <orbitdb address>/_access. The access controller database could be immutable in the same way all databases are now, effectively setting the creator of the database as the "admin" in that only the creator can add/remove access for others, or it could even be a chain of dynamic access controllers.

Here's an example how it could be implemented: https://gist.github.com/haadcode/d36b5e75b95e95fc1b15479c8defbe46.

I hope I can get to work on this soon, but if anyone is looking to contribute, implementing this would be of great help and a hugely valuable feature to OrbitDB!

@thiagodelgado111
Copy link
Member

thiagodelgado111 commented Mar 14, 2018

Hey folks, I left a few comments on the prototype proto/dynamic-access branch – I know it's a WIP but I wanted to get them out of my head :)

Those comments are actually questions that came up while I was looking at it. It looks pretty good! Let me know if I can help anyway!

@haadcode
Copy link
Member Author

Thanks @thiagodelgado111, much appreciate the comments and thoughts! Replied to your comments.

@haadcode
Copy link
Member Author

@shamb0t are you actively working on this atm?

@ydennisy
Copy link

@haadcode is there any advancement on this topic of creating access controls for DBs built with Orbit?

@shamb0t
Copy link
Member

shamb0t commented Mar 21, 2018

@haadcode @ydennisy sorry for the delay I'm not actively working on this atm but there's a lot of discussion happening on the prototype branch here

Thank you @thiagodelgado111 for the comments! I think there's still a lot to discuss regarding what we'd like to support, for example currently the db creator must grant new capabilities, what are thoughts on others being able to grant access once they have been granted admin capabilities? Or users of a certain group having certain rights? Was planning to return to this next week but anyone feel free to move this forward!

@ashwin-yardi
Copy link

Hi Guys! Orbit-DB has indeed introduced very creative and revolutionary ways of using IPFS for data storage. I am using Orbit-db in one of my projects. However, Dynamic access control is the desideratum. Its really good to see that this feature is already WIP. May I know some rough estimate on when this branch will be merged? So that I can plan things accordingly. Thanks :) @haadcode @shamb0t

@haadcode
Copy link
Member Author

haadcode commented Sep 5, 2018

Update on this: a lot of work has happened over the past couple of months in https://github.com/orbitdb/ipfs-log. Specifically orbitdb-archive/ipfs-log#159 was merged which is the lowest level of changes needed to support dynamic access control in OrbitDB. Next up is to make OrbitDB use the new version of the log which will bring us the dynamic access control as per this issue. Stay tuned! 😄

@5310
Copy link

5310 commented Sep 5, 2018

Forgive me if I'm too off-topic; there this question is spread across several repositories but ultimately relates to this access-control feature: Is it possible to use libp2p-/js-ipfs keys instead of orbit-db-keystore/-identity-provider for identity and verification? It fits the use-case doesn't it?

@haadcode
Copy link
Member Author

haadcode commented Sep 5, 2018

@5310 indeed, it fits the use case! The orbit-db-keystore was originally designed IPFS Keys in mind that it could be swapped to the one in IPFS. We took some design decisions in implementing the orbit-db-keystore so it's not 1-to-1 compatible with the IPFS Keys API but it should be fairly trivial to create a wrapper, say orbit-db-keystore-ipfs, that maps the functionality between the two APIs.

As for orbit-db-identity-provider, it's a orbitdb-internal functionality so it wouldn't be directly replaced by the IPFS Keys, but we made it so that orbit-db-identity-provider could use "IPFS Keys as Identity Provider" thus using libp2p/ipfs keys for identity and verification.

None of this is implemented yet, but would be happy to accept PRs and provide help implementing the support for IPFS Keys API as a Keystore in OrbitDB.

@MirceaKitsune
Copy link

I've been thinking of programming a serverless social media platform using nothing but IPFS and OrbitDB. Currently my plan is on hold for this very limitation: You cannot change the owner keys of an existing database, thus you wouldn't be able to login to your account from another browser or device (you'd be stuck to the IPFS instance that registered it). I'm eagerly awaiting for this issue to be resolved.

@ghost
Copy link

ghost commented Apr 12, 2021

Are there any updates about this?

@tabcat
Copy link
Member

tabcat commented Apr 12, 2021

@Independent-Eye2446 you can add and remove writers with the 'orbit-db' access controller. i think this can actually be closed.

@ghost
Copy link

ghost commented Apr 12, 2021

@tabcat Thank you for the information

@haydenyoung
Copy link
Member

OrbitDBAccessController should address this requirement. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants