Created
December 3, 2018 08:47
-
-
Save yuvalif/1a3f4195cf2314fedf652dc308b956cd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
set -ex | |
resource=$1 | |
host=localhost | |
parameters=$2 | |
port=$3 | |
dateValue=`date -Ru` | |
S3KEY=$SYSTEM_ACCESS_KEY | |
S3SECRET=$SYSTEM_SECRET_KEY | |
stringToSign="GET\n\n\n${dateValue}\n${resource}" | |
signature=`echo -en ${stringToSign} | openssl sha1 -hmac ${S3SECRET} -binary | base64` | |
curl -X GET \ | |
-H "Authorization: AWS ${S3KEY}:${signature}" \ | |
-H "Date: ${dateValue}" \ | |
-H "Host: ${host}:${port}" \ | |
http://${host}:${port}${resource}?${parameters} --verbose | |
echo -e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment