Skip to content

Webhooks: verify with @base44/platform/server - #74

Merged
ozsay merged 1 commit into
mainfrom
webhooks-platform-sdk
Oct 19, 2026
Merged

ozsay merged 1 commit into
mainfrom
webhooks-platform-sdk

Conversation

@ozsay

@ozsay ozsay commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the hand-rolled Ed25519 verifier (src/lib/base44WebhookSignature.ts) with the webhooks module of the released @base44/platform 0.3.0 (base44/javascript-sdk#319).
  • /api/base44/webhooks now mounts webhooks.createHandler. The SDK reads the raw body, verifies, echoes the webhook.test.v1 challenge and picks the status: 204, 400 on a failed verification, 500 on bad keys or a throwing handler. The only shell logic left is app.deleted.v1 → removePins(event.data.app_id), now typed by the SDK's event map.
  • New src/lib/base44Webhooks.ts builds the client with createPlatformServer() and reads BASE44_WEBHOOK_PUBLIC_KEYS per call, so a rotated key deploys without a code change.
  • webhook:smoke drives the SDK and keeps every negative control. It also adds handler checks: 204 for a genuine delivery, 400 for a tampered one, and the challenge echo.
  • Updated docs: README step 5, CLAUDE.md, docs/base44-webhooks.md, .env.example.

Behaviour changes

  • A successful delivery now gets an empty 204 instead of 200 {"ok":true}, and a rejected one gets {"error":"<code>"} instead of {"error":"invalid_signature"}.
  • The receiver still needs only BASE44_WEBHOOK_PUBLIC_KEYS. The SDK's server client no longer takes an API key or host.
  • Both netlify.toml files (the root and examples/white-label-minimal/) now leave examples/white-label-minimal/node_modules/** out of the secrets scan. The minimal example still pins @base44/platform@^0.1.0, which 0.3.0 at the root no longer satisfies, so npm installs 0.1.0 inside the example, and the scan matched a preview env value in that package's README and types. Installed packages are never deployed. Moving the example to 0.3.0 needs a client migration (Base44PlatformClient is gone), so it's left for a separate PR.

Test plan

  • npm run webhook:smoke: all 16 checks pass against @base44/platform@0.3.0
  • npm run lint
  • npm run typecheck: no errors in src/ or scripts/ (the only error is the stale .next LayoutProps type)
  • Prod delivery of all five app.* events, signed and verified by an independent receiver (outside this repo)
  • End-to-end against a deployed shell: register, activate, delete an app, and check its pins are removed

🤖 Generated with Claude Code

@netlify

netlify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for sunny44-builder ready!

Name Link
🔨 Latest commit 6f79a47
🔍 Latest deploy log https://app.netlify.com/projects/sunny44-builder/deploys/6ad5df0359a33ca73ff7755f
😎 Deploy Preview https://deploy-preview-74--sunny44-builder.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base44-platform-starter ready!

Name Link
🔨 Latest commit 6f79a47
🔍 Latest deploy log https://app.netlify.com/projects/base44-platform-starter/deploys/6ad5df03e35ac217c5c17efb
😎 Deploy Preview https://deploy-preview-74--base44-platform-starter.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ozsay
ozsay force-pushed the webhooks-platform-sdk branch from 01b74f9 to 796f66a Compare October 18, 2026 13:12
@ozsay ozsay changed the title Webhooks: verify with @base44/platform/server (SDK preview) Webhooks: verify with @base44/platform/server Oct 18, 2026
@ozsay
ozsay force-pushed the webhooks-platform-sdk branch from 796f66a to a95cd57 Compare October 19, 2026 09:11
…d verifier

The receiver mounts the SDK's createHandler, which reads the raw body, verifies
the v1a signature against BASE44_WEBHOOK_PUBLIC_KEYS, answers the activation
probe and picks the status code (204 / 400 / 500). src/lib/base44Webhooks.ts
builds the client and the per-call keys, and replaces base44WebhookSignature.ts.

Uses the released @base44/platform 0.3.0. Its createPlatformServer() takes no
options, so the receiver needs only BASE44_WEBHOOK_PUBLIC_KEYS.

webhook:smoke now drives the SDK, keeps every negative control, and adds the
handler's status codes and the challenge echo.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ozsay
ozsay force-pushed the webhooks-platform-sdk branch from a95cd57 to 6f79a47 Compare October 19, 2026 09:12
@ozsay
ozsay merged commit 698d86e into main Oct 19, 2026
8 checks passed
amitbardos added a commit that referenced this pull request Oct 19, 2026
main's webhook receiver (#74) depends on @base44/platform too; both it
and the example now take ^0.4.0, so the lockfile resolves one copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant