Collection Sharing
note
In the future we will have more ways to share collections among users (e.g: PAKE), but until we do, the only way to share is using public-key cryptography which is what this section is about.
This section assumes you have already read the collections section and are familiar with collections.
Collections can be shared among users for easy collaboration. This can be used for sharing files between users, editing a shared document, or giving others access to parts of your account (e.g. a calendar).
Getting your public key
An important part of using public key cryptography is making sure the other side of the interaction is whoever you think it is. This can be achieved by verifying each-other's public key. Your public key, as the name implies, is public, so feel free to share it with others.
Getting your public key:
- JavaScript
- Python
- Java
- Kotlin
- C/C++
- Rust
Pretty-print the public key
You would almost always want users to compare public keys in a secure manner (usually phone, in-person, or secure chat). The following function formats the pubkey for you in a way that's easy for users to compare, so you don't have to figure it out yourself.
- JavaScript
- Python
- Java
- Kotlin
- C/C++
- Rust
The format we use is similar to the one used by Signal. Please refer to their post for more information about it.
Sending invitations
The first step towards sharing collections with other users is sending them an invitation. Only a collection admin can send an invitation, so make sure you are one before trying to invite users.
- JavaScript
- Python
- Java
- Kotlin
- C/C++
- Rust
As you can see from the example above, when inviting a user you also set the wanted access level. Allowed values are: Admin
, ReadWrite
, and ReadOnly
.
Responding to invitations
In the previous example we sent an access invitation to user2
. In this section we will see how to respond to these invitations.
- JavaScript
- Python
- Java
- Kotlin
- C/C++
- Rust
Leaving collections
Sometimes a user may want to leave a collection he has been invited to. This can be done as follows:
- JavaScript
- Python
- Java
- Kotlin
- C/C++
- Rust
Controlling access
Like with invitations, only collection admins can see who has access to a collection, modify access levels and revoke access altogether.
Listing collection members
- JavaScript
- Python
- Java
- Kotlin
- C/C++
- Rust
Modifying access level
- JavaScript
- Python
- Java
- Kotlin
- C/C++
- Rust
Revoking access
- JavaScript
- Python
- Java
- Kotlin
- C/C++
- Rust
Iterating through responses
Like with the rest of the Etebase API, list responses can be iterated through in smaller chunks. Here is how it's done for outgoing invitations, but the same can be done for incoming invitations and collection members.
- JavaScript
- Python
- Java
- Kotlin
- C/C++
- Rust