mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-07-07 06:42:30 +00:00
* fix: resolve env variables in MCP OAuth URL fields before validation
Apply the extractEnvVariable transform to authorization_url, token_url,
redirect_uri, and revocation_endpoint in OAuthOptionsBaseSchema. Without
this, ${ENV_VAR} syntax in these fields caused a Zod URL validation error
at startup before any env substitution could happen.
The same .transform().pipe() pattern is already used on all transport url
fields (SSE, WebSocket, StreamableHTTP) and ProxyUrlSchema.
Closes #13572
* fix: block env var expansion in user OAuth URL fields
Override redirect_uri and revocation_endpoint in UserOAuthOptionsSchema
with userOAuthEndpointUrlSchema, matching the existing overrides for
authorization_url and token_url. Without this, user-submitted configs
could inherit the extractEnvVariable transform added to the base schema
and resolve env vars like ${OPENAI_API_KEY} in those fields.
Add envVarPattern rejection to userOAuthEndpointUrlSchema so that
valid-URL-shaped payloads containing ${VAR} patterns are also blocked,
not just bare non-URL strings. Move envVarPattern declaration above the
schema to make it available at module evaluation time.
Add regression tests for all four OAuth URL fields on the user path,
using structurally valid URLs with embedded ${VAR} patterns to confirm
it is the env var guard — not URL shape — that rejects them.
|
||
|---|---|---|
| .. | ||
| react-query | ||
| types | ||
| accessPermissions.ts | ||
| actions.ts | ||
| api-endpoints.ts | ||
| artifacts.ts | ||
| azure.ts | ||
| balance.spec.ts | ||
| balance.ts | ||
| bedrock.ts | ||
| cloudfront-config.spec.ts | ||
| codeEnvRef.spec.ts | ||
| codeEnvRef.ts | ||
| config.spec.ts | ||
| config.ts | ||
| createPayload.ts | ||
| data-service.ts | ||
| feedback.ts | ||
| file-config.spec.ts | ||
| file-config.ts | ||
| generate.ts | ||
| headers-helpers.ts | ||
| index.ts | ||
| keys.ts | ||
| mcp.ts | ||
| messages.ts | ||
| models.ts | ||
| parameterSettings.spec.ts | ||
| parameterSettings.ts | ||
| parsers.ts | ||
| permissions.ts | ||
| request.ts | ||
| roles.spec.ts | ||
| roles.ts | ||
| schemas.spec.ts | ||
| schemas.ts | ||
| types.ts | ||
| utils.ts | ||