Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
57e4e210
Commit
57e4e210
authored
Mar 01, 2017
by
Jeromy Johnson
Committed by
GitHub
Mar 01, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3734 from ipfs/feat/keystore/list-self
keystore: add self key to the listing
parents
1ef5ecb6
fe0cc96b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
core/commands/keystore.go
core/commands/keystore.go
+4
-2
test/sharness/t0165-keystore.sh
test/sharness/t0165-keystore.sh
+6
-0
No files found.
core/commands/keystore.go
View file @
57e4e210
...
...
@@ -40,7 +40,7 @@ var KeyGenCmd = &cmds.Command{
Tagline
:
"Create a new keypair"
,
},
Options
:
[]
cmds
.
Option
{
cmds
.
StringOption
(
"type"
,
"t"
,
"type of the key to create"
),
cmds
.
StringOption
(
"type"
,
"t"
,
"type of the key to create
[rsa, ed25519]
"
),
cmds
.
IntOption
(
"size"
,
"s"
,
"size of the key to generate"
),
},
Arguments
:
[]
cmds
.
Argument
{
...
...
@@ -160,7 +160,9 @@ var KeyListCmd = &cmds.Command{
sort
.
Strings
(
keys
)
list
:=
make
([]
KeyOutput
,
0
,
len
(
keys
))
list
:=
make
([]
KeyOutput
,
0
,
len
(
keys
)
+
1
)
list
=
append
(
list
,
KeyOutput
{
Name
:
"self"
,
Id
:
n
.
Identity
.
Pretty
()})
for
_
,
key
:=
range
keys
{
privKey
,
err
:=
n
.
Repo
.
Keystore
()
.
Get
(
key
)
...
...
test/sharness/t0165-keystore.sh
View file @
57e4e210
...
...
@@ -22,6 +22,7 @@ test_key_cmd() {
test_expect_success
"both keys show up in list output"
'
echo bazed > list_exp &&
echo foobarsa >> list_exp &&
echo self >> list_exp
ipfs key list | sort > list_out &&
test_cmp list_exp list_out
'
...
...
@@ -30,6 +31,11 @@ test_key_cmd() {
ipfs key list -l | grep $edhash > /dev/null &&
ipfs key list -l | grep $rsahash > /dev/null
'
test_expect_success
"key list -l contains self key with peerID"
'
PeerID="$(ipfs config Identity.PeerID)"
ipfs key list -l | grep "$PeerID self"
'
}
test_key_cmd
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment