mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-18 14:08:21 +00:00
* 🔒 chore: Lint Out Three More Model APIs That Bypass Tenant Isolation Mongoose middleware is the only enforcement point for the tenant-isolation plugin, and `eslint.config.mjs` already bans the two model APIs known to skip it — `Model.bulkWrite()` and `Model.collection.*` — precisely because a downstream guard cannot see them. The driver-level probe review on #15578 surfaced three more in the same class: - `Model.bulkSave()` derives writes and delegates to `bulkWrite()` without running save or query middleware, so the plugin can neither stamp nor scope them. - `Model.watch()` opens a change stream outside query middleware, so it emits every tenant's events. - `Model.estimatedDocumentCount()` reads collection metadata and takes no filter, so it always returns the count across every tenant. None of the first two have a call site today; banning them at lint time closes the class preventively rather than detecting adoption after the fact, and does it without the replica-set harness a runtime test for `watch()` would need. `estimatedDocumentCount()` has exactly one caller, `syncWithMeili`, where a collection-wide estimate is the quantity wanted: it bounds a full-index sync and only feeds a progress log, and it runs from `indexSync()` at boot outside any tenant context. That call carries an inline disable with the reason, in the same form as the existing `no-restricted-syntax` exemptions. Verified with a throwaway fixture that all three selectors fire alongside the existing `bulkWrite` control (4 errors), and that `packages/data-schemas` lints clean under the new config. * chore: Enforce Tenant API Bans Across Backend Workspaces 🥅 * chore: Preserve Shared Bans in the Bulk-Write Wrapper 🥅 |
||
|---|---|---|
| .. | ||
| api | ||
| client | ||
| data-provider | ||
| data-schemas | ||