+
+ {/* Name */}
+
+ setForm({ ...form, name: e.target.value })}
+ placeholder="slack-ops"
+ />
+
+
+ {/* Description */}
+
+
+
+ {/* URL */}
+
+ setForm({ ...form, url: e.target.value })}
+ placeholder="https://hooks.slack.com/services/..."
+ />
+
+
+ {/* Method */}
+
+
+
+ {/* Default headers */}
+
+
Default headers
+ {form.headers.map((h, i) => (
+
+ {
+ const next = [...form.headers];
+ next[i] = { ...next[i], key: e.target.value };
+ setForm({ ...form, headers: next });
+ }}
+ placeholder="Header"
+ />
+ {
+ const next = [...form.headers];
+ next[i] = { ...next[i], value: e.target.value };
+ setForm({ ...form, headers: next });
+ }}
+ placeholder="Value"
+ />
+
+
+ ))}
+
+
+
+ {/* Default body template */}
+
+
+
+ {/* TLS trust mode */}
+
+
+
+ {form.tlsTrustMode === 'TRUST_ALL' && (
+
+ TLS certificate validation is DISABLED. Do not use TRUST_ALL in production.
+
+ )}
+
+ {form.tlsTrustMode === 'TRUST_PATHS' && (
+
+
CA PEM paths
+ {form.tlsCaPemPaths.map((p, i) => (
+
+ {
+ const next = [...form.tlsCaPemPaths];
+ next[i] = e.target.value;
+ setForm({ ...form, tlsCaPemPaths: next });
+ }}
+ placeholder="/etc/ssl/certs/my-ca.pem"
+ />
+
+
+ ))}
+
+
+ )}
+
+ {/* HMAC secret */}
+
+
+ setForm({ ...form, hmacSecret: e.target.value })}
+ placeholder={
+ existingQ.data?.hmacSecretSet
+ ? ''
+ : 'Optional signing secret'
+ }
+ />
+
+
+
+
+ {/* Auth kind */}
+
+
+
+ {form.authKind === 'BEARER' && (
+
+ setForm({ ...form, bearerToken: e.target.value })}
+ placeholder="Token stored encrypted at rest"
+ />
+
+ )}
+
+ {form.authKind === 'BASIC' && (
+ <>
+
+ setForm({ ...form, basicUsername: e.target.value })}
+ />
+
+
+ setForm({ ...form, basicPassword: e.target.value })}
+ />
+
+ >
+ )}
+
+ {/* Allowed environments */}
+
+
+ {/* Actions */}
+
+
+ {!isNew && (
+
+ )}
+
+
+ {/* Test result */}
+ {testResult && (
+
+ Test result
+ {testResult.error ? (
+
+ Error: {testResult.error}
+
+ ) : (
+
+ - Status
- {testResult.status}
+ - Latency
- {testResult.latencyMs} ms
+ - TLS protocol
- {testResult.tlsProtocol ?? '—'}
+ {testResult.responseSnippet && (
+ <>
+ - Response
+ {testResult.responseSnippet}
+ >
+ )}
+
+ )}
+
+ )}
+