Skip to content

feat: clearance enforcement on Vercel for any framework (0.20.0) - #65

Merged
cport1 merged 1 commit into
mainfrom
feat/vercel-clearance-gate
Oct 20, 2026
Merged

cport1 merged 1 commit into
mainfrom
feat/vercel-clearance-gate

Conversation

@cport1

@cport1 cport1 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Adds WebDecoy clearance enforcement as Vercel middleware, for any framework:

  • @webdecoy/node/vercel: Routing Middleware (export { default } from '@webdecoy/node/vercel') for Astro, SvelteKit, Nuxt, Remix or static sites.
  • withClearance() in @webdecoy/nextjs.
  • createClearanceGate() in @webdecoy/node for other edge adapters.

On the paths a site protects in WebDecoy, a visitor needs a clearance token. A real browser earns one on a short check page; a client that runs no JavaScript never gets the page. It follows the site's WebDecoy mode (monitor until enforce) and fails open.

src/clearance/gate.generated.js is generated from WebDecoy's validator source (the same decision as the Cloudflare, AWS and Netlify validators), minified and comment-free. vercel.test.ts fails if it is edited by hand.

Tests: Vercel continue-with-headers protocol, a real Ed25519 token accepted, a token for another tenant rejected, monitor mode, forged verdict stripped, missing config is a pass-through, env configuration, fail-open, and the whole middleware run inside the Edge Runtime VM. Bumps all packages to 0.20.0.

WebDecoy's clearance validator, the decision its Cloudflare, AWS and Netlify
validators make, now runs as Vercel middleware with no proxy in front:

- @webdecoy/node/vercel: Routing Middleware for Astro, SvelteKit, Nuxt,
  Remix or static sites.
- withClearance() in @webdecoy/nextjs for Next.js middleware.
- createClearanceGate() in @webdecoy/node for other edge adapters.

The gate is generated from WebDecoy's validator source
(src/clearance/gate.generated.js) and never edited here; a test fails on a
hand edit. Configured by WEBDECOY_SITE_KEY, WEBDECOY_SCANNER_ID and
WEBDECOY_SENSOR_KEY, follows the site's WebDecoy mode, fails open.
@cport1
cport1 merged commit 8c0ea12 into main Oct 20, 2026
2 checks passed
@cport1
cport1 deleted the feat/vercel-clearance-gate branch October 20, 2026 18:34
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