mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 10:50:14 +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
|
|
@ -284,10 +284,20 @@ export enum CacheKeys {
|
|||
* Key for the override config cache.
|
||||
*/
|
||||
OVERRIDE_CONFIG = 'overrideConfig',
|
||||
}
|
||||
|
||||
/**
|
||||
* Enum for violation types, used to identify, log, and cache violations.
|
||||
*/
|
||||
export enum ViolationTypes {
|
||||
/**
|
||||
* Key for accessing File Upload Violations (exceeding limit).
|
||||
* File Upload Violations (exceeding limit).
|
||||
*/
|
||||
FILE_UPLOAD_LIMIT = 'file_upload_limit',
|
||||
/**
|
||||
* Illegal Model Request (not available).
|
||||
*/
|
||||
ILLEGAL_MODEL_REQUEST = 'illegal_model_request',
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue