@fsg-vault/agent 1.0.11 → 1.0.12

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/dist/cli.js CHANGED
@@ -39,7 +39,7 @@ const child_process_1 = require("child_process");
39
39
  const path = __importStar(require("path"));
40
40
  const program = new commander_1.Command();
41
41
  program
42
- .version('1.0.11')
42
+ .version('1.0.12')
43
43
  .description('FSG-Vault Agent: Secure Environment Injection')
44
44
  .requiredOption('-k, --key <string>', 'Master Key to decrypt the vault')
45
45
  .requiredOption('-a, --api-key <string>', 'API Key to authenticate with the vault server')
@@ -51,7 +51,7 @@ program
51
51
  program.parse(process.argv);
52
52
  const options = program.opts();
53
53
  const [command, ...args] = program.args;
54
- const VERSION = '1.0.11';
54
+ const VERSION = '1.0.12';
55
55
  const BANNER = String.raw `
56
56
  ________ ________ ________ ___ ___ ________ ___ ___ ___ _________
57
57
  |\ _____\\ ____\|\ ____\ |\ \ / /|\ __ \|\ \|\ \|\ \ |\___ ___\
@@ -111,7 +111,7 @@ async function run() {
111
111
  console.log('\x1b[34m[3/3]\x1b[0m Injecting Secure Memory Proxy...');
112
112
  if (command === 'node') {
113
113
  const child = (0, child_process_1.spawn)(process.execPath, [
114
- '--require', __dirname + '/proxy-register.js',
114
+ '--require', path.join(__dirname, 'proxy-register.js'),
115
115
  ...args
116
116
  ], {
117
117
  stdio: 'inherit',
@@ -125,7 +125,34 @@ async function run() {
125
125
  child.on('exit', code => process.exit(code || 0));
126
126
  }
127
127
  else {
128
- console.error("Currently fsg-vault only supports wrapping 'node' programs via require hooks.");
128
+ // Fallback for non-node programs (e.g. python, binary)
129
+ try {
130
+ const { decryptEnv } = require('./proxy');
131
+ const decryptedPlaintext = decryptEnv(ciphertext, iv, options.key);
132
+ const extraEnv = {};
133
+ const lines = decryptedPlaintext.split('\n');
134
+ for (const line of lines) {
135
+ if (!line || !line.includes('='))
136
+ continue;
137
+ const [key, ...valueParts] = line.split('=');
138
+ extraEnv[key.trim()] = valueParts.join('=').trim();
139
+ }
140
+ console.log('\x1b[35m%s\x1b[0m', '🛡️ Standard Environment Injection Active');
141
+ console.log('\x1b[90m%s\x1b[0m', '------------------------------------------------');
142
+ const child = (0, child_process_1.spawn)(command, args, {
143
+ stdio: 'inherit',
144
+ env: {
145
+ ...process.env,
146
+ ...extraEnv
147
+ },
148
+ shell: true
149
+ });
150
+ child.on('exit', code => process.exit(code || 0));
151
+ }
152
+ catch (err) {
153
+ console.error('\x1b[31m[ERROR]\x1b[0m Fallback execution failed:', err.message);
154
+ process.exit(1);
155
+ }
129
156
  }
130
157
  }
131
158
  run().catch(console.error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fsg-vault/agent",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "FSG Vault Agent CLI",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {