sdc-cli 1.0.1 → 1.0.3

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.
Files changed (3) hide show
  1. package/askpass.js +1 -5
  2. package/cli.js +5 -2
  3. package/package.json +1 -1
package/askpass.js CHANGED
@@ -84,8 +84,4 @@ async function main() {
84
84
  }
85
85
  }
86
86
 
87
- if (import.meta.url === `file://${process.argv[1]}`) {
88
- main();
89
- }
90
-
91
- export { askPassword };
87
+ main();
package/cli.js CHANGED
@@ -69,11 +69,11 @@ class CryptCLI {
69
69
 
70
70
  async getPassword(options, purpose = 'password') {
71
71
  // If password is provided via command line
72
- if (options.password) {
72
+ if (typeof options.password !== 'undefined') {
73
73
  //process.stderr.write(`Warning: Using password from command line is not secure\n`);
74
74
  return options.password;
75
75
  }
76
-
76
+
77
77
  // If password file is specified
78
78
  if (options.passwordFile) {
79
79
  try {
@@ -214,6 +214,9 @@ class CryptCLI {
214
214
  ]);
215
215
 
216
216
  const password = await this.getPassword(options, 'password');
217
+ if (password === '') {
218
+ process.stderr.write('Warning: Using empty passwords is dangerous')
219
+ }
217
220
  const encrypted = await encrypt_data(answers.inputData, password);
218
221
 
219
222
  if (outputFile) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdc-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "A useful CLI in Node.js to use simple-data-crypto library",
5
5
  "keywords": [
6
6
  "encryption",