-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Add `shareSpace()` Method to Allow Sharing Spaces with Other Accounts ## Summary This PR introduces a new `shareSpace()` method that allows users to delegate access to an existing space with another Storacha account via email. This feature enhances collaboration by enabling multiple accounts to share access to a space, making data sharing more flexible. By default, the following capabilities/permissions are set: - space/* - for managing space metadata - store/* - for managing stores - upload/*- for registering uploads - access/* - for re-delegating access to other devices - filecoin/* - for submitting to the filecoin pipeline - usage/* - for querying usage ## Changes ### New Feature: **Space Sharing** - **Added `shareSpace()` Method**: - The `shareSpace()` method allows users to share an existing space with another Storacha account by delegating access to the specified email address. - The method takes in the following options: - `space`: The space to be shared, identified by its DID. - `delegateEmail`: The email address of the account to share the space with. - The sharing process involves: 1. **Creating a delegation for the delegate account**: This ensures that the delegate has access to the space. 2. **Delegating access**: Space access is delegated to the provided email account, allowing the delegate to manage and access the space. - If the sharing process fails, the method throws an error detailing the issue. ## How to Test 1. Run the following commands: ```bash npm run build && npm run test ``` 2. Ensure all existing tests pass. 3. Verify that the new test cases for the `shareSpace()` method function correctly. ## Related Issues - [Issue #130](storacha/project-tracking#130): Enable space sharing between accounts. ## Additional Notes This implementation opens the door for future enhancements, such as specifying different permission levels when sharing spaces.
- Loading branch information
Showing
2 changed files
with
221 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters