vvauth 0.1.1 → 0.1.2

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 (2) hide show
  1. package/index.js +4 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -14,9 +14,11 @@ const SSHAgent = require('ssh-agent-js/client');
14
14
  const trim = require('mout/string/trim');
15
15
  const get = require('mout/object/get');
16
16
  const eachLimit = require('nyks/async/eachLimit');
17
+ const walk = require('nyks/object/walk');
17
18
 
18
19
  const request = require('nyks/http/request');
19
20
  const drain = require('nyks/stream/drain');
21
+ const replaceEnv = require('nyks/string/replaceEnv');
20
22
 
21
23
  const debug = require('debug');
22
24
 
@@ -39,7 +41,7 @@ class vvauth {
39
41
  } else {
40
42
  if(fs.existsSync(VAUTH_RC)) {
41
43
  let body = fs.readFileSync(VAUTH_RC, 'utf8');
42
- this.rc = parse(body);
44
+ this.rc = walk(parse(body), v => replaceEnv(v, { env : process.env}));
43
45
  }
44
46
  }
45
47
  }
@@ -72,6 +74,7 @@ class vvauth {
72
74
  if(publish) {
73
75
  let env = {VAULT_TOKEN};
74
76
  this._publish_env(env);
77
+ process.exit();
75
78
  }
76
79
  return VAULT_TOKEN;
77
80
  }
@@ -83,7 +86,6 @@ class vvauth {
83
86
  cmds.push(`echo export ${k}=[redacted] >&2`);
84
87
  }
85
88
  process.stdout.write(cmds.join("\n") + "\n");
86
- process.exit();
87
89
  }
88
90
 
89
91
  async _login_vault_ssh({vault_addr, path = 'ssh', role}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vvauth",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Vault Auth helper",
5
5
  "main": "index.js",
6
6
  "bin": {