From fdb9b103530d21e7f7bbbde0dda0f21d5b851293 Mon Sep 17 00:00:00 2001 From: Boris Baskovec Date: Fri, 3 Nov 2023 12:25:43 +0100 Subject: [PATCH] Add node-vault library --- packages/bruno-js/package.json | 3 ++- packages/bruno-js/src/runtime/script-runtime.js | 7 +++++-- packages/bruno-js/src/runtime/test-runtime.js | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/bruno-js/package.json b/packages/bruno-js/package.json index d8161c9e..b6a83c07 100644 --- a/packages/bruno-js/package.json +++ b/packages/bruno-js/package.json @@ -28,6 +28,7 @@ "moment": "^2.29.4", "nanoid": "3.3.4", "node-fetch": "2.*", - "uuid": "^9.0.0" + "uuid": "^9.0.0", + "node-vault": "^0.10.2" } } diff --git a/packages/bruno-js/src/runtime/script-runtime.js b/packages/bruno-js/src/runtime/script-runtime.js index a39e00a5..f8776851 100644 --- a/packages/bruno-js/src/runtime/script-runtime.js +++ b/packages/bruno-js/src/runtime/script-runtime.js @@ -26,6 +26,7 @@ const axios = require('axios'); const fetch = require('node-fetch'); const chai = require('chai'); const CryptoJS = require('crypto-js'); +const NodeVault = require('node-vault'); class ScriptRuntime { constructor() {} @@ -112,7 +113,8 @@ class ScriptRuntime { 'node-fetch': fetch, 'crypto-js': CryptoJS, ...whitelistedModules, - fs: allowScriptFilesystemAccess ? fs : undefined + fs: allowScriptFilesystemAccess ? fs : undefined, + 'node-vault': NodeVault } } }); @@ -201,7 +203,8 @@ class ScriptRuntime { 'node-fetch': fetch, 'crypto-js': CryptoJS, ...whitelistedModules, - fs: allowScriptFilesystemAccess ? fs : undefined + fs: allowScriptFilesystemAccess ? fs : undefined, + 'node-vault': NodeVault } } }); diff --git a/packages/bruno-js/src/runtime/test-runtime.js b/packages/bruno-js/src/runtime/test-runtime.js index fcaa750c..cc46fd14 100644 --- a/packages/bruno-js/src/runtime/test-runtime.js +++ b/packages/bruno-js/src/runtime/test-runtime.js @@ -28,6 +28,7 @@ const nanoid = require('nanoid'); const axios = require('axios'); const fetch = require('node-fetch'); const CryptoJS = require('crypto-js'); +const NodeVault = require('node-vault'); class TestRuntime { constructor() {} @@ -130,7 +131,8 @@ class TestRuntime { 'node-fetch': fetch, 'crypto-js': CryptoJS, ...whitelistedModules, - fs: allowScriptFilesystemAccess ? fs : undefined + fs: allowScriptFilesystemAccess ? fs : undefined, + 'node-vault': NodeVault } } });