-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Utkarsh Srivastava <[email protected]>
- Loading branch information
1 parent
778e5e8
commit ebd87db
Showing
13 changed files
with
257 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* Copyright (C) 2024 NooBaa */ | ||
'use strict'; | ||
|
||
/** | ||
* https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html | ||
*/ | ||
async function delete_public_access_block(req) { | ||
await req.object_sdk.delete_public_access_block({ name: req.params.bucket }); | ||
} | ||
|
||
module.exports = { | ||
handler: delete_public_access_block, | ||
body: { | ||
type: 'empty', | ||
}, | ||
reply: { | ||
type: 'empty', | ||
}, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* Copyright (C) 2024 NooBaa */ | ||
'use strict'; | ||
|
||
/** | ||
* https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html | ||
*/ | ||
async function get_public_access_block(req) { | ||
const reply = await req.object_sdk.get_public_access_block({ name: req.params.bucket }); | ||
if (!reply.public_access_block) { | ||
return { | ||
block_public_acls: false, | ||
ignore_public_acls: false, | ||
block_public_policy: false, | ||
restrict_public_buckets: false, | ||
}; | ||
} | ||
|
||
return { | ||
block_public_acls: Boolean(reply.public_access_block.block_public_acls), | ||
ignore_public_acls: Boolean(reply.public_access_block.ignore_public_acls), | ||
block_public_policy: Boolean(reply.public_access_block.block_public_policy), | ||
restrict_public_buckets: Boolean(reply.public_access_block.restrict_public_buckets), | ||
}; | ||
} | ||
|
||
module.exports = { | ||
handler: get_public_access_block, | ||
body: { | ||
type: 'empty' | ||
}, | ||
reply: { | ||
type: 'json', | ||
}, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters