mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-24 05:51:22 +02:00
feat(#306): module whitelisting support
This commit is contained in:
parent
e3679c9ee9
commit
8f1f41374c
98
package-lock.json
generated
98
package-lock.json
generated
@ -16779,7 +16779,7 @@
|
|||||||
"version": "0.12.0",
|
"version": "0.12.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@usebruno/js": "0.6.0",
|
"@usebruno/js": "0.8.0",
|
||||||
"@usebruno/lang": "0.5.0",
|
"@usebruno/lang": "0.5.0",
|
||||||
"axios": "^1.5.1",
|
"axios": "^1.5.1",
|
||||||
"chai": "^4.3.7",
|
"chai": "^4.3.7",
|
||||||
@ -16788,6 +16788,8 @@
|
|||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"fs-extra": "^10.1.0",
|
"fs-extra": "^10.1.0",
|
||||||
"handlebars": "^4.7.8",
|
"handlebars": "^4.7.8",
|
||||||
|
"http-proxy-agent": "^7.0.0",
|
||||||
|
"https-proxy-agent": "^7.0.2",
|
||||||
"inquirer": "^9.1.4",
|
"inquirer": "^9.1.4",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mustache": "^4.2.0",
|
"mustache": "^4.2.0",
|
||||||
@ -16798,6 +16800,17 @@
|
|||||||
"bru": "bin/bru.js"
|
"bru": "bin/bru.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"packages/bruno-cli/node_modules/agent-base": {
|
||||||
|
"version": "7.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz",
|
||||||
|
"integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==",
|
||||||
|
"dependencies": {
|
||||||
|
"debug": "^4.3.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 14"
|
||||||
|
}
|
||||||
|
},
|
||||||
"packages/bruno-cli/node_modules/axios": {
|
"packages/bruno-cli/node_modules/axios": {
|
||||||
"version": "1.5.1",
|
"version": "1.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz",
|
||||||
@ -16820,11 +16833,35 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"packages/bruno-cli/node_modules/http-proxy-agent": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"agent-base": "^7.1.0",
|
||||||
|
"debug": "^4.3.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 14"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"packages/bruno-cli/node_modules/https-proxy-agent": {
|
||||||
|
"version": "7.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz",
|
||||||
|
"integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==",
|
||||||
|
"dependencies": {
|
||||||
|
"agent-base": "^7.0.2",
|
||||||
|
"debug": "4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 14"
|
||||||
|
}
|
||||||
|
},
|
||||||
"packages/bruno-electron": {
|
"packages/bruno-electron": {
|
||||||
"name": "bruno",
|
"name": "bruno",
|
||||||
"version": "v0.20.0",
|
"version": "v0.20.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@usebruno/js": "0.6.0",
|
"@usebruno/js": "0.8.0",
|
||||||
"@usebruno/lang": "0.5.0",
|
"@usebruno/lang": "0.5.0",
|
||||||
"@usebruno/schema": "0.5.0",
|
"@usebruno/schema": "0.5.0",
|
||||||
"about-window": "^1.15.2",
|
"about-window": "^1.15.2",
|
||||||
@ -16841,6 +16878,7 @@
|
|||||||
"fs-extra": "^10.1.0",
|
"fs-extra": "^10.1.0",
|
||||||
"graphql": "^16.6.0",
|
"graphql": "^16.6.0",
|
||||||
"handlebars": "^4.7.8",
|
"handlebars": "^4.7.8",
|
||||||
|
"http-proxy-agent": "^7.0.0",
|
||||||
"https-proxy-agent": "^7.0.2",
|
"https-proxy-agent": "^7.0.2",
|
||||||
"is-valid-path": "^0.1.1",
|
"is-valid-path": "^0.1.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
@ -16950,6 +16988,18 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"packages/bruno-electron/node_modules/http-proxy-agent": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"agent-base": "^7.1.0",
|
||||||
|
"debug": "^4.3.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 14"
|
||||||
|
}
|
||||||
|
},
|
||||||
"packages/bruno-electron/node_modules/https-proxy-agent": {
|
"packages/bruno-electron/node_modules/https-proxy-agent": {
|
||||||
"version": "7.0.2",
|
"version": "7.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz",
|
||||||
@ -17006,7 +17056,7 @@
|
|||||||
},
|
},
|
||||||
"packages/bruno-js": {
|
"packages/bruno-js": {
|
||||||
"name": "@usebruno/js",
|
"name": "@usebruno/js",
|
||||||
"version": "0.6.0",
|
"version": "0.8.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@usebruno/query": "0.1.0",
|
"@usebruno/query": "0.1.0",
|
||||||
@ -20102,7 +20152,7 @@
|
|||||||
"@usebruno/cli": {
|
"@usebruno/cli": {
|
||||||
"version": "file:packages/bruno-cli",
|
"version": "file:packages/bruno-cli",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@usebruno/js": "0.6.0",
|
"@usebruno/js": "0.8.0",
|
||||||
"@usebruno/lang": "0.5.0",
|
"@usebruno/lang": "0.5.0",
|
||||||
"axios": "^1.5.1",
|
"axios": "^1.5.1",
|
||||||
"chai": "^4.3.7",
|
"chai": "^4.3.7",
|
||||||
@ -20111,6 +20161,8 @@
|
|||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"fs-extra": "^10.1.0",
|
"fs-extra": "^10.1.0",
|
||||||
"handlebars": "^4.7.8",
|
"handlebars": "^4.7.8",
|
||||||
|
"http-proxy-agent": "^7.0.0",
|
||||||
|
"https-proxy-agent": "^7.0.2",
|
||||||
"inquirer": "^9.1.4",
|
"inquirer": "^9.1.4",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mustache": "^4.2.0",
|
"mustache": "^4.2.0",
|
||||||
@ -20118,6 +20170,14 @@
|
|||||||
"yargs": "^17.6.2"
|
"yargs": "^17.6.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"agent-base": {
|
||||||
|
"version": "7.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz",
|
||||||
|
"integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==",
|
||||||
|
"requires": {
|
||||||
|
"debug": "^4.3.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"axios": {
|
"axios": {
|
||||||
"version": "1.5.1",
|
"version": "1.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz",
|
||||||
@ -20136,6 +20196,24 @@
|
|||||||
"ansi-styles": "^4.1.0",
|
"ansi-styles": "^4.1.0",
|
||||||
"supports-color": "^7.1.0"
|
"supports-color": "^7.1.0"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"http-proxy-agent": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==",
|
||||||
|
"requires": {
|
||||||
|
"agent-base": "^7.1.0",
|
||||||
|
"debug": "^4.3.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"https-proxy-agent": {
|
||||||
|
"version": "7.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz",
|
||||||
|
"integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==",
|
||||||
|
"requires": {
|
||||||
|
"agent-base": "^7.0.2",
|
||||||
|
"debug": "4"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -21210,7 +21288,7 @@
|
|||||||
"bruno": {
|
"bruno": {
|
||||||
"version": "file:packages/bruno-electron",
|
"version": "file:packages/bruno-electron",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@usebruno/js": "0.6.0",
|
"@usebruno/js": "0.8.0",
|
||||||
"@usebruno/lang": "0.5.0",
|
"@usebruno/lang": "0.5.0",
|
||||||
"@usebruno/schema": "0.5.0",
|
"@usebruno/schema": "0.5.0",
|
||||||
"about-window": "^1.15.2",
|
"about-window": "^1.15.2",
|
||||||
@ -21231,6 +21309,7 @@
|
|||||||
"fs-extra": "^10.1.0",
|
"fs-extra": "^10.1.0",
|
||||||
"graphql": "^16.6.0",
|
"graphql": "^16.6.0",
|
||||||
"handlebars": "^4.7.8",
|
"handlebars": "^4.7.8",
|
||||||
|
"http-proxy-agent": "^7.0.0",
|
||||||
"https-proxy-agent": "^7.0.2",
|
"https-proxy-agent": "^7.0.2",
|
||||||
"is-valid-path": "^0.1.1",
|
"is-valid-path": "^0.1.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
@ -21300,6 +21379,15 @@
|
|||||||
"pump": "^3.0.0"
|
"pump": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"http-proxy-agent": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==",
|
||||||
|
"requires": {
|
||||||
|
"agent-base": "^7.1.0",
|
||||||
|
"debug": "^4.3.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"https-proxy-agent": {
|
"https-proxy-agent": {
|
||||||
"version": "7.0.2",
|
"version": "7.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz",
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
"package.json"
|
"package.json"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@usebruno/js": "0.6.0",
|
"@usebruno/js": "0.8.0",
|
||||||
"@usebruno/lang": "0.5.0",
|
"@usebruno/lang": "0.5.0",
|
||||||
"axios": "^1.5.1",
|
"axios": "^1.5.1",
|
||||||
"chai": "^4.3.7",
|
"chai": "^4.3.7",
|
||||||
|
@ -29,7 +29,7 @@ const runSingleRequest = async function (
|
|||||||
|
|
||||||
request = prepareRequest(bruJson.request);
|
request = prepareRequest(bruJson.request);
|
||||||
|
|
||||||
const allowScriptFilesystemAccess = get(brunoConfig, 'filesystemAccess.allow', false);
|
const scriptingConfig = get(brunoConfig, 'scripts', {});
|
||||||
|
|
||||||
// make axios work in node using form data
|
// make axios work in node using form data
|
||||||
// reference: https://github.com/axios/axios/issues/1006#issuecomment-320165427
|
// reference: https://github.com/axios/axios/issues/1006#issuecomment-320165427
|
||||||
@ -68,7 +68,7 @@ const runSingleRequest = async function (
|
|||||||
collectionPath,
|
collectionPath,
|
||||||
null,
|
null,
|
||||||
processEnvVars,
|
processEnvVars,
|
||||||
allowScriptFilesystemAccess
|
scriptingConfig
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ const runSingleRequest = async function (
|
|||||||
collectionPath,
|
collectionPath,
|
||||||
null,
|
null,
|
||||||
processEnvVars,
|
processEnvVars,
|
||||||
allowScriptFilesystemAccess
|
scriptingConfig
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ const runSingleRequest = async function (
|
|||||||
collectionPath,
|
collectionPath,
|
||||||
null,
|
null,
|
||||||
processEnvVars,
|
processEnvVars,
|
||||||
allowScriptFilesystemAccess
|
scriptingConfig
|
||||||
);
|
);
|
||||||
testResults = get(result, 'results', []);
|
testResults = get(result, 'results', []);
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@usebruno/js": "0.6.0",
|
"@usebruno/js": "0.8.0",
|
||||||
"@usebruno/lang": "0.5.0",
|
"@usebruno/lang": "0.5.0",
|
||||||
"@usebruno/schema": "0.5.0",
|
"@usebruno/schema": "0.5.0",
|
||||||
"about-window": "^1.15.2",
|
"about-window": "^1.15.2",
|
||||||
|
@ -109,7 +109,7 @@ const registerNetworkIpc = (mainWindow) => {
|
|||||||
const envVars = getEnvVars(environment);
|
const envVars = getEnvVars(environment);
|
||||||
const processEnvVars = getProcessEnvVars(collectionUid);
|
const processEnvVars = getProcessEnvVars(collectionUid);
|
||||||
const brunoConfig = getBrunoConfig(collectionUid);
|
const brunoConfig = getBrunoConfig(collectionUid);
|
||||||
const allowScriptFilesystemAccess = get(brunoConfig, 'filesystemAccess.allow', false);
|
const scriptingConfig = get(brunoConfig, 'scripts', {});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// make axios work in node using form data
|
// make axios work in node using form data
|
||||||
@ -162,7 +162,7 @@ const registerNetworkIpc = (mainWindow) => {
|
|||||||
collectionPath,
|
collectionPath,
|
||||||
onConsoleLog,
|
onConsoleLog,
|
||||||
processEnvVars,
|
processEnvVars,
|
||||||
allowScriptFilesystemAccess
|
scriptingConfig
|
||||||
);
|
);
|
||||||
|
|
||||||
mainWindow.webContents.send('main:script-environment-update', {
|
mainWindow.webContents.send('main:script-environment-update', {
|
||||||
@ -296,7 +296,7 @@ const registerNetworkIpc = (mainWindow) => {
|
|||||||
collectionPath,
|
collectionPath,
|
||||||
onConsoleLog,
|
onConsoleLog,
|
||||||
processEnvVars,
|
processEnvVars,
|
||||||
allowScriptFilesystemAccess
|
scriptingConfig
|
||||||
);
|
);
|
||||||
|
|
||||||
mainWindow.webContents.send('main:script-environment-update', {
|
mainWindow.webContents.send('main:script-environment-update', {
|
||||||
@ -342,7 +342,7 @@ const registerNetworkIpc = (mainWindow) => {
|
|||||||
collectionPath,
|
collectionPath,
|
||||||
onConsoleLog,
|
onConsoleLog,
|
||||||
processEnvVars,
|
processEnvVars,
|
||||||
allowScriptFilesystemAccess
|
scriptingConfig
|
||||||
);
|
);
|
||||||
|
|
||||||
mainWindow.webContents.send('main:run-request-event', {
|
mainWindow.webContents.send('main:run-request-event', {
|
||||||
@ -421,7 +421,7 @@ const registerNetworkIpc = (mainWindow) => {
|
|||||||
collectionPath,
|
collectionPath,
|
||||||
onConsoleLog,
|
onConsoleLog,
|
||||||
processEnvVars,
|
processEnvVars,
|
||||||
allowScriptFilesystemAccess
|
scriptingConfig
|
||||||
);
|
);
|
||||||
|
|
||||||
mainWindow.webContents.send('main:run-request-event', {
|
mainWindow.webContents.send('main:run-request-event', {
|
||||||
@ -514,7 +514,7 @@ const registerNetworkIpc = (mainWindow) => {
|
|||||||
const collectionPath = collection.pathname;
|
const collectionPath = collection.pathname;
|
||||||
const folderUid = folder ? folder.uid : null;
|
const folderUid = folder ? folder.uid : null;
|
||||||
const brunoConfig = getBrunoConfig(collectionUid);
|
const brunoConfig = getBrunoConfig(collectionUid);
|
||||||
const allowScriptFilesystemAccess = get(brunoConfig, 'filesystemAccess.allow', false);
|
const scriptingConfig = get(brunoConfig, 'scripts', {});
|
||||||
|
|
||||||
const onConsoleLog = (type, args) => {
|
const onConsoleLog = (type, args) => {
|
||||||
console[type](...args);
|
console[type](...args);
|
||||||
@ -621,7 +621,7 @@ const registerNetworkIpc = (mainWindow) => {
|
|||||||
collectionPath,
|
collectionPath,
|
||||||
onConsoleLog,
|
onConsoleLog,
|
||||||
processEnvVars,
|
processEnvVars,
|
||||||
allowScriptFilesystemAccess
|
scriptingConfig
|
||||||
);
|
);
|
||||||
|
|
||||||
mainWindow.webContents.send('main:script-environment-update', {
|
mainWindow.webContents.send('main:script-environment-update', {
|
||||||
@ -735,7 +735,7 @@ const registerNetworkIpc = (mainWindow) => {
|
|||||||
collectionPath,
|
collectionPath,
|
||||||
onConsoleLog,
|
onConsoleLog,
|
||||||
processEnvVars,
|
processEnvVars,
|
||||||
allowScriptFilesystemAccess
|
scriptingConfig
|
||||||
);
|
);
|
||||||
|
|
||||||
mainWindow.webContents.send('main:script-environment-update', {
|
mainWindow.webContents.send('main:script-environment-update', {
|
||||||
@ -779,7 +779,7 @@ const registerNetworkIpc = (mainWindow) => {
|
|||||||
collectionPath,
|
collectionPath,
|
||||||
onConsoleLog,
|
onConsoleLog,
|
||||||
processEnvVars,
|
processEnvVars,
|
||||||
allowScriptFilesystemAccess
|
scriptingConfig
|
||||||
);
|
);
|
||||||
|
|
||||||
mainWindow.webContents.send('main:run-folder-event', {
|
mainWindow.webContents.send('main:run-folder-event', {
|
||||||
@ -859,7 +859,7 @@ const registerNetworkIpc = (mainWindow) => {
|
|||||||
collectionPath,
|
collectionPath,
|
||||||
onConsoleLog,
|
onConsoleLog,
|
||||||
processEnvVars,
|
processEnvVars,
|
||||||
allowScriptFilesystemAccess
|
scriptingConfig
|
||||||
);
|
);
|
||||||
|
|
||||||
mainWindow.webContents.send('main:run-folder-event', {
|
mainWindow.webContents.send('main:run-folder-event', {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user