plan: Adjust rate limits based on feedback
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -58,9 +58,9 @@ RATE_LIMITING_ENABLED=true
|
|||||||
RATE_LIMIT_DEFAULT=100/minute
|
RATE_LIMIT_DEFAULT=100/minute
|
||||||
|
|
||||||
# Rate limit for file upload endpoints
|
# Rate limit for file upload endpoints
|
||||||
# Lower limit to prevent resource exhaustion from large file uploads
|
# Allows faster uploads while still preventing abuse
|
||||||
# Default: 20 uploads per minute per IP/user
|
# Default: 10 uploads per second per IP/user (600/minute)
|
||||||
RATE_LIMIT_UPLOAD=20/minute
|
RATE_LIMIT_UPLOAD=10/second
|
||||||
|
|
||||||
# Rate limit for document processing endpoints (OCR, metadata extraction)
|
# Rate limit for document processing endpoints (OCR, metadata extraction)
|
||||||
# These operations are resource-intensive
|
# These operations are resource-intensive
|
||||||
|
|||||||
+1
-1
@@ -224,7 +224,7 @@ class Settings(BaseSettings):
|
|||||||
description="Default rate limit for all endpoints (format: 'count/period', e.g., '100/minute', '1000/hour').",
|
description="Default rate limit for all endpoints (format: 'count/period', e.g., '100/minute', '1000/hour').",
|
||||||
)
|
)
|
||||||
rate_limit_upload: str = Field(
|
rate_limit_upload: str = Field(
|
||||||
default="20/minute",
|
default="10/second",
|
||||||
description="Rate limit for file upload endpoints to prevent resource exhaustion.",
|
description="Rate limit for file upload endpoints to prevent resource exhaustion.",
|
||||||
)
|
)
|
||||||
rate_limit_process: str = Field(
|
rate_limit_process: str = Field(
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ Rate limits are specified in the format `count/period`, where:
|
|||||||
| **Variable** | **Description** | **Default** | **Applies To** |
|
| **Variable** | **Description** | **Default** | **Applies To** |
|
||||||
|------------------------|----------------------------------------------------------------------|------------------|-----------------------------------------|
|
|------------------------|----------------------------------------------------------------------|------------------|-----------------------------------------|
|
||||||
| `RATE_LIMIT_DEFAULT` | Default rate limit for all API endpoints | `100/minute` | Most API endpoints |
|
| `RATE_LIMIT_DEFAULT` | Default rate limit for all API endpoints | `100/minute` | Most API endpoints |
|
||||||
| `RATE_LIMIT_UPLOAD` | Rate limit for file upload endpoints (prevents resource exhaustion) | `20/minute` | `/api/ui-upload` and similar |
|
| `RATE_LIMIT_UPLOAD` | Rate limit for file upload endpoints (prevents resource exhaustion) | `10/second` | `/api/ui-upload` and similar |
|
||||||
| `RATE_LIMIT_PROCESS` | Rate limit for processing endpoints (OCR, metadata extraction) | `30/minute` | `/api/process`, OCR endpoints |
|
| `RATE_LIMIT_PROCESS` | Rate limit for processing endpoints (OCR, metadata extraction) | `30/minute` | `/api/process`, OCR endpoints |
|
||||||
| `RATE_LIMIT_AUTH` | Stricter rate limit for authentication (prevents brute force) | `10/minute` | Login, authentication endpoints |
|
| `RATE_LIMIT_AUTH` | Stricter rate limit for authentication (prevents brute force) | `10/minute` | Login, authentication endpoints |
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user