do not set the session_token header

this seems to be part of url now in signature v4
This commit is contained in:
Girish Ramakrishnan
2016-04-01 13:26:23 -07:00
parent 9ef04dc67f
commit 42fc2d446c
2 changed files with 2 additions and 17 deletions

View File

@@ -23,7 +23,7 @@ app_id="$1"
backup_url="$2"
backup_config_url="$3"
backup_key="$4"
session_token="$5"
session_token="$5" # unused since it seems to be part of the url query param in v4 signature
readonly now=$(date "+%Y-%m-%dT%H:%M:%S")
readonly app_data_dir="${DATA_DIR}/${app_id}"
readonly app_data_snapshot="${DATA_DIR}/snapshots/${app_id}-${now}"
@@ -36,11 +36,6 @@ for try in `seq 1 5`; do
headers=("-H" "Content-Type:")
# federated tokens in CaaS case need session token
if [ ! -z "$session_token" ]; then
headers=(${headers[@]} "-H" "x-amz-security-token: ${session_token}")
fi
if tar -cvzf - -C "${app_data_snapshot}" . \
| openssl aes-256-cbc -e -pass "pass:${backup_key}" \
| curl --fail -X PUT ${headers[@]} --data-binary @- "${backup_url}" 2>"${error_log}"; then
@@ -60,11 +55,6 @@ for try in `seq 1 5`; do
headers=("-H" "Content-Type:")
# federated tokens in CaaS case need session token
if [ ! -z "$session_token" ]; then
headers=(${headers[@]} "-H" "x-amz-security-token: ${session_token}")
fi
if cat "${app_data_snapshot}/config.json" \
| curl --fail -X PUT ${headers[@]} --data @- "${backup_config_url}" 2>"${error_log}"; then
break

View File

@@ -23,7 +23,7 @@ readonly curl="curl --fail --connect-timeout 20 --retry 10 --retry-delay 2 --max
app_id="$1"
restore_url="$2"
restore_key="$3"
session_token="$4"
session_token="$4" # unused since it seems to be part of the url query param in v4 signature
echo "Downloading backup: ${restore_url} and key: ${restore_key}"
@@ -33,11 +33,6 @@ for try in `seq 1 5`; do
headers=("") # empty element required (http://stackoverflow.com/questions/7577052/bash-empty-array-expansion-with-set-u)
# federated tokens in CaaS case need session token
if [[ ! -z "${session_token}" ]]; then
headers=(${headers[@]} "-H" "x-amz-security-token: ${session_token}")
fi
if $curl -L "${headers[@]}" "${restore_url}" \
| openssl aes-256-cbc -d -pass "pass:${restore_key}" \
| tar -zxf - -C "${DATA_DIR}/${app_id}" 2>"${error_log}"; then