-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: implement new account-based multi-device flow (#433)
With this PR we're able to use two different devices on behalf of a single account identified by an email address. An agent (ie, a device like w3console or w3cli) can now: 1) use `access/authorize` to trigger an email verification flow that will give them delegations to act on behalf of an account 2) create a space locally 3) add a storage provider to that space with `provider/add` 4) delegate capabilities to the account they are authorized as that permit the account to delegate all capabilities on those spaces to other agents - in other words, create spaces and assign all "permissions" on those spaces to their account 5) upload data to the space A second agent (ie, another device) can then: 1) use `access/authorize` to trigger an email verification flow that will give them delegations to act on behalf of the same account 2) get a list of spaces they can store data in, which includes the space created on the first device 3) upload data to the space This PR also contains various refactoring of the `Agent` class to minimize its responsibilities and move in the direction of letting user agents take responsibility for state storage. refs #395 * [x] setup tests for access-client agent + access-api * [x] simple test agent createSpace * [x] @gobengo test agent authorize happy path #535 * [x] @gobengo upgrade to ucanto 6.2 #541 * [x] @travis ensure what's proposed here can work in w3up-client, w3ui, w3console * [x] upgrade this branch to `@ucanto/[email protected]` after storacha/ucanto#261 * [x] minimize new public api surface area on access-client Agent * [x] (e.g. `sessionProof`) https://github.com/web3-storage/w3protocol/pull/545/files * [x] `sessionPrincipal` #546 * [x] review comments * [x] `authorize` should access/claim `with=did:mailto:...` https://github.com/web3-storage/w3protocol/pull/556/files# --------- Co-authored-by: Travis Vachon <[email protected]> Co-authored-by: Benjamin Goering <[email protected]> Co-authored-by: Irakli Gozalishvili <[email protected]>
- Loading branch information
1 parent
1bad951
commit 1ddc6a0
Showing
31 changed files
with
2,902 additions
and
1,207 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,14 +17,14 @@ | |
"docs:markdown": "pnpm run build && docusaurus generate-typedoc" | ||
}, | ||
"devDependencies": { | ||
"@docusaurus/core": "^2.2.0", | ||
"@docusaurus/core": "^2.3.1", | ||
"docusaurus-plugin-typedoc": "^0.18.0", | ||
"lint-staged": "^13.1.0", | ||
"lint-staged": "^13.2.0", | ||
"prettier": "2.8.3", | ||
"simple-git-hooks": "^2.8.1", | ||
"typedoc-plugin-markdown": "^3.14.0", | ||
"typescript": "4.9.5", | ||
"wrangler": "^2.8.0" | ||
"wrangler": "^2.12.3" | ||
}, | ||
"simple-git-hooks": { | ||
"pre-commit": "npx lint-staged" | ||
|
@@ -44,7 +44,7 @@ | |
}, | ||
"dependencies": { | ||
"depcheck": "^1.4.3", | ||
"typedoc": "^0.23.22", | ||
"typedoc": "^0.23.26", | ||
"typedoc-plugin-missing-exports": "^1.0.0" | ||
}, | ||
"packageManager": "[email protected]", | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import * as Ucanto from '@ucanto/interface' | ||
|
||
export type ServiceInvoke< | ||
Service extends Record<string, any>, | ||
InvocationCapabilities extends Ucanto.Capability = Ucanto.Capability | ||
> = <Capability extends InvocationCapabilities>( | ||
invocation: Ucanto.ServiceInvocation<Capability> | ||
) => Promise<Ucanto.InferServiceInvocationReturn<Capability, Service>> |
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
Oops, something went wrong.