mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-10-23 10:36:09 +00:00
🔧 chore: Allowlist AuditLog in the tenant-isolation coverage guard
The AuditLog collection carries a tenantId field but scopes tenancy manually inside listAuditLogPage / streamAuditLogEntries / recordAuditEntry using the same $exists: false convention as SystemGrant. The tenant-isolation plugin coverage spec now allows that and asserts it stays accurate.
This commit is contained in:
parent
945c77cf6f
commit
2bbcafecd7
1 changed files with 5 additions and 3 deletions
|
|
@ -13,10 +13,12 @@ const TENANT_ISOLATION_APPLIED = Symbol.for('librechat:tenantIsolation');
|
|||
* tenant-isolation plugin. SystemGrant scopes tenancy manually inside its
|
||||
* methods (see models/systemGrant). SkillSyncStatus stores both app-wide YAML
|
||||
* status rows and tenant-scoped override rows, so its methods apply explicit
|
||||
* tenant filters instead of ambient ALS scoping. Adding an entry here must be a
|
||||
* deliberate, reviewed decision — that is the whole point of this guard.
|
||||
* tenant filters instead of ambient ALS scoping. AuditLog composes its tenant
|
||||
* filter from the JWT-resolved caller and uses `{ tenantId: { $exists: false } }`
|
||||
* for platform-level entries. Adding an entry here must be a deliberate,
|
||||
* reviewed decision — that is the whole point of this guard.
|
||||
*/
|
||||
const MANUAL_TENANT_SCOPING = new Set<string>(['SystemGrant', 'SkillSyncStatus']);
|
||||
const MANUAL_TENANT_SCOPING = new Set<string>(['SystemGrant', 'SkillSyncStatus', 'AuditLog']);
|
||||
|
||||
function isPluginApplied(schema: mongoose.Schema): boolean {
|
||||
return (schema as unknown as { [key: symbol]: boolean })[TENANT_ISOLATION_APPLIED] === true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue