MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / webhookView

Function webhookView

internal/httpapi/webhooks.go:57–78  ·  view source on GitHub ↗
(wh *identity.Webhook)

Source from the content-addressed store, hash-verified

55}
56
57func webhookView(wh *identity.Webhook) WebhookView {
58 v := WebhookView{
59 ID: wh.ID,
60 URL: wh.URL,
61 Description: wh.Description,
62 Events: orEmptyStrings(wh.Events),
63 Filters: WebhookFiltersView{
64 AgentIDs: wh.Filters.AgentIDs,
65 ConversationIDs: wh.Filters.ConversationIDs,
66 Labels: wh.Filters.Labels,
67 },
68 Enabled: wh.Enabled,
69 CreatedAt: wh.CreatedAt.UTC().Format(time.RFC3339),
70 }
71 if wh.AutoDisabledAt != nil {
72 v.AutoDisabledAt = wh.AutoDisabledAt.UTC().Format(time.RFC3339)
73 }
74 if wh.LastDeliveredAt != nil {
75 v.LastDeliveredAt = wh.LastDeliveredAt.UTC().Format(time.RFC3339)
76 }
77 return v
78}
79
80// validateWebhookFields replicates the legacy validation. The two
81// security-critical checks are reused from their canonical homes (SSRF via

Callers 4

handleUpdateWebhookMethod · 0.85
handleCreateWebhookMethod · 0.85
handleListWebhooksMethod · 0.85
handleGetWebhookMethod · 0.85

Calls 1

orEmptyStringsFunction · 0.85

Tested by

no test coverage detected