fix: security hardening and performance improvements

Security:
- Add token+secret auth to /setup-webhook and /webhook-info endpoints
- Disable /api/test in production environment (ENVIRONMENT=production)

Performance:
- Add retryWithBackoff to weather-tool (maxRetries: 2)
- Add KV caching to executeLookupDocs (1h TTL)

Code Quality:
- Centralize error messages in src/constants/messages.ts
- Update 5 files to use centralized error constants

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
kappa
2026-01-21 17:35:51 +09:00
parent 91f50ddc12
commit dab279c765
12 changed files with 121 additions and 27 deletions

View File

@@ -3,6 +3,7 @@ export interface Env {
AI: Ai;
BOT_TOKEN: string;
WEBHOOK_SECRET: string;
ENVIRONMENT?: string;
SUMMARY_THRESHOLD?: string;
MAX_SUMMARIES_PER_USER?: string;
N8N_WEBHOOK_URL?: string;