mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-04-25 17:58:35 +02:00
don't fail on nested json array in challenge info
This commit is contained in:
@@ -651,8 +651,8 @@ sign_csr() {
|
||||
fi
|
||||
|
||||
challenges="$(printf '%s\n' "${response}" | sed -n 's/.*\("challenges":[^\[]*\[[^]]*]\).*/\1/p')"
|
||||
repl=$'\n''{' # fix syntax highlighting in Vim
|
||||
challenge="$(printf "%s" "${challenges//\{/${repl}}" | grep \""${CHALLENGETYPE}"\")"
|
||||
challenge="$(<<<"${challenges}" _sed -e 's/^[^\[]+\[(.+)\]$/\1/' -e 's/\}(, (\{)|(\]))/}\'$'\n''\2/g' | grep \""${CHALLENGETYPE}"\")"
|
||||
|
||||
challenge_token="$(printf '%s' "${challenge}" | get_json_string_value token | _sed 's/[^A-Za-z0-9_\-]/_/g')"
|
||||
if [[ ${API} -eq 1 ]]; then
|
||||
challenge_uri="$(printf '%s' "${challenge}" | get_json_string_value uri)"
|
||||
|
||||
Reference in New Issue
Block a user