Sharing a Folder with Users
The sequence diagram below shows how a user can share a folder with other users.
Sequence Diagram
User Selection
- The user selects the folder and initiates the share process.
- The client sends a request to the server to fetch the credential fields for the folder.
- The server returns the required credential fields to the client.
User and Access Type Selection
- The user selects the required users to share the folder with.
- For each selected user, the user specifies the access type ( read, manager).
Background Service Processing
- The client sends the fetched credential fields,assoiciated credential id and users to the background service.
- The background service sends the credential fields to the WASM module for decryption.
- The WASM module, which has the user’s private key loaded in memory, decrypts the credential fields.
- After decryption, the background service sends the decrypted fields to be encrypted using each user’s public key to the WASM module.
- The background service sends the encrypted credential fields back to the client.
Server Processing
- The client then sends the whole payload to hash and then sign
- The client sends the encrypted credential fields, user IDs, folder ID and signature in the header to the server.
- The server processes the sharing request after verifying the signature.
- The server adds access to the
folder_access
table for the shared folder and users. - The server adds access to the
access_list
table for each credential in the folder and the shared users. - The server adds the encrypted credential fields to the
fields
table for each user. - The server returns the sharing response (success/failure) to the user.
Note: For every user the sharing is success when all the credentials of the folder are successfully shared with the user. So that is made into a single txn.
Note: From now on, when a new credential is added to the folder, it will be automatically shared with the users who have access to the folder.