mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-01 16:18:51 +01:00
🛡️ feat: Model Validation Middleware (#1841)
* refactor: add ViolationTypes enum and add new violation for illegal model requests * feat: validateModel middleware to protect the backend against illicit requests for unlisted models
This commit is contained in:
parent
d8038e3b19
commit
a8a19c6caa
19 changed files with 539 additions and 377 deletions
|
|
@ -602,8 +602,11 @@ REGISTRATION_VIOLATION_SCORE=1
|
|||
CONCURRENT_VIOLATION_SCORE=1
|
||||
MESSAGE_VIOLATION_SCORE=1
|
||||
NON_BROWSER_VIOLATION_SCORE=20
|
||||
ILLEGAL_MODEL_REQ_SCORE=5
|
||||
```
|
||||
|
||||
> Note: Non-browser access and Illegal model requests are almost always nefarious as it means a 3rd party is attempting to access the server through an automated script.
|
||||
|
||||
#### Login and registration rate limiting.
|
||||
- `LOGIN_MAX`: The max amount of logins allowed per IP per `LOGIN_WINDOW`
|
||||
- `LOGIN_WINDOW`: In minutes, determines the window of time for `LOGIN_MAX` logins
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue