mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
remove allowScriptFilesystemAccess flag (#6834)
This commit is contained in:
@@ -5,10 +5,5 @@
|
||||
"ignore": [
|
||||
"node_modules",
|
||||
".git"
|
||||
],
|
||||
"scripts": {
|
||||
"filesystemAccess": {
|
||||
"allow": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"version": "1",
|
||||
"name": "should_disallow_fs",
|
||||
"type": "collection",
|
||||
"ignore": [
|
||||
"node_modules",
|
||||
".git"
|
||||
],
|
||||
"scripts": {
|
||||
"filesystemAccess": {
|
||||
"allow": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
meta {
|
||||
name: request
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: https://echo.usebruno.com
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
script:pre-request {
|
||||
const fs = require('fs');
|
||||
}
|
||||
@@ -2,79 +2,39 @@ import { test } from '../../../../playwright';
|
||||
import { setSandboxMode, runCollection, validateRunnerResults } from '../../../utils/page';
|
||||
|
||||
test.describe.serial('`fs` library', () => {
|
||||
test.describe('should allow `fs` library', () => {
|
||||
test('developer mode', async ({ pageWithUserData: page }) => {
|
||||
test.setTimeout(2 * 60 * 1000);
|
||||
test('developer mode allows fs', async ({ pageWithUserData: page }) => {
|
||||
test.setTimeout(2 * 60 * 1000);
|
||||
|
||||
// Set up developer mode
|
||||
await setSandboxMode(page, 'should_allow_fs', 'developer');
|
||||
// Set up developer mode
|
||||
await setSandboxMode(page, 'should_allow_fs', 'developer');
|
||||
|
||||
// Run the collection
|
||||
await runCollection(page, 'should_allow_fs');
|
||||
// Run the collection
|
||||
await runCollection(page, 'should_allow_fs');
|
||||
|
||||
// Validate test results
|
||||
await validateRunnerResults(page, {
|
||||
totalRequests: 1,
|
||||
passed: 1,
|
||||
failed: 0,
|
||||
skipped: 0
|
||||
});
|
||||
});
|
||||
|
||||
test('safe mode', async ({ pageWithUserData: page }) => {
|
||||
test.setTimeout(2 * 60 * 1000);
|
||||
|
||||
// Set up safe mode
|
||||
await setSandboxMode(page, 'should_allow_fs', 'safe');
|
||||
|
||||
// Run the collection
|
||||
await runCollection(page, 'should_allow_fs');
|
||||
|
||||
// Validate test results
|
||||
await validateRunnerResults(page, {
|
||||
totalRequests: 1,
|
||||
passed: 0,
|
||||
failed: 1,
|
||||
skipped: 0
|
||||
});
|
||||
// Validate test results
|
||||
await validateRunnerResults(page, {
|
||||
totalRequests: 1,
|
||||
passed: 1,
|
||||
failed: 0,
|
||||
skipped: 0
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('should disallow `fs` library', () => {
|
||||
test('developer mode', async ({ pageWithUserData: page }) => {
|
||||
test.setTimeout(2 * 60 * 1000);
|
||||
test('safe mode blocks fs', async ({ pageWithUserData: page }) => {
|
||||
test.setTimeout(2 * 60 * 1000);
|
||||
|
||||
// Set up developer mode
|
||||
await setSandboxMode(page, 'should_disallow_fs', 'developer');
|
||||
// Set up safe mode
|
||||
await setSandboxMode(page, 'should_allow_fs', 'safe');
|
||||
|
||||
// Run the collection
|
||||
await runCollection(page, 'should_disallow_fs');
|
||||
// Run the collection
|
||||
await runCollection(page, 'should_allow_fs');
|
||||
|
||||
// Validate test results
|
||||
await validateRunnerResults(page, {
|
||||
totalRequests: 1,
|
||||
passed: 0,
|
||||
failed: 1,
|
||||
skipped: 0
|
||||
});
|
||||
});
|
||||
|
||||
test('safe mode', async ({ pageWithUserData: page }) => {
|
||||
test.setTimeout(2 * 60 * 1000);
|
||||
|
||||
// Set up safe mode
|
||||
await setSandboxMode(page, 'should_disallow_fs', 'safe');
|
||||
|
||||
// Run the collection
|
||||
await runCollection(page, 'should_disallow_fs');
|
||||
|
||||
// Validate test results
|
||||
await validateRunnerResults(page, {
|
||||
totalRequests: 1,
|
||||
passed: 0,
|
||||
failed: 1,
|
||||
skipped: 0
|
||||
});
|
||||
// Validate test results
|
||||
await validateRunnerResults(page, {
|
||||
totalRequests: 1,
|
||||
passed: 0,
|
||||
failed: 1,
|
||||
skipped: 0
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"maximized": false,
|
||||
"lastOpenedCollections": [
|
||||
"{{projectRoot}}/tests/scripting/inbuilt-libraries/fs/fixtures/collections/should_allow_fs",
|
||||
"{{projectRoot}}/tests/scripting/inbuilt-libraries/fs/fixtures/collections/should_disallow_fs"
|
||||
"{{projectRoot}}/tests/scripting/inbuilt-libraries/fs/fixtures/collections/should_allow_fs"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user