mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-02 17:08:32 +00:00
feat(#306): module whitelisting support
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
"package.json"
|
||||
],
|
||||
"dependencies": {
|
||||
"@usebruno/js": "0.6.0",
|
||||
"@usebruno/js": "0.8.0",
|
||||
"@usebruno/lang": "0.5.0",
|
||||
"axios": "^1.5.1",
|
||||
"chai": "^4.3.7",
|
||||
|
||||
@@ -29,7 +29,7 @@ const runSingleRequest = async function (
|
||||
|
||||
request = prepareRequest(bruJson.request);
|
||||
|
||||
const allowScriptFilesystemAccess = get(brunoConfig, 'filesystemAccess.allow', false);
|
||||
const scriptingConfig = get(brunoConfig, 'scripts', {});
|
||||
|
||||
// make axios work in node using form data
|
||||
// reference: https://github.com/axios/axios/issues/1006#issuecomment-320165427
|
||||
@@ -68,7 +68,7 @@ const runSingleRequest = async function (
|
||||
collectionPath,
|
||||
null,
|
||||
processEnvVars,
|
||||
allowScriptFilesystemAccess
|
||||
scriptingConfig
|
||||
);
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ const runSingleRequest = async function (
|
||||
collectionPath,
|
||||
null,
|
||||
processEnvVars,
|
||||
allowScriptFilesystemAccess
|
||||
scriptingConfig
|
||||
);
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ const runSingleRequest = async function (
|
||||
collectionPath,
|
||||
null,
|
||||
processEnvVars,
|
||||
allowScriptFilesystemAccess
|
||||
scriptingConfig
|
||||
);
|
||||
testResults = get(result, 'results', []);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"test": "jest"
|
||||
},
|
||||
"dependencies": {
|
||||
"@usebruno/js": "0.6.0",
|
||||
"@usebruno/js": "0.8.0",
|
||||
"@usebruno/lang": "0.5.0",
|
||||
"@usebruno/schema": "0.5.0",
|
||||
"about-window": "^1.15.2",
|
||||
|
||||
@@ -109,7 +109,7 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
const envVars = getEnvVars(environment);
|
||||
const processEnvVars = getProcessEnvVars(collectionUid);
|
||||
const brunoConfig = getBrunoConfig(collectionUid);
|
||||
const allowScriptFilesystemAccess = get(brunoConfig, 'filesystemAccess.allow', false);
|
||||
const scriptingConfig = get(brunoConfig, 'scripts', {});
|
||||
|
||||
try {
|
||||
// make axios work in node using form data
|
||||
@@ -162,7 +162,7 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
collectionPath,
|
||||
onConsoleLog,
|
||||
processEnvVars,
|
||||
allowScriptFilesystemAccess
|
||||
scriptingConfig
|
||||
);
|
||||
|
||||
mainWindow.webContents.send('main:script-environment-update', {
|
||||
@@ -296,7 +296,7 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
collectionPath,
|
||||
onConsoleLog,
|
||||
processEnvVars,
|
||||
allowScriptFilesystemAccess
|
||||
scriptingConfig
|
||||
);
|
||||
|
||||
mainWindow.webContents.send('main:script-environment-update', {
|
||||
@@ -342,7 +342,7 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
collectionPath,
|
||||
onConsoleLog,
|
||||
processEnvVars,
|
||||
allowScriptFilesystemAccess
|
||||
scriptingConfig
|
||||
);
|
||||
|
||||
mainWindow.webContents.send('main:run-request-event', {
|
||||
@@ -421,7 +421,7 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
collectionPath,
|
||||
onConsoleLog,
|
||||
processEnvVars,
|
||||
allowScriptFilesystemAccess
|
||||
scriptingConfig
|
||||
);
|
||||
|
||||
mainWindow.webContents.send('main:run-request-event', {
|
||||
@@ -514,7 +514,7 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
const collectionPath = collection.pathname;
|
||||
const folderUid = folder ? folder.uid : null;
|
||||
const brunoConfig = getBrunoConfig(collectionUid);
|
||||
const allowScriptFilesystemAccess = get(brunoConfig, 'filesystemAccess.allow', false);
|
||||
const scriptingConfig = get(brunoConfig, 'scripts', {});
|
||||
|
||||
const onConsoleLog = (type, args) => {
|
||||
console[type](...args);
|
||||
@@ -621,7 +621,7 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
collectionPath,
|
||||
onConsoleLog,
|
||||
processEnvVars,
|
||||
allowScriptFilesystemAccess
|
||||
scriptingConfig
|
||||
);
|
||||
|
||||
mainWindow.webContents.send('main:script-environment-update', {
|
||||
@@ -735,7 +735,7 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
collectionPath,
|
||||
onConsoleLog,
|
||||
processEnvVars,
|
||||
allowScriptFilesystemAccess
|
||||
scriptingConfig
|
||||
);
|
||||
|
||||
mainWindow.webContents.send('main:script-environment-update', {
|
||||
@@ -779,7 +779,7 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
collectionPath,
|
||||
onConsoleLog,
|
||||
processEnvVars,
|
||||
allowScriptFilesystemAccess
|
||||
scriptingConfig
|
||||
);
|
||||
|
||||
mainWindow.webContents.send('main:run-folder-event', {
|
||||
@@ -859,7 +859,7 @@ const registerNetworkIpc = (mainWindow) => {
|
||||
collectionPath,
|
||||
onConsoleLog,
|
||||
processEnvVars,
|
||||
allowScriptFilesystemAccess
|
||||
scriptingConfig
|
||||
);
|
||||
|
||||
mainWindow.webContents.send('main:run-folder-event', {
|
||||
|
||||
Reference in New Issue
Block a user