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

feat: sharing spaces #1551

Merged
merged 4 commits into from
Sep 20, 2024
Merged

feat: sharing spaces #1551

merged 4 commits into from
Sep 20, 2024

Conversation

fforbeck
Copy link
Member

@fforbeck fforbeck commented Sep 16, 2024

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:
npm run build && npm run test
  1. Ensure all existing tests pass.

  2. Verify that the new test cases for the shareSpace() method function correctly.

Related Issues

  • Issue #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.

packages/w3up-client/src/client.js Outdated Show resolved Hide resolved
packages/w3up-client/src/client.js Outdated Show resolved Hide resolved
Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good to me, just a few minor issues I think need to be addressed and then mergable :)

packages/w3up-client/src/client.js Outdated Show resolved Hide resolved
packages/w3up-client/src/client.js Outdated Show resolved Hide resolved
packages/w3up-client/src/client.js Outdated Show resolved Hide resolved
packages/w3up-client/src/client.js Outdated Show resolved Hide resolved
@fforbeck fforbeck merged commit 7deb9a4 into main Sep 20, 2024
3 checks passed
@fforbeck fforbeck deleted the share-spaces branch September 20, 2024 12:22
fforbeck pushed a commit that referenced this pull request Sep 20, 2024
🤖 I have created a release *beep* *boop*
---


##
[16.2.0](w3up-client-v16.1.1...w3up-client-v16.2.0)
(2024-09-20)


### Features

* sharing spaces ([#1551](#1551))
([7deb9a4](7deb9a4))


### Fixes

* repo URLs ([#1550](#1550))
([e02ddf3](e02ddf3))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants