forked from storacha/w3up
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): optional account recovery (storacha#1546)
Issue storacha/project-tracking#124 # Current Workflow (CLI) ### `w3cli` Project The [`space.create(name, options)`](https://github.com/storacha-network/w3cli/blob/3f59da7b096a63f14def9946682160fefacd0702/space.js#L24) function in `space.js` allows the user to pass the following options: - **recovery**: `false` (default) - **caution**: `false` (default) - **customer**: `Email | false` - **account**: `string | false` If the `account` attribute is provided, the following steps are triggered: 1. `space.createdRecovery` is called. 2. Then, `client.capabilities.access.delegate` is executed. This process occurs during **space creation**, not during provisioning. Provisioning only happens when the `customer` attribute is provided in the `options` argument. --- # Issue (JS Client) ### `w3up` Project The [`client.createSpace(name)`](https://github.com/storacha-network/w3up/blob/fb8b8677c4c633cdf8c259db55357a1794eed3ab/packages/w3up-client/src/client.js#L239) function in the `w3up` project currently does **not** accept any options, which means the recovery account must be created manually **after** space creation and provisioning. This introduces a risk of forgetting the manual step and potentially losing access to the space. --- # Expected Outcome We propose a small modification to the `client.createSpace(name)` function to support optional parameters, allowing clients to pass an `account` directly, automating the recovery setup. ### Solution: - Clients can now call `client.createSpace(name, { account })` to include the `account` in the creation process. - This ensures that the recovery account is created immediately after the space is created, provisioned, and saved, eliminating the need for a manual step. ### Benefits: - **Backward Compatibility**: The change does not break existing client implementations since the `account` parameter is optional, keeping calls like `client.createSpace(name)` intact. - **Simplified Workflow**: By simply passing the `account` when calling `createSpace`, the recovery account setup is handled automatically during space creation. - **Flexibility**: If needed in the future, the `account` attribute can be made required to enforce stricter recovery account management. --------- Signed-off-by: Felipe Forbeck <felipe.forbeck@gmail.com> Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
- Loading branch information
Showing
5 changed files
with
193 additions
and
35 deletions.
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
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
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