chore: initial deploy bundle

This commit is contained in:
ZOMBIIIIIII
2026-04-21 15:01:05 +03:00
parent 9329b76e9b
commit 59a7d1d9ca
6 changed files with 23 additions and 150 deletions

View File

@@ -1,5 +1,6 @@
import { Request, Response, NextFunction } from 'express';
import { verifyCsrfToken, isCsrfConfigured } from '../services/csrf.service';
import { env } from '../config/env';
import { logger } from '../lib/logger';
const SAFE_METHODS = new Set(['GET', 'HEAD', 'OPTIONS']);
@@ -10,8 +11,13 @@ export function csrfMiddleware(req: Request, res: Response, next: NextFunction):
return;
}
// If CSRF is not configured (Vault down при старте) — пропускаем, чтобы не блокировать сервис.
// В логах будет warning — легко заметить.
// CSRF отключён если VAULT_CSRF_PATH не задан
if (!env.vault.csrfPath) {
next();
return;
}
// Секрет не загрузился (Vault недоступен) — пропускаем чтобы не блокировать сервис
if (!isCsrfConfigured()) {
logger.warn('CSRF check skipped: secret not loaded');
next();