marcua / ayb

ayb makes it easy to create databases, share them with collaborators, and query them from a web application or the command line
Apache License 2.0
66 stars 4 forks source link

Database sharing and access control #281

Open marcua opened 10 months ago

marcua commented 10 months ago

Rough description

A database owner should be able to allow other users/entities to have following levels of access

A database owner should also be able to control whether the public can have various forms of read-only access

The plan

sofiaritz commented 10 months ago

I think we should combine forking and querying, if someone can fork the database then they can run read-only queries as well :)

marcua commented 10 months ago

Definitely before we have forking support and support for varying memory/CPU for different databases, I agree. :)

The reason I was thinking someone might want to give fork read-only access but not query read-only access is because queries take up resources on your running database, whereas forking doesn't. So perhaps in the future when you want someone to look at your dataset but don't want them to use up your CPU running queries, you can say "fork my dataset and let me know what you find!" without having to worry about beefing up your own running database.

Definitely not something we have to worry about for a while :).

marcua commented 2 months ago

Working on this next! Came up with a rough outline of a plan in the issue description!

marcua commented 2 months ago

SQLite data models work, and started on Rust data models. For next time

marcua commented 2 months ago
marcua commented 1 month ago

Done

Next

marcua commented 1 month ago

Reworked plan to be endpoint-focused (e.g., expose public sharing first) rather than layer-focused (e.g., implementing all DB functionality first, but no endpoints are exposed).

First up: Add endpoint to support updates to a database's public sharing level. Make this a generic update_database endpoint. Permissions: must be manager or owner.

marcua commented 1 month ago

Almost done with endpoint to update public sharing level.

Next

marcua commented 1 month ago

Server-side support for public sharing level updates done. Started writing end-to-end tests.

Next

marcua commented 1 month ago

public_sharing_level is now updateable! Introduced read-only mode in SQLite!

Next up:

marcua commented 3 weeks ago

List and query logic and tests are all set (exposed to the query and entity details endpoints, passed through properly to rusqlite). Next

marcua commented 2 weeks ago

Merged working support for fork/read-only public sharing level!

Next

marcua commented 1 week ago

Wrote up documentation for both public sharing level and entity-level permissions. Next

marcua commented 4 days ago

Database-/endpoint-/CLI-level support for sharing is implemented (but untested) on branch permissions-crud. Next