Context
Webhook secrets are forever today. If a secret leaks, the user has no way to rotate without deleting and recreating the webhook (losing its history). We need an explicit rotate action.
Tasks
Acceptance criteria
- Zero-downtime rotation (overlap window)
- Plaintext leaves the system exactly once
Out of scope
- Auto-rotation on schedule
- Webhook receiver-side guidance docs
Scope (important — read carefully)
All work for this issue MUST live inside app/api/routes-b/.
- No edits to files outside this folder
- Any shared helpers (validation, types, utils, caches, rate limiters) must be created inside app/api/routes-b/_lib/ (create the folder if missing)
- Do NOT add new helpers to the top-level lib/ directory or any other top-level location
- Tests must live inside app/api/routes-b//tests/
- Existing imports from @/lib/... (prisma client, auth) may be reused as-is — only new code must stay inside routes-b
Context
Webhook secrets are forever today. If a secret leaks, the user has no way to rotate without deleting and recreating the webhook (losing its history). We need an explicit rotate action.
Tasks
Acceptance criteria
Out of scope
Scope (important — read carefully)
All work for this issue MUST live inside app/api/routes-b/.