-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #662 from versity/test_cmdline_policy_multipart
Test cmdline policy multipart
- Loading branch information
Showing
10 changed files
with
500 additions
and
212 deletions.
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
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,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
get_bucket_ownership_controls() { | ||
if [[ $# -ne 1 ]]; then | ||
log 2 "'get bucket ownership controls' command requires bucket name" | ||
return 1 | ||
fi | ||
|
||
if ! raw_bucket_ownership_controls=$(aws --no-verify-ssl s3api get-bucket-ownership-controls --bucket "$1" 2>&1); then | ||
log 2 "error getting bucket ownership controls: $raw_bucket_ownership_controls" | ||
return 1 | ||
fi | ||
|
||
log 5 "Raw bucket Ownership Controls: $raw_bucket_ownership_controls" | ||
bucket_ownership_controls=$(echo "$raw_bucket_ownership_controls" | grep -v "InsecureRequestWarning") | ||
export bucket_ownership_controls | ||
return 0 | ||
} | ||
|
||
get_object_ownership_rule() { | ||
if [[ $# -ne 1 ]]; then | ||
log 2 "'get object ownership rule' command requires bucket name" | ||
return 1 | ||
fi | ||
if ! get_bucket_ownership_controls "$1"; then | ||
log 2 "error getting bucket ownership controls" | ||
return 1 | ||
fi | ||
if ! object_ownership_rule=$(echo "$bucket_ownership_controls" | jq -r ".OwnershipControls.Rules[0].ObjectOwnership" 2>&1); then | ||
log 2 "error getting object ownership rule: $object_ownership_rule" | ||
return 1 | ||
fi | ||
log 5 "object ownership rule: $object_ownership_rule" | ||
export object_ownership_rule | ||
return 0 | ||
} |
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
Oops, something went wrong.