Skip to content

Commit

Permalink
Attempt to fix basic authentication for AWS ECR
Browse files Browse the repository at this point in the history
Resolves: #159
  • Loading branch information
3XX0 committed Apr 19, 2024
1 parent 0d85f8d commit 6425a53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ common::curl() {
local rv=0 code=0 status=

exec {stdout}>&1
{ code=$(curl -o "/proc/self/fd/${stdout}" ${CURL_ERROUT+--stderr "/proc/self/fd/${stdout}"} -w '%{http_code}' "$@") || rv=$?; } {stdout}>&1
{ code=$(curl -o ${CURL_OUTPUT:-"/proc/self/fd/${stdout}"} ${CURL_ERROUT+--stderr "/proc/self/fd/${stdout}"} -w '%{http_code}' "$@") || rv=$?; } {stdout}>&1
exec {stdout}>&-

if [ "${code}" -ge 400 ] 2> /dev/null; then
Expand Down
2 changes: 1 addition & 1 deletion src/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ docker::_authenticate() {
;;
Basic)
# Check that we have valid credentials and save them if successful.
CURL_ERROUT=1 common::curl "${curl_opts[@]}" -w -G -v ${req_params[@]+"${req_params[@]}"} -- "${url}" \
CURL_ERROUT=1 CURL_OUTPUT=/dev/null common::curl "${curl_opts[@]}" -G -D - ${req_params[@]+"${req_params[@]}"} -- "${url}" \
| awk '/Authorization: Basic/ { sub(/\r/, "", $4); print $4 }' \
| common::read -r token
;;
Expand Down

0 comments on commit 6425a53

Please sign in to comment.