Skip to content

Commit 745113d

Browse files
fix
1 parent afc6bce commit 745113d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

solutions/fully-configurable/scripts/es_metadata.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ USERNAME="$(echo "$INPUT_JSON" | jq -r '.username')"
1111
PASSWORD="$(echo "$INPUT_JSON" | jq -r '.password')" # pragma: allowlist secret
1212
CA_CERT_B64="$(echo "$INPUT_JSON" | jq -r '.ca_cert_b64')"
1313

14-
15-
BASIC_AUTH="$(printf '%s:%s' "$USERNAME" "$PASSWORD" | base64)" # pragma: allowlist secret
16-
14+
# Extract host for .netrc "machine" entry
15+
HOST="$(echo "$URL" | sed -E 's#^https?://([^/:]+).*#\1#')"
1716

1817
RESP="$(
1918
curl -sS --fail \
20-
-H "Authorization: Basic $BASIC_AUTH" \
19+
--netrc-file <(printf 'machine %s login %s password %s\n' \
20+
"$HOST" "$USERNAME" "$PASSWORD") \
2121
--cacert <(echo "$CA_CERT_B64" | base64 -d) \
2222
"$URL"
2323
)"

0 commit comments

Comments
 (0)