fix(storage): verify migration of exports up to one GiB

This commit is contained in:
2026-09-28 14:08:59 +02:00
parent e9b2e3e229
commit a3f4a7c004
4 changed files with 32 additions and 15 deletions

View File

@@ -15,7 +15,7 @@ const S3 = requireSdk('@aws-sdk/client-s3');
const { getSignedUrl } = requireSdk('@aws-sdk/s3-request-presigner');
// The pilot deliberately has a tested bound; no untested multipart conversion.
export const MAX_OBJECT_BYTES = 256 * 1024 * 1024;
export const MAX_OBJECT_BYTES = 1024 * 1024 * 1024;
export const MAX_OBJECTS = 200_000;
export const client = config => new S3.S3Client({ ...config, forcePathStyle: true, maxAttempts: 3 });
export const call = (s3, operation, input) => s3.send(new S3[`${operation}Command`](input));
@@ -45,7 +45,7 @@ export function validateKeys(objects) {
requireThat(!/[\x00-\x1f\x7f\\]/.test(key) && segments.every(s => s && s !== '.' && s !== '..'),
`Nicht verlustfrei übertragbarer Schlüssel: ${JSON.stringify(key)}`);
requireThat(Number.isSafeInteger(size) && size >= 0 && size <= MAX_OBJECT_BYTES,
`Objekt außerhalb der getesteten Größe (256 MiB): ${JSON.stringify(key)}`);
`Objekt außerhalb der getesteten Größe (${MAX_OBJECT_BYTES / 1024 / 1024} MiB): ${JSON.stringify(key)}`);
for (let i = 1; i < segments.length; i++) {
requireThat(!keys.has(segments.slice(0, i).join('/')), `Datei-/Verzeichniskonflikt: ${JSON.stringify(key)}`);
}