secrez 2.1.11-beta.0 → 2.1.12-beta.0

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 CHANGED
@@ -370,10 +370,6 @@ Secrez is not intended to compete with password managers, so do not expect it to
370
370
 
371
371
  ## History
372
372
 
373
- **2.1.11-beta.0**
374
-
375
- - fix warning "(node:70960) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities" caused by the Git checker
376
-
377
373
  **2.1.10**
378
374
 
379
375
  - add external git change detection to block operations when repository state changes outside of Secrez (e.g., `git pull` in another terminal)
@@ -886,8 +882,8 @@ Thank you for any contributions! 😉
886
882
  ## Test coverage
887
883
 
888
884
  ```
889
- 162 passing (1m)
890
- 1 pending
885
+ 162 passing (2m)
886
+ 2 pending
891
887
 
892
888
  --------------------|---------|----------|---------|---------|--------------------------------------
893
889
  File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
@@ -943,7 +939,7 @@ All files | 80.07 | 67.69 | 80.91 | 79.96 |
943
939
  Logger.js | 63.63 | 56.25 | 36.84 | 62.79 | ...25,37-49,57,65-69,74,84,88,93,105
944
940
  --------------------|---------|----------|---------|---------|--------------------------------------
945
941
 
946
- > secrez@2.1.11-beta.0 posttest /Users/francescosullo/Projects/Secrez/secrez/packages/secrez
942
+ > secrez@2.1.10 posttest /Users/francescosullo/Projects/Secrez/secrez/packages/secrez
947
943
  > nyc check-coverage --statements 65 --branches 50 --functions 65 --lines 65
948
944
 
949
945
 
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "secrez",
3
- "version": "2.1.11-beta.0",
3
+ "version": "2.1.12-beta.0",
4
4
  "license": "MIT",
5
5
  "nyc": {
6
6
  "include": "src",
7
7
  "exclude": []
8
8
  },
9
9
  "dependencies": {
10
- "@secrez/core": "~1.0.6",
11
- "@secrez/crypto": "~1.0.5",
12
- "@secrez/eth": "~0.0.5",
13
- "@secrez/fs": "~1.0.8",
14
- "@secrez/utils": "~1.0.5",
10
+ "@secrez/core": "~1.0.5",
11
+ "@secrez/crypto": "~1.0.4",
12
+ "@secrez/eth": "~0.0.4",
13
+ "@secrez/fs": "~1.0.7",
14
+ "@secrez/utils": "~1.0.4",
15
15
  "case": "^1.6.3",
16
16
  "chalk": "^3.0.0",
17
17
  "clipboardy": "^2.3.0",
@@ -65,6 +65,7 @@
65
65
  "test-only": "cross-env NODE_ENV=test ./node_modules/.bin/mocha test/*.test.js test/**/*.test.js test/**/**/*.js --exit",
66
66
  "test": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha test/*.test.js test/**/*.test.js test/**/**/*.js --exit",
67
67
  "posttest": "nyc check-coverage --statements 65 --branches 50 --functions 65 --lines 65",
68
- "build-helpers": "cd test/helpers/os && ./build.sh"
68
+ "build-helpers": "cd test/helpers/os && ./build.sh",
69
+ "preinstall": "scripts/pre-install.sh"
69
70
  }
70
71
  }
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Check if pnpm is installed
4
+ if ! command -v pnpm &> /dev/null; then
5
+ echo "pnpm not found, installing..."
6
+ npm i -g pnpm
7
+ #else
8
+ # echo "pnpm is already installed"
9
+ fi
10
+
11
+ set -e
12
+
13
+ if [[ "$npm_execpath" != *pnpm* ]]; then
14
+ echo -e "\033[1;31m\nThis project requires pnpm as a package manager.\n\033[0m"
15
+ exit 1
16
+ fi
package/coverage.report DELETED
@@ -1,302 +0,0 @@
1
-
2
- > secrez@2.1.11-beta.0 test /Users/francescosullo/Projects/Secrez/secrez/packages/secrez
3
- > cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha test/*.test.js test/**/*.test.js test/**/**/*.js --exit
4
-
5
-
6
-
7
- #Command
8
- #constructor
9
- ✓ should instantiate a Command object
10
- #getFileList
11
- ✓ should get the current internal folder dir
12
- ✓ should get the current external folder dir
13
- #help & #setHelpAndCompletion
14
- ✓ should do nothing
15
- #validate
16
- ✓ should validate the options
17
-
18
- #Alias
19
- ✓ should return the help
20
- ✓ create aliases and lists them
21
- ✓ rename and delete aliases
22
- ✓ should throw if there are errors
23
-
24
- #Cat
25
- ✓ should return the help
26
- ✓ should show the content of a file
27
- ✓ should show either one or all the versions of a file (1017ms)
28
- ✓ should throw if entry is not a file or file does not exist
29
- ✓ should throw if trying to cat a binary file
30
- ✓ should show the content of a Yaml file (1026ms)
31
-
32
- #Cd
33
- ✓ should return the help
34
- ✓ change to a folder
35
- ✓ return en error if changing to a file
36
-
37
- #Contacts
38
- ✓ should return the help
39
- ✓ create a contacts
40
- ✓ create contacts and get their public keys
41
- ✓ should list contacts
42
- ✓ should update a contact
43
- ✓ should rename a contacts
44
- ✓ should remove a contacts
45
- ✓ should throw if there are errors
46
-
47
- #Copy
48
- ✓ should return the help
49
- ✓ should copy a file to the clipboard (385ms)
50
- ✓ should copy a string to the clipboard (250ms)
51
- ✓ should copy a card to the clipboard (909ms)
52
- ✓ should return an error if the file does not exist or is a folder (39ms)
53
- ✓ should throw if copying to clipboard a binary files
54
-
55
- #Ds
56
- ✓ should return the help
57
- ✓ should list all datasets
58
- ✓ should create a new dataset
59
- ✓ should rename a dataset
60
- ✓ should delete a dataset
61
-
62
- #Export
63
- ✓ should return the help
64
- ✓ should export a file to the current local folder
65
- ✓ should export a file encrypted only for the user itself
66
- ✓ should export a binary file to the current local folder
67
- ✓ should export an encrypted file to the current local folder
68
- ✓ should export a file and delete it after 1 second (1204ms)
69
- ✓ should return an error if the file does not exist or is a folder
70
- ✓ should export a keystore json file if a private_key exists in the entry (645ms)
71
- ✓ should export a cryptoenv file if a private_key exists in the entry
72
- ✓ should export a cryptoenv file with entire content when no private_key fields exist and user confirms
73
- ✓ should throw error when no private_key fields exist and user declines
74
- ✓ should throw error when no private_key fields exist and keystore option is used
75
- ✓ should display encrypted content in console when using crypto-env with no-export
76
-
77
- #Find
78
- ✓ should return the help
79
- ✓ should show find a string in the tree (1020ms)
80
- ✓ should find no result without parameters
81
- ✓ should skip binary files from search
82
-
83
- #Git
84
- ✓ should return the help
85
- ✓ should show git status when --status is used (3120ms)
86
- ✓ should show git status by default (3325ms)
87
- ✓ should handle conflict risk scenario (5067ms)
88
- ✓ should handle non-git repository
89
- ✓ should allow normal operations in non-git repository
90
- Bye bye :o)
91
- ✓ should detect external git changes and block operations (14550ms)
92
-
93
- #Help
94
- ✓ should return the help
95
- ✓ #execAsync and format
96
- ✓ should throw if wrong command
97
- ✓ -- to complete coverage
98
-
99
- #Import
100
- ✓ should return the help
101
- ✓ should import a file in the current folder
102
- ✓ should import an encrypted file
103
- ✓ should import an encrypted file encrypted for myself
104
- ✓ should import an encrypted binary file and export it again verifying it is fine
105
- ✓ should import files recursively
106
- ✓ should read a folder and import the only text file
107
- ✓ should read a folder and import text and binary files
108
- ✓ should simulate the import of two files
109
- ✓ should move the imported file
110
- ✓ should import a backup from another software spanning the data among folders and files
111
- ✓ should import a backup from another software but saving the tags as tags
112
- ✓ should import a backup from another software using tags to prefix the paths
113
- ✓ should import using tags to prefix the paths, ignoring the tags
114
- ✓ should import from a LastPass-like csv setting the path from "grouping" and "name"
115
- ✓ should import from a json
116
- ✓ should throw importing a malformed backup
117
- ✓ should throw importing a CSV indicating wrong fields to generate the path
118
-
119
- #Lcat
120
- ✓ should return the help
121
- ✓ cat a file
122
- ✓ return en error if trying to cat a binary file
123
-
124
- #Lcd
125
- ✓ should return the help
126
- ✓ change to a folder
127
- ✓ return en error if changing to a file
128
-
129
- #Lls
130
- ✓ should return the help
131
- ✓ should list a folder
132
- ✓ return en error if lls-ing a not existing path
133
- ✓ return a message if no files are found
134
-
135
- #Lpwd
136
- ✓ should return the help
137
- ✓ change to a folder
138
-
139
- #Ls
140
- ✓ should return the help
141
- ✓ should return all the datasets
142
- ✓ should list folders and files
143
- ✓ should list folders and files using wildcards
144
-
145
- #Mkdir
146
- ✓ should return the help
147
- ✓ should create a folder
148
- ✓ should create a nested folder
149
- ✓ should throw if trying to create a child of a file
150
- ✓ should throw if wrong parameters
151
-
152
- #Mv
153
- ✓ should return the help
154
- ✓ should rename a file (1010ms)
155
- ✓ should move a file to another folder
156
- ✓ should move many files to another folder
157
- ✓ should move a file to another subfolder
158
- ✓ should move and rename file to another folder
159
- ✓ should move file to another folder using wildcards
160
- ✓ should move file to another dataset using wildcards
161
- ✓ should move file managing duplicates
162
- ✓ should throw if parameters are missed or wrong
163
- ✓ should move files from and to other datasets (1029ms)
164
- ✓ should move the results of a find
165
-
166
- #Paste
167
- ✓ should return the help
168
- ✓ should paste the clipboard content to a new file (39ms)
169
- ✓ should paste the clipboard content to an existent file (55ms)
170
- ✓ should paste a single field to a yml card
171
-
172
- #Pwd
173
- ✓ should return the help
174
- ✓ should show the working folder
175
-
176
- #Quit
177
- ✓ should show the content of an external file via bash
178
-
179
- #Rm
180
- ✓ should return the help
181
- ✓ should delete a file with one version
182
- ✓ should delete many files usign wildcards
183
- ✓ should return errors if wrong parameters
184
- ✓ should delete some versions of a file (1011ms)
185
-
186
- #Shell
187
- ✓ should return the help
188
- ✓ should show the content of an external file via shell
189
-
190
- #Show
191
- ✓ should return the help
192
- ✓ should show the field password of a card
193
-
194
- #Tag
195
- ✓ should return the help
196
- ✓ should tag a file
197
- ✓ should remove a tag
198
- ✓ should list all the tags
199
- ✓ should show the file tagged as
200
- ✓ should show very long file tagged as
201
-
202
- #Totp
203
- ✓ should return the help
204
- ✓ should totp a file to the clipboard (380ms)
205
- ✓ should read a totp secret from an image and add the totp field to the card
206
- ✓ should read a totp secret from an image and return the secret
207
- ✓ should throw if bad image
208
- ✓ should throw if missing parameters
209
- ✓ should throw if the yaml is malformed
210
- ✓ should read a totp secret from the clipboard (73ms)
211
-
212
- #Touch
213
- ✓ should return the help
214
- ✓ should create a file
215
- ✓ should create a file with content
216
- ✓ should duplicate a file
217
- ✓ should throw if trying to duplicate a non existing file
218
- ✓ should throw if trying to duplicate a folder
219
- ✓ should throw if trying to create a child of a file
220
- ✓ should throw if wrong parameters
221
- ✓ should create a file and generate a wallet
222
- New file "/folder2/file1" created.
223
- ✓ should generate 5 prefixed wallet (56ms)
224
- New file "/folder2/file1" created.
225
- ✓ should generate a wallet with mnemonic and 2 keys
226
-
227
- #Use
228
- ✓ should return the help
229
- ✓ should use a new dataset, creating it if does not exist
230
-
231
- #Ver
232
- ✓ should show the current version
233
-
234
- #Whoami
235
- ✓ should return the help
236
- ✓ should see who am I
237
-
238
- #Fido2Client
239
- #configuration
240
- - should verify that all the scripts exist
241
-
242
-
243
- 162 passing (1m)
244
- 1 pending
245
-
246
- --------------------|---------|----------|---------|---------|--------------------------------------
247
- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
248
- --------------------|---------|----------|---------|---------|--------------------------------------
249
- All files | 80.07 | 67.69 | 80.91 | 79.96 |
250
- src | 57.62 | 53.75 | 55 | 58.11 |
251
- Command.js | 74.66 | 74.13 | 78.57 | 75.67 | ...5-62,73,80,93,127,164-172,179-182
252
- PreCommand.js | 8.82 | 0 | 0 | 8.82 | 6-97
253
- cliConfig.js | 100 | 100 | 100 | 100 |
254
- src/commands | 83.06 | 69.43 | 90.82 | 82.94 |
255
- Alias.js | 88.6 | 78.68 | 100 | 88.46 | 101,112,139,169,173,180,190,213-214
256
- Bash.js | 75 | 0 | 66.66 | 75 | 18-19
257
- Cat.js | 98.91 | 88.88 | 100 | 98.91 | 152
258
- Cd.js | 96.42 | 86.66 | 100 | 96.42 | 44
259
- Conf.js | 8.64 | 0 | 20 | 8.64 | 98-509
260
- Contacts.js | 86.06 | 75.6 | 100 | 85.95 | ...5,165,172,184,237,250,260,268-269
261
- Copy.js | 91.2 | 71.92 | 100 | 91.11 | 115,166,183,205-210,225-226,253
262
- Ds.js | 90.27 | 82.6 | 100 | 90.14 | 99,108-113,125,147-148
263
- Edit.js | 12.94 | 0 | 40 | 12.94 | 88-222
264
- Export.js | 90.17 | 76.92 | 100 | 90.17 | ...3-198,209,227-231,236,248,257,260
265
- Find.js | 93.58 | 86.66 | 100 | 93.42 | 101,164,200-203,209
266
- Git.js | 96.15 | 75 | 100 | 96.15 | 61
267
- Help.js | 100 | 80 | 100 | 100 | 29
268
- Import.js | 92.41 | 85.38 | 100 | 92.34 | ...7,387,393,441,457-458,466-473,500
269
- Lcat.js | 100 | 85.71 | 100 | 100 | 54
270
- Lcd.js | 95.65 | 81.81 | 100 | 95.65 | 50
271
- Lls.js | 95.45 | 72.72 | 100 | 95.45 | 97
272
- Lpwd.js | 92.3 | 100 | 100 | 92.3 | 36
273
- Ls.js | 91.54 | 76.31 | 100 | 91.04 | 103,114-116,130,185
274
- Mkdir.js | 92.59 | 60 | 100 | 92.59 | 56-57
275
- Mv.js | 86.59 | 71.66 | 100 | 86.31 | 93-99,133,155-156,165,175-182
276
- Paste.js | 84.61 | 70.83 | 100 | 84.61 | 72,78,81,89,113,130-131,139
277
- Pwd.js | 92.3 | 100 | 100 | 92.3 | 33
278
- Quit.js | 90 | 50 | 100 | 90 | 27
279
- Rm.js | 90.9 | 76 | 100 | 90.74 | 63,125-126,136,144
280
- Shell.js | 88.23 | 60 | 100 | 88.23 | 38,55
281
- Show.js | 72.54 | 45.45 | 57.14 | 74 | ...8,100,106-114,117,123-126,132,145
282
- Ssh.js | 25 | 0 | 40 | 25 | 72-120
283
- Tag.js | 96.26 | 91.37 | 100 | 96.22 | 122,171,204-205
284
- Totp.js | 92.23 | 75 | 100 | 92.23 | 189-190,230,240,282-287,301-302
285
- Touch.js | 96.36 | 80.64 | 100 | 96.29 | 164,240
286
- Use.js | 91.66 | 86.95 | 100 | 91.66 | 68,83-84
287
- Ver.js | 90 | 66.66 | 100 | 90 | 25
288
- Whoami.js | 83.33 | 60 | 80 | 83.33 | 27,35,48
289
- index.js | 87.5 | 50 | 100 | 86.95 | 15,22,31
290
- src/prompts | 75 | 33.33 | 50 | 75 |
291
- MainPromptMock.js | 75 | 33.33 | 50 | 75 | 29-35,44
292
- src/utils | 67.61 | 62.5 | 54.16 | 67.21 |
293
- AliasManager.js | 100 | 91.66 | 100 | 100 | 47
294
- ContactManager.js | 73.33 | 60 | 85.71 | 73.33 | 12,34-36
295
- Fido2Client.js | 9.61 | 0 | 0 | 9.61 | 8-108
296
- HelpProto.js | 89.07 | 82.6 | 100 | 88.88 | 49,135-137,153-154,171-176,195
297
- Logger.js | 63.63 | 56.25 | 36.84 | 62.79 | ...25,37-49,57,65-69,74,84,88,93,105
298
- --------------------|---------|----------|---------|---------|--------------------------------------
299
-
300
- > secrez@2.1.11-beta.0 posttest /Users/francescosullo/Projects/Secrez/secrez/packages/secrez
301
- > nyc check-coverage --statements 65 --branches 50 --functions 65 --lines 65
302
-