From 68e4083bbdb8200966dc9e702bed9ca5cbc1cdf4 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: Thu, 26 Jan 2023 11:46:00 +0100 Subject: [PATCH] fix(core): Validate numeric ids in the public API (#5251) This was incorrectly changed in https://github.com/n8n-io/n8n/pull/5041 --- .../handlers/credentials/spec/paths/credentials.id.yml | 2 +- .../handlers/credentials/spec/schemas/credential.yml | 4 ++-- .../v1/handlers/executions/spec/schemas/execution.yml | 10 +++++----- .../executions/spec/schemas/parameters/executionId.yml | 2 +- .../workflows/spec/schemas/parameters/workflowId.yml | 2 +- .../v1/handlers/workflows/spec/schemas/tag.yml | 4 ++-- .../v1/handlers/workflows/spec/schemas/workflow.yml | 4 ++-- .../workflows/spec/schemas/workflowSettings.yml | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/cli/src/PublicApi/v1/handlers/credentials/spec/paths/credentials.id.yml b/packages/cli/src/PublicApi/v1/handlers/credentials/spec/paths/credentials.id.yml index 7ab682ffab..b80f81ac02 100644 --- a/packages/cli/src/PublicApi/v1/handlers/credentials/spec/paths/credentials.id.yml +++ b/packages/cli/src/PublicApi/v1/handlers/credentials/spec/paths/credentials.id.yml @@ -12,7 +12,7 @@ delete: description: The credential ID that needs to be deleted required: true schema: - type: string + type: number responses: '200': description: Operation successful. diff --git a/packages/cli/src/PublicApi/v1/handlers/credentials/spec/schemas/credential.yml b/packages/cli/src/PublicApi/v1/handlers/credentials/spec/schemas/credential.yml index 92660184c4..9c66817475 100644 --- a/packages/cli/src/PublicApi/v1/handlers/credentials/spec/schemas/credential.yml +++ b/packages/cli/src/PublicApi/v1/handlers/credentials/spec/schemas/credential.yml @@ -5,9 +5,9 @@ required: type: object properties: id: - type: string + type: number readOnly: true - example: '42' + example: 42 name: type: string example: Joe's Github Credentials diff --git a/packages/cli/src/PublicApi/v1/handlers/executions/spec/schemas/execution.yml b/packages/cli/src/PublicApi/v1/handlers/executions/spec/schemas/execution.yml index 19e5120fcd..baa106fd71 100644 --- a/packages/cli/src/PublicApi/v1/handlers/executions/spec/schemas/execution.yml +++ b/packages/cli/src/PublicApi/v1/handlers/executions/spec/schemas/execution.yml @@ -1,8 +1,8 @@ type: object properties: id: - type: string - example: '1000' + type: number + example: 1000 data: type: object finished: @@ -12,10 +12,10 @@ properties: type: string enum: ['cli', 'error', 'integrated', 'internal', 'manual', 'retry', 'trigger', 'webhook'] retryOf: - type: string + type: number nullable: true retrySuccessId: - type: string + type: number nullable: true example: '2' startedAt: @@ -25,7 +25,7 @@ properties: type: string format: date-time workflowId: - type: string + type: number example: '1000' waitTill: type: string diff --git a/packages/cli/src/PublicApi/v1/handlers/executions/spec/schemas/parameters/executionId.yml b/packages/cli/src/PublicApi/v1/handlers/executions/spec/schemas/parameters/executionId.yml index f13da084e4..6ec1bdf094 100644 --- a/packages/cli/src/PublicApi/v1/handlers/executions/spec/schemas/parameters/executionId.yml +++ b/packages/cli/src/PublicApi/v1/handlers/executions/spec/schemas/parameters/executionId.yml @@ -3,4 +3,4 @@ in: path description: The ID of the execution. required: true schema: - type: string + type: number diff --git a/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/parameters/workflowId.yml b/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/parameters/workflowId.yml index e8389a78b0..fb802e67a2 100644 --- a/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/parameters/workflowId.yml +++ b/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/parameters/workflowId.yml @@ -3,4 +3,4 @@ in: path description: The ID of the workflow. required: true schema: - type: string + type: number diff --git a/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/tag.yml b/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/tag.yml index 40a831b2ae..fb9d024286 100644 --- a/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/tag.yml +++ b/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/tag.yml @@ -1,8 +1,8 @@ type: object properties: id: - type: string - example: '12' + type: number + example: 12 name: type: string example: Production diff --git a/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/workflow.yml b/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/workflow.yml index 2582f850e5..f04070f85b 100644 --- a/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/workflow.yml +++ b/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/workflow.yml @@ -7,9 +7,9 @@ required: - settings properties: id: - type: string + type: number readOnly: true - example: '1' + example: 1 name: type: string example: Workflow 1 diff --git a/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/workflowSettings.yml b/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/workflowSettings.yml index 403b7ac4c5..d14bba0741 100644 --- a/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/workflowSettings.yml +++ b/packages/cli/src/PublicApi/v1/handlers/workflows/spec/schemas/workflowSettings.yml @@ -16,8 +16,8 @@ properties: example: 3600 maxLength: 3600 errorWorkflow: - type: string - example: '10' + type: number + example: 10 description: The ID of the workflow that contains the error trigger node. timezone: type: string