feat(Telegram Trigger Node): Verify Webhook requests (#8383)

Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com>
This commit is contained in:
Marcus
2024-01-19 09:09:11 +01:00
committed by GitHub
parent 25f51f4fd7
commit 11176124b5
2 changed files with 32 additions and 2 deletions

View File

@@ -235,3 +235,9 @@ export function getImageBySize(photos: IDataObject[], size: string): IDataObject
export function getPropertyName(operation: string) {
return operation.replace('send', '').toLowerCase();
}
export function getSecretToken(this: IHookFunctions | IWebhookFunctions) {
// Only characters A-Z, a-z, 0-9, _ and - are allowed.
const secret_token = `${this.getWorkflow().id}_${this.getNode().id}`;
return secret_token.replace(/[^a-zA-Z0-9\_\-]+/g, '');
}