Multi-tenant platform (182 pages, 228 API routes, ~30 modules) built on a deterministic verification core: clinical-trial claims checked against ClinicalTrials.gov registered results and raw event counts (ARR/NNT/RR+CI recomputed in code, oracle-tested), code-enforced exact-span grounding, and multi-source cross-verification. Auth/RBAC/multi-tenancy, document processing at scale (unpdf + Docling), agentic workflows, Claude Science connector, compliance/audit, billing, public API, and more. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
84 lines
2.1 KiB
TypeScript
84 lines
2.1 KiB
TypeScript
"use client";
|
|
|
|
import { DevelopersHeader } from "../_components/DevelopersHeader";
|
|
import { WebhookForm } from "../_components/WebhookForm";
|
|
import { WebhookList } from "../_components/WebhookList";
|
|
import { SecretReveal } from "../_components/SecretReveal";
|
|
import { useWebhooks } from "../_components/useWebhooks";
|
|
|
|
// Webhooks manager: register endpoints, choose events, test delivery, revoke.
|
|
// Admin+ only (enforced client-side for UX and server-side by the API).
|
|
export default function WebhooksPage() {
|
|
const {
|
|
canManage,
|
|
roleLoading,
|
|
hooks,
|
|
loading,
|
|
error,
|
|
creating,
|
|
createError,
|
|
newSecret,
|
|
testResult,
|
|
create,
|
|
remove,
|
|
toggleStatus,
|
|
test,
|
|
dismissSecret,
|
|
} = useWebhooks();
|
|
|
|
if (!roleLoading && !canManage) {
|
|
return (
|
|
<div>
|
|
<h1 className="text-2xl font-semibold text-ink/80">Webhooks</h1>
|
|
<p className="mt-4 text-sm text-ink/60">
|
|
You need an admin or owner role to manage webhooks.
|
|
</p>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<div>
|
|
<DevelopersHeader
|
|
title="Webhooks"
|
|
subtitle={
|
|
<>
|
|
Register an endpoint to receive signed event notifications. Each
|
|
delivery includes an{" "}
|
|
<code className="text-xs bg-paper rounded px-1 py-0.5">
|
|
X-PaperTrail-Signature
|
|
</code>{" "}
|
|
HMAC header — verify it against the signing secret.
|
|
</>
|
|
}
|
|
link={{ href: "/console/developers", label: "← Developers" }}
|
|
/>
|
|
|
|
<WebhookForm
|
|
creating={creating}
|
|
createError={createError}
|
|
onCreate={create}
|
|
/>
|
|
|
|
{newSecret ? (
|
|
<SecretReveal
|
|
title="Copy the signing secret now"
|
|
hint="This is the only time the full secret will be shown. Use it to verify the signature on every delivery."
|
|
secret={newSecret}
|
|
onDismiss={dismissSecret}
|
|
/>
|
|
) : null}
|
|
|
|
<WebhookList
|
|
hooks={hooks}
|
|
loading={loading}
|
|
error={error}
|
|
testResult={testResult}
|
|
onTest={test}
|
|
onToggleStatus={toggleStatus}
|
|
onDelete={remove}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|