fix(Github Trigger Node): Enforce SSL validation by default (#8265)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-01-09 11:34:05 +01:00 committed by GitHub
parent 9d40ae8b74
commit 1387541e33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,