Add STRIPE_WEBHOOK_SECRET startup validation #600

Open
pook wants to merge 59 commits from agent-task/597 into main
Owner

Summary

  • Adds an early startup check in enforceEnv() that validates STRIPE_WEBHOOK_SECRET is defined and non-empty (whitespace-only counts as empty)
  • If missing, logs FATAL: STRIPE_WEBHOOK_SECRET is not set. Stripe webhooks will fail signature verification. and exits with code 1
  • Adds 3 unit tests: missing var triggers exit, empty/whitespace var triggers exit, valid var passes

Test plan

  • bun test packages/api/tests/unit/env.test.ts — 6 tests pass (3 existing + 3 new)

🤖 Generated with Claude Code

## Summary - Adds an early startup check in `enforceEnv()` that validates `STRIPE_WEBHOOK_SECRET` is defined and non-empty (whitespace-only counts as empty) - If missing, logs `FATAL: STRIPE_WEBHOOK_SECRET is not set. Stripe webhooks will fail signature verification.` and exits with code 1 - Adds 3 unit tests: missing var triggers exit, empty/whitespace var triggers exit, valid var passes ## Test plan - [x] `bun test packages/api/tests/unit/env.test.ts` — 6 tests pass (3 existing + 3 new) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add startup check for STRIPE_WEBHOOK_SECRET env var
Some checks are pending
CI Quality Gate / Lint / Typecheck / Test / Build (pull_request) Waiting to run
13cb12626e
Prevent the server from starting without STRIPE_WEBHOOK_SECRET configured,
which would cause all Stripe webhook signature verifications to fail at runtime.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: issue #597 in-the-server-startup-file-likely-server (agent task liancebot597)
Some checks failed
CI Quality Gate / Lint / Typecheck / Test / Build (pull_request) Has been cancelled
13aedc163b
Some checks failed
CI Quality Gate / Lint / Typecheck / Test / Build (pull_request) Has been cancelled
This pull request has changes conflicting with the target branch.
  • .forgejo/workflows/ci.yml
  • bun.lock
  • package.json
  • packages/api/src/db/schema.ts
  • packages/api/src/index.ts
  • packages/api/src/middleware/csrf.ts
  • packages/api/src/middleware/rate-limit.ts
  • packages/api/src/middleware/security-headers.ts
  • packages/api/src/routes/admin.ts
  • packages/api/src/routes/billing.ts
  • packages/api/src/routes/generate-tos.ts
  • packages/api/src/routes/generate.ts
  • packages/api/src/routes/health.ts
  • packages/api/src/routes/questionnaire.ts
  • packages/api/src/services/document-generator.ts
  • packages/api/src/services/llm.ts
  • packages/api/src/templates/index.ts
  • packages/api/tsconfig.json
  • packages/shared/src/types.ts
  • packages/web/src/app/questionnaire/page.tsx
  • packages/web/src/components/documents/DocumentList.tsx
  • packages/web/src/components/questionnaire/ReviewStep.tsx
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin agent-task/597:agent-task/597
git switch agent-task/597
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot!600
No description provided.