secrez 1.1.5 β 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -66
- package/coverage.report +50 -33
- package/package.json +1 -1
- package/src/commands/Export.js +19 -4
package/README.md
CHANGED
@@ -371,6 +371,10 @@ Secrez is not intended to compete with password managers, so do not expect it to
|
|
371
371
|
|
372
372
|
## History
|
373
373
|
|
374
|
+
**1.1.6**
|
375
|
+
|
376
|
+
- add support for cryptoEnv format to `export` (look at https://github.com/secrez/cryptoenv for details about CryptoEnv)
|
377
|
+
|
374
378
|
**1.1.5**
|
375
379
|
|
376
380
|
- fix touch's help showing wrong, temporary options, changed during the development :-(
|
@@ -832,73 +836,73 @@ Thank you for any contributions! π
|
|
832
836
|
1 pending
|
833
837
|
|
834
838
|
-----------------------|---------|----------|---------|---------|-----------------------------------
|
835
|
-
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
839
|
+
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
836
840
|
-----------------------|---------|----------|---------|---------|-----------------------------------
|
837
|
-
All files | 71.22 | 58.41 | 71.25 | 71.11 |
|
838
|
-
src | 59.63 | 54.79 | 55 | 60.19 |
|
839
|
-
Command.js | 79.66 | 78.72 | 76.92 | 81.03 | 32,55-62,73,80,119
|
840
|
-
PreCommand.js | 21.95 | 11.54 | 14.29 | 21.95 | 8-99,116
|
841
|
-
cliConfig.js | 100 | 100 | 100 | 100 |
|
842
|
-
src/commands | 81.53 | 67 | 89.95 | 81.4 |
|
843
|
-
Alias.js | 90.54 | 77.36 | 100 | 90.41 | 101,112,139,169,173,180,190
|
844
|
-
Bash.js | 75 | 0 | 66.67 | 75 | 18-19
|
845
|
-
Cat.js | 98.9 | 88.89 | 100 | 98.9 | 152
|
846
|
-
Cd.js | 96.43 | 86.67 | 100 | 96.43 | 44
|
847
|
-
Chat.js | 19.51 | 0 | 16.67 | 19.51 | 23-144
|
848
|
-
Conf.js | 10.45 | 0 | 25 | 10.45 | 134-499
|
849
|
-
Contacts.js | 74.67 | 65.98 | 92.86 | 74.5 | ...90-214,240,247,259,315,328,338
|
850
|
-
Copy.js | 94.87 | 74.51 | 100 | 94.81 | 111,162,179,204
|
851
|
-
Courier.js | 63.54 | 41.86 | 85.71 | 63.83 | ...37,152-171,188,200-203,215-221
|
852
|
-
Ds.js | 92.54 | 82.05 | 100 | 92.42 | 99,108-113,125
|
853
|
-
Edit.js | 13.58 | 0 | 40 | 13.58 | 88-214
|
854
|
-
Export.js | 87.63 | 67.74 | 100 | 87.63 | ...66,175,182-186,191,203,212,215
|
855
|
-
Find.js | 93.59 | 86.67 | 100 | 93.42 | 101,164,200-203,209
|
856
|
-
Help.js | 100 | 80 | 100 | 100 | 29
|
857
|
-
Import.js | 93.2 | 85.48 | 100 | 93.14 | ...65,367,387,393,441,456-463,490
|
858
|
-
Lcat.js | 100 | 85.71 | 100 | 100 | 54
|
859
|
-
Lcd.js | 95.65 | 81.82 | 100 | 95.65 | 50
|
860
|
-
Lls.js | 95.45 | 72.73 | 100 | 95.45 | 97
|
861
|
-
Lpwd.js | 92.31 | 100 | 100 | 92.31 | 36
|
862
|
-
Ls.js | 91.3 | 75 | 100 | 90.77 | 103,114-116,130,181
|
863
|
-
Mkdir.js | 100 | 66.67 | 100 | 100 | 38-44
|
864
|
-
Mv.js | 88.04 | 73.21 | 100 | 87.78 | 93-99,133,155,165-172
|
865
|
-
Paste.js | 87.23 | 75 | 100 | 87.23 | 72,78,81,89,113,129
|
866
|
-
Pwd.js | 92.31 | 100 | 100 | 92.31 | 33
|
867
|
-
Quit.js | 90 | 50 | 100 | 90 | 27
|
868
|
-
Rm.js | 94 | 80.95 | 100 | 93.88 | 63,126,134
|
869
|
-
Shell.js | 88.24 | 60 | 100 | 88.24 | 38,55
|
870
|
-
Ssh.js | 25 | 0 | 40 | 25 | 72-120
|
871
|
-
Tag.js | 98.04 | 92.31 | 100 | 98.02 | 122,171
|
872
|
-
Totp.js | 96.47 | 74.47 | 100 | 96.47 | 188-189,235
|
873
|
-
Touch.js | 95.92 | 81.48 | 100 | 95.83 | 152,202
|
874
|
-
Use.js | 96.77 | 89.47 | 100 | 96.77 | 68
|
875
|
-
Ver.js | 90 | 66.67 | 100 | 90 | 25
|
876
|
-
Whoami.js | 93.1 | 63.64 | 80 | 93.1 | 29,64
|
877
|
-
chat.js | 85.37 | 53.85 | 100 | 85.37 | 105,117-130,136,142
|
878
|
-
index.js | 91.67 | 60 | 100 | 91.3 | 22,31
|
879
|
-
src/commands/chat | 79.44 | 63.29 | 92.31 | 79.33 |
|
880
|
-
Contacts.js | 80 | 42.86 | 80 | 80 | 54,65,69,81
|
881
|
-
Help.js | 86.67 | 60 | 100 | 86.67 | 37-38
|
882
|
-
Join.js | 95.65 | 82.61 | 100 | 95.56 | 43,110
|
883
|
-
Leave.js | 100 | 60 | 100 | 100 | 24,28
|
884
|
-
Quit.js | 100 | 75 | 100 | 100 | 24
|
885
|
-
Send.js | 67.65 | 46.67 | 100 | 67.65 | 37,41,44,77,86-95
|
886
|
-
Show.js | 68.75 | 70.59 | 100 | 68.75 | 74-78,87,102-108
|
887
|
-
Whoami.js | 42.86 | 0 | 60 | 42.86 | 22,30-39
|
888
|
-
src/prompts | 14.72 | 0 | 13.43 | 14.85 |
|
889
|
-
ChatPrompt.js | 6.1 | 0 | 0 | 6.1 | 8-164
|
890
|
-
ChatPromptMock.js | 100 | 100 | 66.67 | 100 |
|
891
|
-
CommandPrompt.js | 9.8 | 0 | 0 | 9.93 | 24-318
|
892
|
-
Completion.js | 4.41 | 0 | 0 | 4.48 | 6-103
|
893
|
-
MainPromptMock.js | 100 | 100 | 66.67 | 100 |
|
894
|
-
MultiEditorPrompt.js | 25 | 0 | 0 | 25 | 7-36
|
895
|
-
SigintManager.js | 25 | 0 | 20 | 25 | 10-36
|
896
|
-
src/utils | 69.92 | 63.28 | 56.25 | 69.55 |
|
897
|
-
AliasManager.js | 100 | 91.67 | 100 | 100 | 47
|
898
|
-
ContactManager.js | 71.43 | 60 | 85.71 | 71.43 | 12,35-37
|
899
|
-
Fido2Client.js | 15.38 | 0 | 11.11 | 15.38 | 14-108
|
900
|
-
HelpProto.js | 91.6 | 84.06 | 100 | 91.45 | 49,153-154,171-176,195
|
901
|
-
Logger.js | 63.64 | 56.25 | 36.84 | 62.79 | ...37-49,57,65-69,74,84,88,93,105
|
841
|
+
All files | 71.22 | 58.41 | 71.25 | 71.11 |
|
842
|
+
src | 59.63 | 54.79 | 55 | 60.19 |
|
843
|
+
Command.js | 79.66 | 78.72 | 76.92 | 81.03 | 32,55-62,73,80,119
|
844
|
+
PreCommand.js | 21.95 | 11.54 | 14.29 | 21.95 | 8-99,116
|
845
|
+
cliConfig.js | 100 | 100 | 100 | 100 |
|
846
|
+
src/commands | 81.53 | 67 | 89.95 | 81.4 |
|
847
|
+
Alias.js | 90.54 | 77.36 | 100 | 90.41 | 101,112,139,169,173,180,190
|
848
|
+
Bash.js | 75 | 0 | 66.67 | 75 | 18-19
|
849
|
+
Cat.js | 98.9 | 88.89 | 100 | 98.9 | 152
|
850
|
+
Cd.js | 96.43 | 86.67 | 100 | 96.43 | 44
|
851
|
+
Chat.js | 19.51 | 0 | 16.67 | 19.51 | 23-144
|
852
|
+
Conf.js | 10.45 | 0 | 25 | 10.45 | 134-499
|
853
|
+
Contacts.js | 74.67 | 65.98 | 92.86 | 74.5 | ...90-214,240,247,259,315,328,338
|
854
|
+
Copy.js | 94.87 | 74.51 | 100 | 94.81 | 111,162,179,204
|
855
|
+
Courier.js | 63.54 | 41.86 | 85.71 | 63.83 | ...37,152-171,188,200-203,215-221
|
856
|
+
Ds.js | 92.54 | 82.05 | 100 | 92.42 | 99,108-113,125
|
857
|
+
Edit.js | 13.58 | 0 | 40 | 13.58 | 88-214
|
858
|
+
Export.js | 87.63 | 67.74 | 100 | 87.63 | ...66,175,182-186,191,203,212,215
|
859
|
+
Find.js | 93.59 | 86.67 | 100 | 93.42 | 101,164,200-203,209
|
860
|
+
Help.js | 100 | 80 | 100 | 100 | 29
|
861
|
+
Import.js | 93.2 | 85.48 | 100 | 93.14 | ...65,367,387,393,441,456-463,490
|
862
|
+
Lcat.js | 100 | 85.71 | 100 | 100 | 54
|
863
|
+
Lcd.js | 95.65 | 81.82 | 100 | 95.65 | 50
|
864
|
+
Lls.js | 95.45 | 72.73 | 100 | 95.45 | 97
|
865
|
+
Lpwd.js | 92.31 | 100 | 100 | 92.31 | 36
|
866
|
+
Ls.js | 91.3 | 75 | 100 | 90.77 | 103,114-116,130,181
|
867
|
+
Mkdir.js | 100 | 66.67 | 100 | 100 | 38-44
|
868
|
+
Mv.js | 88.04 | 73.21 | 100 | 87.78 | 93-99,133,155,165-172
|
869
|
+
Paste.js | 87.23 | 75 | 100 | 87.23 | 72,78,81,89,113,129
|
870
|
+
Pwd.js | 92.31 | 100 | 100 | 92.31 | 33
|
871
|
+
Quit.js | 90 | 50 | 100 | 90 | 27
|
872
|
+
Rm.js | 94 | 80.95 | 100 | 93.88 | 63,126,134
|
873
|
+
Shell.js | 88.24 | 60 | 100 | 88.24 | 38,55
|
874
|
+
Ssh.js | 25 | 0 | 40 | 25 | 72-120
|
875
|
+
Tag.js | 98.04 | 92.31 | 100 | 98.02 | 122,171
|
876
|
+
Totp.js | 96.47 | 74.47 | 100 | 96.47 | 188-189,235
|
877
|
+
Touch.js | 95.92 | 81.48 | 100 | 95.83 | 152,202
|
878
|
+
Use.js | 96.77 | 89.47 | 100 | 96.77 | 68
|
879
|
+
Ver.js | 90 | 66.67 | 100 | 90 | 25
|
880
|
+
Whoami.js | 93.1 | 63.64 | 80 | 93.1 | 29,64
|
881
|
+
chat.js | 85.37 | 53.85 | 100 | 85.37 | 105,117-130,136,142
|
882
|
+
index.js | 91.67 | 60 | 100 | 91.3 | 22,31
|
883
|
+
src/commands/chat | 79.44 | 63.29 | 92.31 | 79.33 |
|
884
|
+
Contacts.js | 80 | 42.86 | 80 | 80 | 54,65,69,81
|
885
|
+
Help.js | 86.67 | 60 | 100 | 86.67 | 37-38
|
886
|
+
Join.js | 95.65 | 82.61 | 100 | 95.56 | 43,110
|
887
|
+
Leave.js | 100 | 60 | 100 | 100 | 24,28
|
888
|
+
Quit.js | 100 | 75 | 100 | 100 | 24
|
889
|
+
Send.js | 67.65 | 46.67 | 100 | 67.65 | 37,41,44,77,86-95
|
890
|
+
Show.js | 68.75 | 70.59 | 100 | 68.75 | 74-78,87,102-108
|
891
|
+
Whoami.js | 42.86 | 0 | 60 | 42.86 | 22,30-39
|
892
|
+
src/prompts | 14.72 | 0 | 13.43 | 14.85 |
|
893
|
+
ChatPrompt.js | 6.1 | 0 | 0 | 6.1 | 8-164
|
894
|
+
ChatPromptMock.js | 100 | 100 | 66.67 | 100 |
|
895
|
+
CommandPrompt.js | 9.8 | 0 | 0 | 9.93 | 24-318
|
896
|
+
Completion.js | 4.41 | 0 | 0 | 4.48 | 6-103
|
897
|
+
MainPromptMock.js | 100 | 100 | 66.67 | 100 |
|
898
|
+
MultiEditorPrompt.js | 25 | 0 | 0 | 25 | 7-36
|
899
|
+
SigintManager.js | 25 | 0 | 20 | 25 | 10-36
|
900
|
+
src/utils | 69.92 | 63.28 | 56.25 | 69.55 |
|
901
|
+
AliasManager.js | 100 | 91.67 | 100 | 100 | 47
|
902
|
+
ContactManager.js | 71.43 | 60 | 85.71 | 71.43 | 12,35-37
|
903
|
+
Fido2Client.js | 15.38 | 0 | 11.11 | 15.38 | 14-108
|
904
|
+
HelpProto.js | 91.6 | 84.06 | 100 | 91.45 | 49,153-154,171-176,195
|
905
|
+
Logger.js | 63.64 | 56.25 | 36.84 | 62.79 | ...37-49,57,65-69,74,84,88,93,105
|
902
906
|
-----------------------|---------|----------|---------|---------|-----------------------------------
|
903
907
|
|
904
908
|
```
|
package/coverage.report
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> secrez@1.1.
|
2
|
+
> secrez@1.1.6 test /Users/francescosullo/Projects/Secrez/secrez/packages/secrez
|
3
3
|
> cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha test/*.test.js test/**/*.test.js test/**/**/*.js --exit
|
4
4
|
|
5
5
|
|
@@ -29,10 +29,10 @@
|
|
29
29
|
#Cat
|
30
30
|
β should return the help
|
31
31
|
β should show the content of a file
|
32
|
-
β should show either one or all the versions of a file (
|
32
|
+
β should show either one or all the versions of a file (1016ms)
|
33
33
|
β should throw if entry is not a file or file does not exist
|
34
34
|
β should throw if trying to cat a binary file
|
35
|
-
β should show the content of a Yaml file (
|
35
|
+
β should show the content of a Yaml file (1018ms)
|
36
36
|
|
37
37
|
#Cd
|
38
38
|
β should return the help
|
@@ -41,7 +41,7 @@
|
|
41
41
|
|
42
42
|
#Chat
|
43
43
|
β should return the help
|
44
|
-
β should run the chat if the courier is ready (
|
44
|
+
β should run the chat if the courier is ready (551ms)
|
45
45
|
|
46
46
|
#Contacts
|
47
47
|
β should return the help
|
@@ -55,17 +55,17 @@
|
|
55
55
|
|
56
56
|
#Copy
|
57
57
|
β should return the help
|
58
|
-
β should copy a file to the clipboard (
|
59
|
-
β should copy a string to the clipboard (
|
60
|
-
β should copy a card to the clipboard (
|
58
|
+
β should copy a file to the clipboard (401ms)
|
59
|
+
β should copy a string to the clipboard (244ms)
|
60
|
+
β should copy a card to the clipboard (883ms)
|
61
61
|
β should return an error if the file does not exist or is a folder
|
62
62
|
β should throw if copying to clipboard a binary files
|
63
63
|
|
64
64
|
#Courier
|
65
65
|
β should return the help
|
66
66
|
β should check if it is ready
|
67
|
-
β should set up the courier (
|
68
|
-
β should set up the courier and get the default message when is already set up (
|
67
|
+
β should set up the courier (172ms)
|
68
|
+
β should set up the courier and get the default message when is already set up (171ms)
|
69
69
|
|
70
70
|
#Ds
|
71
71
|
β should return the help
|
@@ -79,13 +79,14 @@
|
|
79
79
|
β should export a file to the current local folder
|
80
80
|
β should export a binary file to the current local folder
|
81
81
|
β should export an encrypted file to the current local folder
|
82
|
-
β should export a file and delete it after 1 second (
|
82
|
+
β should export a file and delete it after 1 second (1205ms)
|
83
83
|
β should return an error if the file does not exist or is a folder
|
84
|
-
β should export a keystore json file if a private_key exists in the entry (
|
84
|
+
β should export a keystore json file if a private_key exists in the entry (1050ms)
|
85
|
+
β should export a cryptoenv file if a private_key exists in the entry
|
85
86
|
|
86
87
|
#Find
|
87
88
|
β should return the help
|
88
|
-
β should show find a string in the tree (
|
89
|
+
β should show find a string in the tree (1024ms)
|
89
90
|
β should find no result without parameters
|
90
91
|
β should skip binary files from search
|
91
92
|
|
@@ -103,7 +104,7 @@
|
|
103
104
|
β should import an encrypted binary file and export it again verifying it is fine
|
104
105
|
β should import files recursively
|
105
106
|
β should read a folder and import the only text file
|
106
|
-
|
107
|
+
1) should read a folder and import text and binary files
|
107
108
|
β should simulate the import of two files
|
108
109
|
β should move the imported file
|
109
110
|
β should import a backup from another software spanning the data among folders and files
|
@@ -150,7 +151,7 @@
|
|
150
151
|
|
151
152
|
#Mv
|
152
153
|
β should return the help
|
153
|
-
β should rename a file (
|
154
|
+
β should rename a file (1010ms)
|
154
155
|
β should move a file to another folder
|
155
156
|
β should move many files to another folder
|
156
157
|
β should move a file to another subfolder
|
@@ -159,14 +160,14 @@
|
|
159
160
|
β should move file to another dataset using wildcards
|
160
161
|
β should move file managing duplicates
|
161
162
|
β should throw if parameters are missed or wrong
|
162
|
-
β should move files from and to other datasets (
|
163
|
+
β should move files from and to other datasets (1018ms)
|
163
164
|
β should move the results of a find
|
164
165
|
|
165
166
|
#Paste
|
166
167
|
β should return the help
|
167
|
-
β should paste the clipboard content to a new file (
|
168
|
-
β should paste the clipboard content to an existent file (
|
169
|
-
β should paste a single field to a yml card (
|
168
|
+
β should paste the clipboard content to a new file (69ms)
|
169
|
+
β should paste the clipboard content to an existent file (110ms)
|
170
|
+
β should paste a single field to a yml card (67ms)
|
170
171
|
|
171
172
|
#Pwd
|
172
173
|
β should return the help
|
@@ -180,7 +181,7 @@
|
|
180
181
|
β should delete a file with one version
|
181
182
|
β should delete many files usign wildcards
|
182
183
|
β should return errors if wrong parameters
|
183
|
-
β should delete some versions of a file (
|
184
|
+
β should delete some versions of a file (1008ms)
|
184
185
|
|
185
186
|
#Shell
|
186
187
|
β should return the help
|
@@ -196,13 +197,13 @@
|
|
196
197
|
|
197
198
|
#Totp
|
198
199
|
β should return the help
|
199
|
-
β should totp a file to the clipboard (
|
200
|
-
β should read a totp secret from an image and add the totp field to the card (
|
201
|
-
β should read a totp secret from an image and return the secret
|
200
|
+
β should totp a file to the clipboard (360ms)
|
201
|
+
β should read a totp secret from an image and add the totp field to the card (68ms)
|
202
|
+
β should read a totp secret from an image and return the secret (54ms)
|
202
203
|
β should throw if bad image
|
203
204
|
β should throw if missing parameters
|
204
|
-
β should throw if the yaml is malformed
|
205
|
-
β should read a totp secret from the clipboard (
|
205
|
+
β should throw if the yaml is malformed (45ms)
|
206
|
+
β should read a totp secret from the clipboard (310ms)
|
206
207
|
|
207
208
|
#Touch
|
208
209
|
β should return the help
|
@@ -225,7 +226,7 @@ New file "/folder2/file1" created.
|
|
225
226
|
|
226
227
|
#Whoami
|
227
228
|
β should return the help
|
228
|
-
β should see who am I
|
229
|
+
β should see who am I (38ms)
|
229
230
|
|
230
231
|
#Help
|
231
232
|
β should return the help
|
@@ -234,7 +235,7 @@ New file "/folder2/file1" created.
|
|
234
235
|
β should return the help
|
235
236
|
β should join a chat with user0x
|
236
237
|
β should join a chat with user0x
|
237
|
-
β should jump between chats
|
238
|
+
β should jump between chats (39ms)
|
238
239
|
β should return all the users
|
239
240
|
β should throw if contact not found or multiple chat
|
240
241
|
|
@@ -244,29 +245,44 @@ New file "/folder2/file1" created.
|
|
244
245
|
|
245
246
|
#Quit
|
246
247
|
β should return the help
|
247
|
-
β should quit the chat, even if inside a room (
|
248
|
+
β should quit the chat, even if inside a room (57ms)
|
248
249
|
|
249
250
|
#Send
|
250
251
|
β should return the help
|
251
|
-
β should send a message to user0 (
|
252
|
+
β should send a message to user0 (245ms)
|
252
253
|
|
253
254
|
#Show
|
254
255
|
β should return the help
|
255
|
-
β should show history messages (
|
256
|
+
β should show history messages (452ms)
|
256
257
|
|
257
258
|
|
258
|
-
166 passing (
|
259
|
+
166 passing (30s)
|
259
260
|
1 pending
|
261
|
+
1 failing
|
262
|
+
|
263
|
+
1) #Import
|
264
|
+
should read a folder and import text and binary files:
|
265
|
+
|
266
|
+
AssertionError: expected 'Invalid count value' to equal 'Imported files:'
|
267
|
+
+ expected - actual
|
268
|
+
|
269
|
+
-Invalid count value
|
270
|
+
+Imported files:
|
271
|
+
|
272
|
+
at assertConsole (/Users/francescosullo/Projects/Secrez/secrez/packages/test-helpers/src/index.js:121:16)
|
273
|
+
at Context.<anonymous> (test/commands/Import.test.js:331:5)
|
274
|
+
|
275
|
+
|
260
276
|
|
261
277
|
-----------------------|---------|----------|---------|---------|-----------------------------------
|
262
278
|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
263
279
|
-----------------------|---------|----------|---------|---------|-----------------------------------
|
264
|
-
All files | 71.
|
280
|
+
All files | 71.26 | 58.57 | 71.25 | 71.15 |
|
265
281
|
src | 59.63 | 54.79 | 55 | 60.19 |
|
266
282
|
Command.js | 79.66 | 78.72 | 76.92 | 81.03 | 32,55-62,73,80,119
|
267
283
|
PreCommand.js | 21.95 | 11.54 | 14.29 | 21.95 | 8-99,116
|
268
284
|
cliConfig.js | 100 | 100 | 100 | 100 |
|
269
|
-
src/commands | 81.
|
285
|
+
src/commands | 81.57 | 67.18 | 89.95 | 81.43 |
|
270
286
|
Alias.js | 90.54 | 77.36 | 100 | 90.41 | 101,112,139,169,173,180,190
|
271
287
|
Bash.js | 75 | 0 | 66.67 | 75 | 18-19
|
272
288
|
Cat.js | 98.9 | 88.89 | 100 | 98.9 | 152
|
@@ -278,7 +294,7 @@ All files | 71.22 | 58.41 | 71.25 | 71.11 |
|
|
278
294
|
Courier.js | 63.54 | 41.86 | 85.71 | 63.83 | ...37,152-171,188,200-203,215-221
|
279
295
|
Ds.js | 92.54 | 82.05 | 100 | 92.42 | 99,108-113,125
|
280
296
|
Edit.js | 13.58 | 0 | 40 | 13.58 | 88-214
|
281
|
-
Export.js |
|
297
|
+
Export.js | 88.12 | 70.59 | 100 | 88.12 | ...75,185,197-201,206,218,227,230
|
282
298
|
Find.js | 93.59 | 86.67 | 100 | 93.42 | 101,164,200-203,209
|
283
299
|
Help.js | 100 | 80 | 100 | 100 | 29
|
284
300
|
Import.js | 93.2 | 85.48 | 100 | 93.14 | ...65,367,387,393,441,456-463,490
|
@@ -327,3 +343,4 @@ All files | 71.22 | 58.41 | 71.25 | 71.11 |
|
|
327
343
|
HelpProto.js | 91.6 | 84.06 | 100 | 91.45 | 49,153-154,171-176,195
|
328
344
|
Logger.js | 63.64 | 56.25 | 36.84 | 62.79 | ...37-49,57,65-69,74,84,88,93,105
|
329
345
|
-----------------------|---------|----------|---------|---------|-----------------------------------
|
346
|
+
βELIFECYCLEβ Test failed. See above for more details.
|
package/package.json
CHANGED
package/src/commands/Export.js
CHANGED
@@ -66,6 +66,11 @@ class Export extends require("../Command") {
|
|
66
66
|
alias: "k",
|
67
67
|
type: Boolean,
|
68
68
|
},
|
69
|
+
{
|
70
|
+
name: "crypto-env",
|
71
|
+
alias: "C",
|
72
|
+
type: Boolean,
|
73
|
+
},
|
69
74
|
];
|
70
75
|
}
|
71
76
|
|
@@ -106,6 +111,10 @@ class Export extends require("../Command") {
|
|
106
111
|
"export my-wallet.yml -k",
|
107
112
|
"it will export a private key from the entry to a keystore file. The fill will be named as the entry replacing the extension with '.keystore.json'. If in the entry there are more than one private_key, it will ask which one to export. If no '--password' is specified, it will ask for a password to encrypt the keystore file. The entry must be a valid card, with at least one 'private_key' field.",
|
108
113
|
],
|
114
|
+
[
|
115
|
+
"export my-wallet.yml --crypto-env",
|
116
|
+
"it works like with keystore files, but it will export to file with .crypto.env extension ready to be used with @secrez/cryptoenv. Notice that the option -k has priority over -C.",
|
117
|
+
],
|
109
118
|
],
|
110
119
|
};
|
111
120
|
}
|
@@ -140,7 +149,7 @@ class Export extends require("../Command") {
|
|
140
149
|
if (Node.isBinary(entry) && typeof content === "string") {
|
141
150
|
content = Crypto.bs64.decode(content);
|
142
151
|
}
|
143
|
-
if (options.keystore) {
|
152
|
+
if (options.keystore || options.cryptoEnv) {
|
144
153
|
let card;
|
145
154
|
try {
|
146
155
|
card = yamlParse(content);
|
@@ -165,17 +174,23 @@ class Export extends require("../Command") {
|
|
165
174
|
});
|
166
175
|
privateKey = card[pk];
|
167
176
|
}
|
177
|
+
let fileType = options.keystore ? "keystore" : "crypto-env";
|
168
178
|
let pwd =
|
169
179
|
options.password ||
|
170
180
|
(await this.useInput({
|
171
181
|
type: "password",
|
172
|
-
message:
|
182
|
+
message: `Type the password to encrypt the ${fileType} file`,
|
173
183
|
}));
|
174
184
|
if (!pwd) {
|
175
185
|
throw new Error("Operation canceled");
|
176
186
|
}
|
177
|
-
|
178
|
-
|
187
|
+
if (options.keystore) {
|
188
|
+
content = await encryptPrivateKeyAsKeystoreJson(privateKey, pwd);
|
189
|
+
name = name.replace(/\.[^.]+$/, ".keystore.json");
|
190
|
+
} else {
|
191
|
+
content = await Crypto.encrypt(privateKey, Crypto.SHA3(pwd));
|
192
|
+
name = name.replace(/\.[^.]+$/, ".crypto.env");
|
193
|
+
}
|
179
194
|
} else if (options.encrypt) {
|
180
195
|
const myPublicKey = this.secrez.getPublicKey();
|
181
196
|
if (options.publicKeys) {
|