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)
| 179 | // storage layer accepts any URL. The handler's validation has its |
| 180 | // own unit test coverage. |
| 181 | func 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. |
no test coverage detected