From 053fb5ff7a3a4ce30b35fa6c830787b935ebaf63 Mon Sep 17 00:00:00 2001 From: Michael Kret <88898367+michael-radency@users.noreply.github.com> Date: Wed, 7 Feb 2024 15:18:00 +0200 Subject: [PATCH 1/3] fix(Microsoft Outlook Node): Download executes more than once per incoming item (#8566) --- .../messageAttachment/download.operation.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/nodes-base/nodes/Microsoft/Outlook/v2/actions/messageAttachment/download.operation.ts b/packages/nodes-base/nodes/Microsoft/Outlook/v2/actions/messageAttachment/download.operation.ts index 3c5d7d81a957c..7892b24ffaec8 100644 --- a/packages/nodes-base/nodes/Microsoft/Outlook/v2/actions/messageAttachment/download.operation.ts +++ b/packages/nodes-base/nodes/Microsoft/Outlook/v2/actions/messageAttachment/download.operation.ts @@ -49,7 +49,7 @@ export async function execute(this: IExecuteFunctions, index: number, items: INo if (attachmentDetails.contentType) { mimeType = attachmentDetails.contentType; } - const fileName = attachmentDetails.name; + const fileName = attachmentDetails.name as string; const response = await microsoftApiRequest.call( this, @@ -74,13 +74,17 @@ export async function execute(this: IExecuteFunctions, index: number, items: INo Object.assign(newItem.binary!, items[index].binary); } - items[index] = newItem; const data = Buffer.from(response.body as string, 'utf8'); - items[index].binary![dataPropertyNameDownload] = await this.helpers.prepareBinaryData( - data as unknown as Buffer, - fileName as string, + newItem.binary![dataPropertyNameDownload] = await this.helpers.prepareBinaryData( + data, + fileName, mimeType, ); - return items; + const executionData = this.helpers.constructExecutionMetaData( + this.helpers.returnJsonArray(newItem), + { itemData: { item: index } }, + ); + + return executionData; } From 1b7ebe463ec5b0bc9e405318c791dee41252651e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 15:39:40 +0100 Subject: [PATCH 2/3] :rocket: Release 1.28.0 (#8569) Co-authored-by: ivov --- CHANGELOG.md | 35 ++++++++++++++++++++++ package.json | 2 +- packages/@n8n/nodes-langchain/package.json | 2 +- packages/cli/package.json | 2 +- packages/core/package.json | 2 +- packages/design-system/package.json | 2 +- packages/editor-ui/package.json | 2 +- packages/node-dev/package.json | 2 +- packages/nodes-base/package.json | 2 +- packages/workflow/package.json | 2 +- 10 files changed, 44 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a34a8634b8bff..df9da9b409c29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,38 @@ +# [1.28.0](https://github.com/n8n-io/n8n/compare/n8n@1.27.0...n8n@1.28.0) (2024-02-07) + + +### Bug Fixes + +* Allow Date/Luxon objects and additional formats in DateTime validation ([#8525](https://github.com/n8n-io/n8n/issues/8525)) ([c419c85](https://github.com/n8n-io/n8n/commit/c419c8592f16a002d9f460c555db5f8bc04d95b8)) +* **core:** Ensure AxiosError status always gets copied over to NodeApiError ([#8509](https://github.com/n8n-io/n8n/issues/8509)) ([76c5a62](https://github.com/n8n-io/n8n/commit/76c5a62f521fbd79a47d47f419fd90dcc6ca0275)) +* **core:** Fix DropRoleMapping migration ([#8521](https://github.com/n8n-io/n8n/issues/8521)) ([4fed68e](https://github.com/n8n-io/n8n/commit/4fed68ee34c239ed3cae8541d5d4e7f86cf28d13)) +* **core:** Fix new graceful shutdown env being always overridden by deprecated env ([#8503](https://github.com/n8n-io/n8n/issues/8503)) ([cc41fc7](https://github.com/n8n-io/n8n/commit/cc41fc7c801ecb1b0de4b7c5af5a03b3f30fdce8)) +* **core:** Fix PermissionChecker.check, and add additional unit tests ([#8528](https://github.com/n8n-io/n8n/issues/8528)) ([5832d3c](https://github.com/n8n-io/n8n/commit/5832d3ca4695ec812e028e40b41811ca2215c0e2)) +* **core:** Fix test runs of triggers that rely on static data ([#8524](https://github.com/n8n-io/n8n/issues/8524)) ([528c071](https://github.com/n8n-io/n8n/commit/528c07134a6705c8c7a5378f15f5e4a4b93234a9)) +* **core:** Fix workflow tagging failure due to unique constraint check ([#8505](https://github.com/n8n-io/n8n/issues/8505)) ([92f939f](https://github.com/n8n-io/n8n/commit/92f939f82799975a5f9b859e7f342f3440961320)) +* **core:** Upgrade nodemailer to address an exploit ([#8535](https://github.com/n8n-io/n8n/issues/8535)) ([ee5e422](https://github.com/n8n-io/n8n/commit/ee5e4220945fde5baaec9ad66ff08b8728912aa3)) +* **core:** Use hostname from URL instead of Host header for SNI ([#8562](https://github.com/n8n-io/n8n/issues/8562)) ([7531f34](https://github.com/n8n-io/n8n/commit/7531f343861d91df075b8f3220f5bce8858b117f)) +* **core:** Use trx manager instead of repository for tags overwrite ([#8557](https://github.com/n8n-io/n8n/issues/8557)) ([abddbb6](https://github.com/n8n-io/n8n/commit/abddbb622798bdc4a2b11347a09f10aaf03a4639)) +* **editor:** Prune values that are not in the schema in the ResourceMapper component ([#8478](https://github.com/n8n-io/n8n/issues/8478)) ([612771e](https://github.com/n8n-io/n8n/commit/612771e0328f7e565d5f075cc20ad86bd1f13bce)) +* **Embeddings OpenAI Node:** Fix dynamic models fetching ([#8533](https://github.com/n8n-io/n8n/issues/8533)) ([cccdfc7](https://github.com/n8n-io/n8n/commit/cccdfc73d6c13a37e395fdc2612f2ebf458a4f52)) +* **HTTP Request Node:** Require parameter with filled name and value to avoid infinite loop ([#8454](https://github.com/n8n-io/n8n/issues/8454)) ([3128dca](https://github.com/n8n-io/n8n/commit/3128dca1faeff85d77a28640b7dfe8fbcd85db4f)) +* **HTTP Request Node:** Support form data when using pagination ([#8497](https://github.com/n8n-io/n8n/issues/8497)) ([ca75744](https://github.com/n8n-io/n8n/commit/ca75744c7f93db827ece5bf3b17b82f07d4cffb1)) +* **Microsoft Excel 365 Node:** Upsert append new rows at the end of used range, option to append at the end of selected range ([#8461](https://github.com/n8n-io/n8n/issues/8461)) ([1e02d73](https://github.com/n8n-io/n8n/commit/1e02d73ad782fb21cdd9b7350e34beb731a677c5)) +* **MongoDB Node:** Fix "Maximum call stack size exceeded" error on too many rows ([#8530](https://github.com/n8n-io/n8n/issues/8530)) ([76cdf75](https://github.com/n8n-io/n8n/commit/76cdf75fb96fb55b4a6e7a1a9edc7c9674806391)) +* **Slack Node:** Attachments fix ([#8471](https://github.com/n8n-io/n8n/issues/8471)) ([254700a](https://github.com/n8n-io/n8n/commit/254700a059a48a66dea8b9d80e61c8250e09d5b5)) +* Update BaseChatModel import checks for MistralAI compatibility ([#8527](https://github.com/n8n-io/n8n/issues/8527)) ([c8b8379](https://github.com/n8n-io/n8n/commit/c8b83790150b9974d6d99f6a2b6b5b7be6fb8c53)) + + +### Features + +* Add assignment component with drag and drop to Set node ([#8283](https://github.com/n8n-io/n8n/issues/8283)) ([2799de4](https://github.com/n8n-io/n8n/commit/2799de491b753e6fb00f73b61393392b6fc8ad18)) +* Azure Open AI chat model & embeddings ([#8522](https://github.com/n8n-io/n8n/issues/8522)) ([934d0d3](https://github.com/n8n-io/n8n/commit/934d0d35b1814c0a39595d61a30fb9c2e05fd995)) +* **editor:** Add delete and disable button to nodes on hover ([#8482](https://github.com/n8n-io/n8n/issues/8482)) ([994754b](https://github.com/n8n-io/n8n/commit/994754bf39976c5bb33fd1c30a0eb82cc518850b)) +* **Email Trigger (IMAP) Node:** Upgrade mailparser ([#8539](https://github.com/n8n-io/n8n/issues/8539)) ([da1fe44](https://github.com/n8n-io/n8n/commit/da1fe44d5246848e2ba7bb8bc5f4577685fbcee0)) +* **RabbitMQ Trigger Node:** Add options to configure assert of exchanges and queues ([#8430](https://github.com/n8n-io/n8n/issues/8430)) ([4b3659f](https://github.com/n8n-io/n8n/commit/4b3659f04f84ef774d31cf2341c5dbb500a73afe)) + + + # [1.27.0](https://github.com/n8n-io/n8n/compare/n8n@1.26.0...n8n@1.27.0) (2024-01-31) diff --git a/package.json b/package.json index 97ab4b5aae048..081e00282a197 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "n8n-monorepo", - "version": "1.27.0", + "version": "1.28.0", "private": true, "homepage": "https://n8n.io", "engines": { diff --git a/packages/@n8n/nodes-langchain/package.json b/packages/@n8n/nodes-langchain/package.json index fe0667d48a813..f867819e99a7e 100644 --- a/packages/@n8n/nodes-langchain/package.json +++ b/packages/@n8n/nodes-langchain/package.json @@ -1,6 +1,6 @@ { "name": "@n8n/n8n-nodes-langchain", - "version": "0.12.0", + "version": "0.13.0", "description": "", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", diff --git a/packages/cli/package.json b/packages/cli/package.json index 7655e9128d7f9..b432337f4615d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "n8n", - "version": "1.27.0", + "version": "1.28.0", "description": "n8n Workflow Automation Tool", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", diff --git a/packages/core/package.json b/packages/core/package.json index b595afc1dda26..5524aba8987f0 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "n8n-core", - "version": "1.27.0", + "version": "1.28.0", "description": "Core functionality of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", diff --git a/packages/design-system/package.json b/packages/design-system/package.json index 2d1a325af81f4..2a78cddc40f13 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -1,6 +1,6 @@ { "name": "n8n-design-system", - "version": "1.20.0", + "version": "1.21.0", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", "author": { diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index 3e6612c68c78a..86d5d3e29da79 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -1,6 +1,6 @@ { "name": "n8n-editor-ui", - "version": "1.27.0", + "version": "1.28.0", "description": "Workflow Editor UI for n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", diff --git a/packages/node-dev/package.json b/packages/node-dev/package.json index ca8751ce4472d..e58398aa94420 100644 --- a/packages/node-dev/package.json +++ b/packages/node-dev/package.json @@ -1,6 +1,6 @@ { "name": "n8n-node-dev", - "version": "1.27.0", + "version": "1.28.0", "description": "CLI to simplify n8n credentials/node development", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index f404360e953a6..1c42f93453f36 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -1,6 +1,6 @@ { "name": "n8n-nodes-base", - "version": "1.27.0", + "version": "1.28.0", "description": "Base nodes of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", diff --git a/packages/workflow/package.json b/packages/workflow/package.json index d200adca3aa50..7467928bd4032 100644 --- a/packages/workflow/package.json +++ b/packages/workflow/package.json @@ -1,6 +1,6 @@ { "name": "n8n-workflow", - "version": "1.27.0", + "version": "1.28.0", "description": "Workflow base code of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 40eee3aa49959c2900e12559765801a36851ef60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Wed, 7 Feb 2024 17:56:02 +0100 Subject: [PATCH 3/3] ci(core): Avoid slow bcrypt calls in tests (no-changelog) (#8570) --- packages/cli/src/services/password.utility.ts | 9 ++++----- packages/cli/test/integration/ldap/ldap.api.test.ts | 2 +- packages/cli/test/integration/shared/db/users.ts | 7 +++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/cli/src/services/password.utility.ts b/packages/cli/src/services/password.utility.ts index 314a3fef71b4c..8c8c3aaf1964c 100644 --- a/packages/cli/src/services/password.utility.ts +++ b/packages/cli/src/services/password.utility.ts @@ -1,18 +1,17 @@ import { BadRequestError } from '@/errors/response-errors/bad-request.error'; import { Service as Utility } from 'typedi'; -import { compare, genSaltSync, hash } from 'bcryptjs'; +import { compare, hash } from 'bcryptjs'; import { MAX_PASSWORD_CHAR_LENGTH as maxLength, MIN_PASSWORD_CHAR_LENGTH as minLength, } from '@/constants'; +const SALT_ROUNDS = 10; + @Utility() export class PasswordUtility { async hash(plaintext: string) { - const SALT_ROUNDS = 10; - const salt = genSaltSync(SALT_ROUNDS); - - return await hash(plaintext, salt); + return await hash(plaintext, SALT_ROUNDS); } async compare(plaintext: string, hashed: string) { diff --git a/packages/cli/test/integration/ldap/ldap.api.test.ts b/packages/cli/test/integration/ldap/ldap.api.test.ts index 5969fa4b7f327..d60e51595659d 100644 --- a/packages/cli/test/integration/ldap/ldap.api.test.ts +++ b/packages/cli/test/integration/ldap/ldap.api.test.ts @@ -47,7 +47,7 @@ const testServer = utils.setupTestServer({ }); beforeAll(async () => { - owner = await createUser({ role: 'global:owner', password: 'password' }); + owner = await createUser({ role: 'global:owner' }); authOwnerAgent = testServer.authAgentFor(owner); defaultLdapConfig.bindingAdminPassword = Container.get(Cipher).encrypt( diff --git a/packages/cli/test/integration/shared/db/users.ts b/packages/cli/test/integration/shared/db/users.ts index 27defb218467d..2ee01524bfecd 100644 --- a/packages/cli/test/integration/shared/db/users.ts +++ b/packages/cli/test/integration/shared/db/users.ts @@ -9,6 +9,9 @@ import { MfaService } from '@/Mfa/mfa.service'; import { randomApiKey, randomEmail, randomName, randomValidPassword } from '../random'; +// pre-computed bcrypt hash for the string 'password', using `await hash('password', 10)` +const passwordHash = '$2a$10$njedH7S6V5898mj6p0Jr..IGY9Ms.qNwR7RbSzzX9yubJocKfvGGK'; + /** * Store a user in the DB, defaulting to a `member`. */ @@ -16,7 +19,7 @@ export async function createUser(attributes: Partial = {}): Promise const { email, password, firstName, lastName, role, ...rest } = attributes; const user = Container.get(UserRepository).create({ email: email ?? randomEmail(), - password: await hash(password ?? randomValidPassword(), 10), + password: password ? await hash(password, 1) : passwordHash, firstName: firstName ?? randomName(), lastName: lastName ?? randomName(), role: role ?? 'global:member', @@ -101,7 +104,7 @@ export async function createManyUsers( [...Array(amount)].map(async () => Container.get(UserRepository).create({ email: email ?? randomEmail(), - password: await hash(password ?? randomValidPassword(), 10), + password: password ? await hash(password, 1) : passwordHash, firstName: firstName ?? randomName(), lastName: lastName ?? randomName(), role: role ?? 'global:member',