From 934bbc6068ad69f862607624e7599e325c2f05b4 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 19 Jul 2023 11:50:50 +0200 Subject: [PATCH] Update webhook trigger with allowed methods and local only --- .../src/schemas/integrations/triggers.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/language-service/src/schemas/integrations/triggers.ts b/src/language-service/src/schemas/integrations/triggers.ts index fdac4018f1..289e5c555d 100644 --- a/src/language-service/src/schemas/integrations/triggers.ts +++ b/src/language-service/src/schemas/integrations/triggers.ts @@ -59,6 +59,8 @@ type EventType = | "user_removed" | "zha_event"; +type AllowedMethods = "POST" | "PUT" | "GET" | "HEAD"; + interface CalendarTrigger { /** * Alias for the calendar trigger. @@ -748,6 +750,18 @@ interface WebhookTrigger { * https://www.home-assistant.io/docs/automation/trigger#trigger-variables */ variables?: Data; + + /** + * Controls to only allow local requests to trigger the webhook. + * https://www.home-assistant.io/docs/automation/trigger/#webhook-trigger + */ + local_only?: boolean; + + /** + * Controls to only allow requests with a valid API password to trigger the webhook. + * https://www.home-assistant.io/docs/automation/trigger/#webhook-trigger + */ + allowed_methods: AllowedMethods[]; } interface ZoneTrigger {