mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(Github Trigger Node): Enforce SSL validation by default (#8265)
This commit is contained in:
parent
9d40ae8b74
commit
1387541e33
|
@ -434,6 +434,23 @@ export class GithubTrigger implements INodeType {
|
||||||
default: [],
|
default: [],
|
||||||
description: 'The events to listen to',
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some error occured
|
// Some error occurred
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
// If it did not error then the webhook exists
|
// If it did not error then the webhook exists
|
||||||
|
@ -488,14 +505,14 @@ export class GithubTrigger implements INodeType {
|
||||||
const events = this.getNodeParameter('events', []);
|
const events = this.getNodeParameter('events', []);
|
||||||
|
|
||||||
const endpoint = `/repos/${owner}/${repository}/hooks`;
|
const endpoint = `/repos/${owner}/${repository}/hooks`;
|
||||||
|
const options = this.getNodeParameter('options') as { insecureSSL: boolean };
|
||||||
|
|
||||||
const body = {
|
const body = {
|
||||||
name: 'web',
|
name: 'web',
|
||||||
config: {
|
config: {
|
||||||
url: webhookUrl,
|
url: webhookUrl,
|
||||||
content_type: 'json',
|
content_type: 'json',
|
||||||
// secret: '...later...',
|
insecure_ssl: options.insecureSSL ? '1' : '0',
|
||||||
insecure_ssl: '1', // '0' -> not allow inscure ssl | '1' -> allow insercure SSL
|
|
||||||
},
|
},
|
||||||
events,
|
events,
|
||||||
active: true,
|
active: true,
|
||||||
|
|
Loading…
Reference in a new issue