From 1387541e336e7311ba9c43907fa95d3196fae2eb 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: Tue, 9 Jan 2024 11:34:05 +0100 Subject: [PATCH] fix(Github Trigger Node): Enforce SSL validation by default (#8265) --- .../nodes/Github/GithubTrigger.node.ts | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/packages/nodes-base/nodes/Github/GithubTrigger.node.ts b/packages/nodes-base/nodes/Github/GithubTrigger.node.ts index 756510d140..87de8c2ecc 100644 --- a/packages/nodes-base/nodes/Github/GithubTrigger.node.ts +++ b/packages/nodes-base/nodes/Github/GithubTrigger.node.ts @@ -434,6 +434,23 @@ export class GithubTrigger implements INodeType { default: [], description: 'The events to listen to', }, + { + displayName: 'Options', + name: 'options', + type: 'collection', + placeholder: 'Add Option', + default: {}, + options: [ + { + displayName: 'Insecure SSL', + name: 'insecureSSL', + type: 'boolean', + default: false, + description: + 'Whether the SSL certificate of the n8n host be verified by GitHub when delivering payloads', + }, + ], + }, ], }; @@ -465,7 +482,7 @@ export class GithubTrigger implements INodeType { return false; } - // Some error occured + // Some error occurred throw error; } // If it did not error then the webhook exists @@ -488,14 +505,14 @@ export class GithubTrigger implements INodeType { const events = this.getNodeParameter('events', []); const endpoint = `/repos/${owner}/${repository}/hooks`; + const options = this.getNodeParameter('options') as { insecureSSL: boolean }; const body = { name: 'web', config: { url: webhookUrl, content_type: 'json', - // secret: '...later...', - insecure_ssl: '1', // '0' -> not allow inscure ssl | '1' -> allow insercure SSL + insecure_ssl: options.insecureSSL ? '1' : '0', }, events, active: true,