From 905f68f73064b34c22818b9f2715e49a844c5038 Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Fri, 14 Aug 2026 14:12:24 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20CodeRabbit=20CI=20Fix:=20Fix=20F?= =?UTF-8?q?ailing=20PR=20Validation,=20Security=20Audit,=20and=20Unit=20Te?= =?UTF-8?q?sts=20CI=20Checks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/index.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/config/index.ts b/src/config/index.ts index 642f1af..48935b1 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -6,11 +6,21 @@ import type { Env } from "../types"; export * from "./constants"; +const REQUIRED_ENV_VARS: (keyof Env)[] = [ + "STRIPE_SECRET_KEY", + "STRIPE_WEBHOOK_SECRET", + "CHITTY_ID_TOKEN", +]; + export function validateEnv(env: Env): void { - // Only validate critical bindings - secrets checked when used if (!env.HOLDS) { throw new Error("Missing required binding: HOLDS (KV Namespace)"); } + + const missing = REQUIRED_ENV_VARS.filter((key) => !env[key]); + if (missing.length > 0) { + throw new Error(`Missing required environment variables: ${missing.join(", ")}`); + } } export function getAllowedOrigins(env: Env): string[] {