-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print a new key pair. Does not change your current signing key. Bring the feature from [`ucan-key`](https://github.com/olizilla/ucan-key) into w3cli see: #154 (comment) License: MIT Signed-off-by: Oli Evans <[email protected]>
- Loading branch information
Showing
4 changed files
with
128 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -400,7 +400,9 @@ export const testSpace = { | |
}), | ||
|
||
'w3 space use': test(async (assert, context) => { | ||
const spaceDID = await loginAndCreateSpace(context, { env: context.env.alice }) | ||
const spaceDID = await loginAndCreateSpace(context, { | ||
env: context.env.alice, | ||
}) | ||
|
||
const listDefault = await w3 | ||
.args(['space', 'ls']) | ||
|
@@ -1168,6 +1170,14 @@ export const testPlan = { | |
}), | ||
} | ||
|
||
export const testKey = { | ||
'w3 key create': test(async (assert) => { | ||
const res = await w3.args(['key', 'create', '--json']).join() | ||
const key = ED25519.from(dagJSON.parse(res.output)) | ||
assert.ok(key.did().startsWith('did:key')) | ||
}), | ||
} | ||
|
||
/** | ||
* @param {Test.Context} context | ||
* @param {object} options | ||
|
@@ -1217,11 +1227,7 @@ export const selectPlan = async ( | |
*/ | ||
export const createSpace = async ( | ||
context, | ||
{ | ||
customer = '[email protected]', | ||
name = 'home', | ||
env = context.env.alice | ||
} = {} | ||
{ customer = '[email protected]', name = 'home', env = context.env.alice } = {} | ||
) => { | ||
const { output } = await w3 | ||
.args([ | ||
|
@@ -1256,7 +1262,7 @@ export const loginAndCreateSpace = async ( | |
customer = email, | ||
name = 'home', | ||
plan = 'did:web:free.web3.storage', | ||
env = context.env.alice | ||
env = context.env.alice, | ||
} = {} | ||
) => { | ||
await login(context, { email, env }) | ||
|