exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit a19a146628156a3541f8f46286c03c2e6e1e28d8
parent a9b6204518b748356f05ed3b7cb1ddecd0bd55b5
Author: Florian Dold <florian@dold.me>
Date:   Tue,  6 May 2025 03:18:58 +0200

fix more quoting issues

Diffstat:
Msrc/kyclogic/taler-exchange-helper-measure-clear-continue | 12++++++------
Msrc/kyclogic/taler-exchange-helper-measure-inform-investigate | 0
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/kyclogic/taler-exchange-helper-measure-clear-continue b/src/kyclogic/taler-exchange-helper-measure-clear-continue @@ -94,14 +94,14 @@ INPUTS=$(jq '{"current_rules":.current_rules,"attributes":.attributes,"context": # Get current rules. CURRENT_RULES=$(echo "$INPUTS" | jq '.current_rules // null') # Get context values. -NEXT_CONTEXT=$(echo "$INPUTS" | jq '.context.next_context // {}') -EXEC_NAME=$(echo "$INPUTS" | jq '.context.exec_name') +J_NEXT_CONTEXT=$(echo "$INPUTS" | jq '.context.next_context // {}') +EXEC_NAME=$(echo "$INPUTS" | jq -r '.context.exec_name') CLEAR_MEASURE=$(echo "$INPUTS" | jq '.context.clear_measure // null') # Remove matching measure from current rules. -NEW_RULES=$(echo "$CURRENT_RULES" | jq '(.rules[] |= if (.measures[0]=="'"${CLEAR_MEASURE}"'") then del(.) else . end)') +J_NEW_RULES=$(echo "$CURRENT_RULES" | jq --argjson cm "$CLEAR_MEASURE" '(.rules[] |= if (.measures[0]==$cm) then del(.) else . end)') -echo "Passing new rules ${NEW_RULES} to ${EXEC_NAME}." 1>&2 +echo "Passing new rules ${J_NEW_RULES} to ${EXEC_NAME}." 1>&2 # FIXME: we might want to restrict EXEC_NAME to binaries # with a certain prefix and/or even validate that it is @@ -111,7 +111,7 @@ echo "Passing new rules ${NEW_RULES} to ${EXEC_NAME}." 1>&2 # Finally, pass the new rules as input to the AML program '$EXEC_NAME'. jq -n \ - --argjson nc "$NEXT_CONTEXT" \ - --argjson nr "$NEW_RULES" \ + --argjson nc "$J_NEXT_CONTEXT" \ + --argjson nr "$J_NEW_RULES" \ '{"current_rules":$nr,"context":$nc}' \ | exec "${EXEC_NAME}" diff --git a/src/kyclogic/taler-exchange-helper-measure-inform-investigate b/src/kyclogic/taler-exchange-helper-measure-inform-investigate