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