feat(webhook): align chatwoot ingress routes

This commit is contained in:
2026-06-04 23:20:58 +08:00
parent 6aa62c6d7b
commit 9e3f561bed
12 changed files with 467 additions and 120 deletions
+6 -1
View File
@@ -13,6 +13,11 @@ import (
// Reference: P2E §4 — webhook authentication per channel type
func WebhookAuth(registry *auth.WebhookTokenRegistry) gin.HandlerFunc {
return func(c *gin.Context) {
if registry == nil {
response.AbortWithStatusError(c, http.StatusUnauthorized, response.ErrUnauthorized, "Webhook registry not configured")
return
}
channelType := c.Param("channel_type")
identifier := c.Param("identifier")
@@ -23,4 +28,4 @@ func WebhookAuth(registry *auth.WebhookTokenRegistry) gin.HandlerFunc {
}
c.Next()
}
}
}