common::log INFO "Downloading noir bundle from $bundle_zip_url"
common::run curl -ks --user "$TUZ_NAME_FOR_ACCESS_ANALYZER_BINS:$TUZ_PWD_FOR_ACCESS_ANALYZER_BINS" --http1.1 --fail --location --retry 3 --output "$tool_dir/noir-bundle.zip" "$bundle_zip_url"
# --retry-connrefused <- unsupported by curl on some agents
###
common::log INFO "Downloading noir bundle from $bundle_zip_url"
#common::run curl --fail --location --retry 3 --retry-connrefused --output "$tool_dir/noir-bundle.zip" "$bundle_zip_url"
local -a curl_cmd=(curl -ks --http1.1 --fail --location --retry 3 --output "$tool_dir/noir-bundle.zip")
if [[ -n "${TUZ_NAME_FOR_ACCESS_ANALYZER_BINS:-}" || -n "${TUZ_PWD_FOR_ACCESS_ANALYZER_BINS:-}" ]]; then
[[ -n "${TUZ_NAME_FOR_ACCESS_ANALYZER_BINS:-}" ]] || common::die "TUZ_NAME_FOR_ACCESS_ANALYZER_BINS is required when TUZ_PWD_FOR_ACCESS_ANALYZER_BINS is set"
[[ -n "${TUZ_PWD_FOR_ACCESS_ANALYZER_BINS:-}" ]] || common::die "TUZ_PWD_FOR_ACCESS_ANALYZER_BINS is required when TUZ_NAME_FOR_ACCESS_ANALYZER_BINS is set"
common::log INFO "Using authenticated Noir bundle download credentials from TUZ_NAME_FOR_ACCESS_ANALYZER_BINS"
curl_cmd+=(--user "$TUZ_NAME_FOR_ACCESS_ANALYZER_BINS:$TUZ_PWD_FOR_ACCESS_ANALYZER_BINS")
else
common::log INFO "No Noir bundle download credentials provided; downloading without --user"
fi
common::run "${curl_cmd[@]}" "$bundle_zip_url"