LibreChat/api/server/middleware
Danny Avila a058963a9f
👤 feat: User Placeholder Variables for Custom Endpoint Headers (#7993)
* 🔧 refactor: move `processMCPEnv` from `librechat-data-provider` and move to `@librechat/api`

* 🔧 refactor: Update resolveHeaders import paths

* 🔧 refactor: Enhance resolveHeaders to support user and custom variables

- Updated resolveHeaders function to accept user and custom user variables for placeholder replacement.
- Modified header resolution in multiple client and controller files to utilize the enhanced resolveHeaders functionality.
- Added comprehensive tests for resolveHeaders to ensure correct processing of user and custom variables.

* 🔧 fix: Update user ID placeholder processing in env.ts

* 🔧 fix: Remove arguments passing this.user rather than req.user

- Updated multiple client and controller files to call resolveHeaders without the user parameter

* 🔧 refactor: Enhance processUserPlaceholders to be more readable / less nested

* 🔧 refactor: Update processUserPlaceholders to pass all tests in mpc.spec.ts and env.spec.ts

* chore: remove legacy ChatGPTClient

* chore: remove LLM initialization code

* chore: initial deprecation removal of `gptPlugins`

* chore: remove cohere-ai dependency from package.json and package-lock.json

* chore: update brace-expansion to version 2.0.2 and add license information

* chore: remove PluginsClient test file

* chore: remove legacy

* ci: remove deprecated sendMessage/getCompletion/chatCompletion tests

---------

Co-authored-by: Dustin Healy <54083382+dustinhealy@users.noreply.github.com>
2025-06-23 12:39:27 -04:00
..
assistants fix: Wait for Initial Message Save & Correct Latest Message (#3399) 2024-07-20 01:51:59 -04:00
limiters 🤖 refactor: Improve Agents Memory Usage, Bump Keyv, Grok 3 (#6850) 2025-04-12 18:46:36 -04:00
roles 🧠 feat: User Memories for Conversational Context (#7760) 2025-06-07 18:52:22 -04:00
spec 🛡️ fix: Minor Vulnerabilities (#4543) 2024-10-24 15:50:48 -04:00
validate 🪐 refactor: Migrate Share Functionality to Type-Safe Methods (#7903) 2025-06-14 11:24:30 -04:00
abortControllers.js feat(GPT/Anthropic): Continue Regenerating & Generation Buttons (#808) 2023-08-17 12:50:05 -04:00
abortMiddleware.js 📈 feat: Chat rating for feedback (#5878) 2025-05-30 12:16:34 -04:00
abortRun.js feat: Add Current Datetime to Assistants (v1/v2) (#4952) 2024-12-11 15:26:18 -05:00
buildEndpointOption.js 👤 feat: User Placeholder Variables for Custom Endpoint Headers (#7993) 2025-06-23 12:39:27 -04:00
canDeleteAccount.js 🗨️ feat: Prompts (#3131) 2024-06-20 20:24:32 -04:00
checkBan.js 🏗️ refactor: Extract DB layers to data-schemas for shared use (#7650) 2025-05-30 22:18:13 -04:00
checkDomainAllowed.js 🔐 feat: Implement Allowed Action Domains (#4964) 2024-12-12 12:52:42 -05:00
checkInviteUser.js 🏗️ refactor: Extract DB layers to data-schemas for shared use (#7650) 2025-05-30 22:18:13 -04:00
concurrentLimiter.js 🤖 feat: Support o4-mini and o3 Models (#6928) 2025-04-17 00:40:26 -04:00
denyRequest.js 🌿 fix: Message Route Improvements pt. 2 (#3379) 2024-07-18 13:56:19 -04:00
index.js 🪙 feat: Sync Balance Config on Login (#6671) 2025-04-01 21:19:42 -04:00
logHeaders.js 🛠 feat: Enhance Redis Integration, Rate Limiters & Log Headers (#6462) 2025-03-21 14:14:45 -04:00
moderateText.js 🔧 fix: Chat Middleware, Zod Conversion, Auto-Save and S3 URL Refresh (#6720) 2025-04-03 20:42:56 -04:00
noIndex.js 🚫🔍 feat: disallow search indexing (#1409) 2023-12-29 20:42:04 -05:00
optionalJwtAuth.js *️⃣ feat: Reuse OpenID Auth Tokens (#7397) 2025-05-23 17:40:40 -04:00
requireJwtAuth.js *️⃣ feat: Reuse OpenID Auth Tokens (#7397) 2025-05-23 17:40:40 -04:00
requireLdapAuth.js 🚀 feat(LDAP): Add Flexible Configuration Options (#3124) 2024-06-21 10:14:53 -04:00
requireLocalAuth.js 🚀 feat: Enhance Model Handling, Logging & xAI Agent Support (#6182) 2025-03-05 12:04:26 -05:00
setBalanceConfig.js 🏗️ refactor: Extract DB layers to data-schemas for shared use (#7650) 2025-05-30 22:18:13 -04:00
setHeaders.js feat(GPT/Anthropic): Continue Regenerating & Generation Buttons (#808) 2023-08-17 12:50:05 -04:00
uaParser.js feat: Message Rate Limiters, Violation Logging, & Ban System 🔨 (#903) 2023-09-13 10:57:07 -04:00
validateEndpoint.js 💫 feat: Config File & Custom Endpoints (#1474) 2024-01-03 09:22:48 -05:00
validateImageRequest.js 🛡️ fix: Minor Vulnerabilities (#4543) 2024-10-24 15:50:48 -04:00
validateMessageReq.js 🚤 refactor: Optimize Request Lifecycle Speeds (#3222) 2024-06-28 08:44:47 -04:00
validateModel.js 🤖 feat(Anthropic): Claude 3 & Vision Support (#1984) 2024-03-06 00:04:52 -05:00
validatePasswordReset.js 🔒 feat: password reset disable option; fix: account email error message (#2327) 2024-06-06 11:39:36 -04:00
validateRegistration.js 📩 feat: invite user (#3012) 2024-08-18 00:23:38 -04:00