From bbe87aba5e875db12fa42529e72965d2c9c0e301 Mon Sep 17 00:00:00 2001 From: JohnDoe6345789 Date: Thu, 25 Dec 2025 22:18:52 +0000 Subject: [PATCH] docs: secure,layer,implementation (1 files) --- docs/implementation/SECURE_DATABASE_LAYER.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/implementation/SECURE_DATABASE_LAYER.md b/docs/implementation/SECURE_DATABASE_LAYER.md index d14ffd66c..23ea25ace 100644 --- a/docs/implementation/SECURE_DATABASE_LAYER.md +++ b/docs/implementation/SECURE_DATABASE_LAYER.md @@ -87,14 +87,13 @@ Every database operation requires: ### 2. Rate Limiting Prevents abuse by limiting requests per user: -- **100 requests per 60 seconds** per user +- **100 requests per 60 seconds** per user (defaults) - Automatic cleanup of old timestamps - Tracks per userId, not IP (more accurate) -```typescript -private static readonly RATE_LIMIT_WINDOW = 60000 // 1 minute -private static readonly MAX_REQUESTS_PER_WINDOW = 100 -``` +Override defaults with environment variables: +- `MB_RATE_LIMIT_WINDOW_MS` (milliseconds) +- `MB_RATE_LIMIT_MAX_REQUESTS` (positive integer) ### 3. Input Sanitization