exchange

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

commit 7abd317b7b9b9abe096a60f364510b912b94bf48
parent 57e7b57f7dae7a203d7221e224f5a4c918431e11
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 25 Aug 2024 10:43:52 +0200

custom_measures is a mandatory field, check it exists and generate it in the helpers

Diffstat:
Msrc/kyclogic/kyclogic_api.c | 8+++-----
Msrc/kyclogic/taler-exchange-helper-measure-freeze | 2++
Msrc/kyclogic/taler-exchange-helper-measure-test-form | 2++
Msrc/kyclogic/taler-exchange-helper-measure-test-oauth | 3+++
4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/kyclogic/kyclogic_api.c b/src/kyclogic/kyclogic_api.c @@ -495,7 +495,7 @@ TALER_KYCLOGIC_rules_parse (const json_t *jlrs) struct GNUNET_TIME_Timestamp expiration_time; const char *successor_measure = NULL; const json_t *jrules; - const json_t *jcustom_measures = NULL; + const json_t *jcustom_measures; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_timestamp ( "expiration_time", @@ -507,10 +507,8 @@ TALER_KYCLOGIC_rules_parse (const json_t *jlrs) NULL), GNUNET_JSON_spec_array_const ("rules", &jrules), - GNUNET_JSON_spec_mark_optional ( - GNUNET_JSON_spec_object_const ("custom_measures", - &jcustom_measures), - NULL), + GNUNET_JSON_spec_object_const ("custom_measures", + &jcustom_measures), GNUNET_JSON_spec_end () }; struct TALER_KYCLOGIC_LegitimizationRuleSet *lrs; diff --git a/src/kyclogic/taler-exchange-helper-measure-freeze b/src/kyclogic/taler-exchange-helper-measure-freeze @@ -85,11 +85,13 @@ EXPIRATION=$((3600 * 30 + $(date +%s))) # See https://docs.taler.net/taler-exchange-manual.html#tsref-type-AmlOutcome # for the required output format. +# NOTE: new_check is not yet supported! jq -n \ --arg expiration "$EXPIRATION" \ '{ "to_investigate": true, "new_rules" : { "new_check" : "info-frozen", + "custom_measures" : {}, "expiration_time" : { "t_s": $expiration }, "rules" : [ { diff --git a/src/kyclogic/taler-exchange-helper-measure-test-form b/src/kyclogic/taler-exchange-helper-measure-test-form @@ -102,12 +102,14 @@ CURRENCY=$(taler-config -c $CONF -s taler -o currency) # See https://docs.taler.net/taler-exchange-manual.html#tsref-type-AmlOutcome # for the required output format. +# NOTE: new_check is not yet supported! jq -n \ --argjson expiration "$EXPIRATION" \ --arg currency "$CURRENCY" \ '{ "to_investigate": false, "new_rules" : { "new_check" : "info-oauth-test-passed", + "custom_measures" : {}, "expiration_time" : { "t_s": $expiration }, "rules" : [ { diff --git a/src/kyclogic/taler-exchange-helper-measure-test-oauth b/src/kyclogic/taler-exchange-helper-measure-test-oauth @@ -98,11 +98,14 @@ EXPIRATION=$((3600 * 30 + $(date +%s))) # See https://docs.taler.net/taler-exchange-manual.html#tsref-type-AmlOutcome # for the required output format. +# NOTE: new_check is not yet supported! + jq -n \ --argjson expiration "$EXPIRATION" \ '{ "to_investigate": false, "new_rules" : { "new_check" : "info-oauth-test-passed", + "custom_measures" : {}, "expiration_time" : { "t_s": $expiration }, "rules" : [ {