🧾 fix: Harden Historical File Authorization (#13918)

* fix: Harden historical file authorization

* chore: Sort file authorization imports

* fix: Preserve authorized historical artifact refs

* chore: Format historical artifact hardening
This commit is contained in:
Danny Avila 2026-06-23 15:49:57 -04:00 committed by GitHub
parent 606292c5c5
commit 1eb460eb03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 755 additions and 74 deletions

View file

@ -1034,7 +1034,11 @@ const processOpenAIFile = async ({
await db.createFile(file, true);
} else if (updateUsage) {
try {
await db.updateFileUsage({ file_id });
await db.updateFileUsage({
file_id,
user: userId,
tenantId: openai.req?.user?.tenantId,
});
} catch (error) {
logger.error('Error updating file usage', error);
}