mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(core): Handle symlinks in blocked paths (#17735)
This commit is contained in:
@@ -7,6 +7,8 @@ describe('Test Crypto Node', () => {
|
||||
jest.mock('fast-glob', () => async () => ['/test/binary.data']);
|
||||
jest.mock('fs/promises');
|
||||
fsPromises.access = async () => {};
|
||||
const realpathSpy = jest.spyOn(fsPromises, 'realpath');
|
||||
realpathSpy.mockImplementation(async (path) => path as string);
|
||||
jest.mock('fs');
|
||||
fs.createReadStream = () => Readable.from(Buffer.from('test')) as fs.ReadStream;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import fsPromises from 'fs/promises';
|
||||
import type { WorkflowTestData } from 'n8n-workflow';
|
||||
|
||||
describe('Test ReadWriteFile Node', () => {
|
||||
@@ -13,6 +14,9 @@ describe('Test ReadWriteFile Node', () => {
|
||||
const writeFileNode = workflowData.nodes.find((n) => n.name === 'Write to Disk')!;
|
||||
writeFileNode.parameters.fileName = `${testHarness.temporaryDir}/image-written.jpg`;
|
||||
|
||||
const realpathSpy = jest.spyOn(fsPromises, 'realpath');
|
||||
realpathSpy.mockImplementation(async (path) => path as string);
|
||||
|
||||
const tests: WorkflowTestData[] = [
|
||||
{
|
||||
description: 'nodes/Files/ReadWriteFile/test/ReadWriteFile.workflow.json',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
||||
import fsPromises from 'fs/promises';
|
||||
import type { WorkflowTestData } from 'n8n-workflow';
|
||||
import path from 'path';
|
||||
|
||||
@@ -12,6 +13,9 @@ describe('Test Write Binary File Node', () => {
|
||||
const writeFilePath = path.join(testHarness.temporaryDir, 'image-written.jpg');
|
||||
writeFileNode.parameters.fileName = writeFilePath;
|
||||
|
||||
const realpathSpy = jest.spyOn(fsPromises, 'realpath');
|
||||
realpathSpy.mockImplementation(async (path) => path as string);
|
||||
|
||||
const tests: WorkflowTestData[] = [
|
||||
{
|
||||
description: 'nodes/WriteBinaryFile/test/WriteBinaryFile.workflow.json',
|
||||
|
||||
Reference in New Issue
Block a user