Skip to content

Commit 617231b

Browse files
committed
Block folder public toggle override
disable s3 integrity check
1 parent 8631555 commit 617231b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

app/src/controllers/bucket.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,7 @@ const controller = {
361361
userId: userId
362362
};
363363
// Update S3 Policy
364-
await storageService.updatePublic(data).catch((e) => {
365-
log.warn('Failed to apply permission changes to S3 ' + e, { function: 'togglePublic', ...data });
366-
});
364+
await storageService.updatePublic(data);
367365

368366
// Child bucket cannot be non-public when parent is public
369367
const parents = await bucketService.searchParentBuckets(bucket);

app/src/services/storage.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ const objectStorageService = {
8484
timeout: 30000
8585
}
8686
},
87-
region: region
87+
region: region,
88+
requestChecksumCalculation: 'WHEN_REQUIRED'
8889
});
8990
s3ClientCache.set(cacheKey, newClient);
9091
return newClient;
@@ -562,7 +563,7 @@ const objectStorageService = {
562563
`coms::${resource}`.startsWith(policy.Sid) &&
563564
`coms::${resource}` !== policy.Sid);
564565
if (parentPolicy) {
565-
throw new Error(`Unable to override Public status set on folder: ${parentPolicy.Resource}`);
566+
return Promise.reject(new Error(`Unable to override Public status set on path: ${parentPolicy.Resource}`));
566567
}
567568
} catch (e) {
568569
log.debug('No existing policy found', { function: 'updatePublic' });

0 commit comments

Comments
 (0)