Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/webhooks-worker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ The handler therefore resolves that Composio-project-global ID through the datab
primary key; ownership and toolkit assignment are immutable after insertion,
and terminal status changes atomically reconcile the user's active default.

Production binds one immutable `CHEATCODE_RELEASE_SHA`, exposed by `/health`.
Production binds one immutable `CHEATCODE_RELEASE_SHA`, exposed by `/health`
only to the gateway's service-binding probe (`https://webhooks.internal/health`);
on the public webhook host the route answers as not found.
HTTP, cron, idempotency, deletion, and workflow continuation paths use their
normal durable ownership and idempotency contracts; database migrations retain
their separate target, role, lock, and schema validation.
Expand Down
14 changes: 10 additions & 4 deletions apps/webhooks-worker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,20 @@ webhooksApp.use(
}),
);

webhooksApp.get("/health", (c) =>
c.json({
webhooksApp.get("/health", (c) => {
// Service-binding-only surface: the gateway probes https://webhooks.internal/health
// for release aggregation. The public webhook host must answer like the route does
// not exist so release metadata never leaks on an unauthenticated endpoint.
if (new URL(c.req.url).hostname !== "webhooks.internal") {
return c.notFound();
}
return c.json({
ok: true,
releaseSha: c.env.CHEATCODE_RELEASE_SHA ?? "development",
versionId: c.env.CF_VERSION_METADATA?.id ?? null,
worker: "webhooks",
}),
);
});
});

webhooksApp.post("/clerk", async (c) => {
const signingSecret = await clerkWebhookSigningSecret(c.env);
Expand Down