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

Function registerWebhook

internal/e2e/webhooks_e2e_test.go:181–188  ·  view source on GitHub ↗

registerWebhook is the cheap path around the public-API URL validator. The validator rejects 127.0.0.1 (SSRF guard); the storage layer accepts any URL. The handler's validation has its own unit test coverage.

(t *testing.T, ts *testutil.E2ATestServer, userID, url string, events []string, filters identity.WebhookFilters)

Source from the content-addressed store, hash-verified

179// storage layer accepts any URL. The handler's validation has its
180// own unit test coverage.
181func registerWebhook(t *testing.T, ts *testutil.E2ATestServer, userID, url string, events []string, filters identity.WebhookFilters) *identity.Webhook {
182 t.Helper()
183 wh, err := ts.Store.CreateWebhook(context.Background(), userID, url, "e2e", events, filters)
184 if err != nil {
185 t.Fatalf("CreateWebhook: %v", err)
186 }
187 return wh
188}
189
190// tick drains the subscriber worker once. Tests call this between
191// trigger and assertion so they don't wait on the 30s production tick.

Calls 1

CreateWebhookMethod · 0.80

Tested by

no test coverage detected