mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 21:08:17 +00:00
* 🛡️ fix: Reject Unknown Admin Config Sections and Scope Write Responses to Read Access - Admin config writes (PUT, PATCH, tombstone) now accept only top-level sections that configSchema defines. PUT reports `unknown_section` issues under CONFIG_OVERRIDE_INVALID; PATCH and tombstone return 400 UNKNOWN_SECTION without echoing the path. This closes override writes to AppService runtime state (`paths`, the raw-YAML `config`, `availableTools`, and the `interfaceConfig`/`turnstileConfig`/`mcpConfig` aliases). - mergeConfigOverrides ignores stored override keys and tombstones outside configSchema, with one warning per document, so data an older server stored is neutralized without a migration. DELETE /fields still removes such stored entries, which is the only per-field way to clear a legacy tombstone. - Write responses (PUT, PATCH, tombstone, field delete, toggle) are redacted and then filtered to the sections the caller can read plus the sections the write managed; broad managers see the whole document as before. - Admin reads of the resolved config redact literal Azure group keys (merged `groups`, `groupMap`, raw YAML copy) and the Vertex `serviceKeyFile` (`vertex` and `vertexConfig`), keeping `${ENV}` and `user_provided` references readable. Write behaviour for these paths is unchanged. - The experimental cluster entry boots from librechat.yaml only (`baseOnly`), like server/index.js, so `__base__` overrides no longer reach file storage, skill sync, skill deletion or the expired-file sweep at boot. * 🛡️ fix: Resolve Admin Config Write Read Access Before Committing - Section-scoped writes (PATCH, tombstone, field delete) resolve the caller's readable sections before the mutation, alongside the pre-write reads they already make, instead of after the write and audit have committed. The batched lookup covers every `configSchema` section, so it no longer waits on the stored document. - A failed grant lookup now fails the request before anything is stored, so a 500 never follows a committed write and invites a duplicate retry. Response filtering after the write is pure. - Assign-only scope creation and toggles match only empty documents (`expectEmpty`), so their responses skip the lookup entirely. * 🚩 feat: Report the Section Allowlist and Read-Filtered Write Responses in Config Meta - `GET /api/admin/config/meta` now reports `sectionAllowlist: true` and `readFilteredWriteResponses: true`, which this branch implements (BE-17, BE-18). - The meta.spec probes check each flag against the handlers rather than the validator alone: PUT answers `unknown_section` with `segments`, PATCH and tombstone answer `UNKNOWN_SECTION`, a stored `paths` override and tombstone are ignored at merge, and PATCH, tombstone and field delete responses omit a section the caller cannot read. - A dotted top-level key is reported once, as `dotted_key`, instead of also as `unknown_section`. - The unknown-section handler and integration tests expect the `segments` that issues carry since #17322. * 🧪 test: Type the Tombstoned Meta Probe Document Through storedConfig * 🧪 test: Align Allowlist and Filtered-Response Specs with Version-Checked Web Search Writes dev's version-checked webSearch writes pass a session and precondition to patchConfigFields/unsetConfigField, read the stored document before removing a binding path, and have getBaseConfig load the librechat.yaml config beside a merged read. The field delete spec now stores the document it removes from and asserts the precondition alongside the filtered response. * 🧪 test: Pin Section-Manager Write Responses to What a Read Shows The grant layer resolves read:configs:<section> from the same section's manage:configs:<section> (getParentCapabilities, #14472), so a section manager's GET already returns the whole managed section. The comment on resolveWriteReadAccess said the opposite; it now states the model. A new integration spec runs the handlers over real SystemGrant documents through generateCapabilityCheck: a caller holding only manage:configs:endpoints patches one endpoints field, and its write response equals what GET returns it, other endpoint overrides and tombstones included, with memory and webSearch left out of both. * 🧪 test: Mark Config-Service Generation Tests With a Schema Section The base-config generation tests that came with the portable config store marked each base config and override layer with an `x` key, which no section in `configSchema` defines. This branch dropped `x` from the spec's `TestConfig` and ignores such keys when overrides are merged, so those tests no longer typechecked, and the override-layer ones would stop seeing the layer they read. They now mark layers with the `version` section, as this branch's other service tests do. * 🧪 test: Expect the yamlMcpHide Flag Beside the Section Allowlist Flags #17327 publishes features.yamlMcpHide on dev, so the exact feature list this PR asserts in meta.spec now includes it. |
||
|---|---|---|
| .. | ||
| controllers | ||
| middleware | ||
| routes | ||
| services | ||
| utils | ||
| cleanup.js | ||
| csp.spec.js | ||
| experimental.js | ||
| experimental.spec.js | ||
| index.js | ||
| index.metrics.spec.js | ||
| index.spec.js | ||
| socialLogins.js | ||
| socialLogins.spec.js | ||
| telemetry.js | ||
| telemetry.spec.js | ||