({ config, credentials, signal })
| 155 | credentialsSchema: webhookCredentialsSchema, |
| 156 | |
| 157 | async test({ config, credentials, signal }) { |
| 158 | const resolvedIP = await resolvePublicTarget(config.url) |
| 159 | const probe = Buffer.from('{"sim":"connection-test"}\n', 'utf8') |
| 160 | const headers = buildHeaders({ |
| 161 | config, |
| 162 | credentials, |
| 163 | body: probe, |
| 164 | contentType: 'application/x-ndjson', |
| 165 | isProbe: true, |
| 166 | }) |
| 167 | const response = await secureFetchWithPinnedIP(config.url, resolvedIP, { |
| 168 | method: 'POST', |
| 169 | body: new Uint8Array(probe), |
| 170 | headers, |
| 171 | signal, |
| 172 | timeout: PER_ATTEMPT_TIMEOUT_MS, |
| 173 | maxResponseBytes: MAX_RESPONSE_BYTES, |
| 174 | }) |
| 175 | if (!response.ok) { |
| 176 | throw new Error(`Webhook probe failed: HTTP ${response.status}`) |
| 177 | } |
| 178 | }, |
| 179 | |
| 180 | openSession({ config, credentials }) { |
| 181 | let resolvedIP: string | null = null |
nothing calls this directly
no test coverage detected