Refresh HiveGrid Cloud reference snapshot

This commit is contained in:
david committed 2026-08-03 15:31:14 +02:00
1 parent 5e99e14772
commit 7f88026f79
5955 files changed
+1177325 -188362

No files matched your search

@@ -11,6 +11,8 @@ import { assertFileKeyBelongsToTenant } from "@hivegrid/storage";
import { loadFilesContext } from "~/utils/integrations/fileAccess.server";
import { getVisibleFileOrThrow } from "~/utils/integrations/fileService.server";
import { createMediaDownloadUrl } from "~/utils/integrations/mediaSigning.server";
import { isFileScanDeliverable } from "~/utils/integrations/fileScanPolicy";
import { recordAuthorizedStorageDownload } from "~/lib/metrics/storage-traffic";
type MediaVariant = "original" | "preview" | "thumb";
@@ -38,15 +40,14 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
let file;
try {
file = await getVisibleFileOrThrow(ctx.tenantId, fileId, { userId: ctx.userId, permissions: ctx.permissions });
file = await getVisibleFileOrThrow(ctx.tenantId, fileId, ctx);
} catch {
// CatalogError(notFound) for missing/invisible -> 404, no info leak.
return notFound();
}
// Fail-closed: only deliver once the scan verdict is clean (or scanning was
// skipped in dev). Pending/infected -> refuse.
if (file.scanStatus !== "clean" && file.scanStatus !== "skipped") {
// Fail closed: only an explicit clean scanner verdict is deliverable.
if (!isFileScanDeliverable(file.scanStatus)) {
return notFound();
}
@@ -69,5 +70,10 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
}
const url = await createMediaDownloadUrl({ key, filename: variant === "original" ? file.displayName : undefined });
recordAuthorizedStorageDownload({
surface: "files",
delivery: "signed_redirect",
objectSizeBytes: variant === "original" ? file.sizeBytes : null,
});
return redirect(url, 302);
};