/** * Middleware wrapper that enforces HMAC signature verification on a proxy handler. * * Usage: * ```ts * export default withSigning(defineEventHandler(async (event) => { * // ... handler logic * })) * ``` * * Behavior: * - Reads `runtimeConfig.nuxt-scripts.proxySecret` (server-only). * - If no secret is configured: passes through (signing not yet enabled). * This allows shipping handler wiring before components emit signed URLs. * Once `NUXT_SCRIPTS_PROXY_SECRET` is set, verification is enforced. * - If a secret IS configured and the request's signature is invalid: 403. * - Otherwise, delegates to the wrapped handler. * * The outer wrapper runs before any handler logic, so unauthorized requests * never reach the upstream fetch and cannot consume API quota. */ import type { EventHandler, EventHandlerRequest, EventHandlerResponse } from 'h3'; export declare function withSigning(handler: EventHandler): EventHandler;