Skip to content

Commit 63832cd

Browse files
committed
Block folder public toggle override
disable s3 integrity check temporarily remove checkElevatedUser from bucket creation route
1 parent 8631555 commit 63832cd

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
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/routes/v1/bucket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ router.put('/',
2121
express.json(),
2222
bucketValidator.createBucket,
2323
checkS3BasicAccess,
24-
checkElevatedUser, // only allow elevated users to connect buckets and add folders
24+
// checkElevatedUser,
2525
(req, res, next) => {
2626
bucketController.createBucket(req, res, next);
2727
});

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)