aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-08-25 10:43:52 +0200
committerChristian Grothoff <christian@grothoff.org>2024-08-25 10:43:52 +0200
commit7abd317b7b9b9abe096a60f364510b912b94bf48 (patch)
treea48a7aed05d1fbc364f10e3eb78bc3d38d4eca39
parent57e7b57f7dae7a203d7221e224f5a4c918431e11 (diff)
custom_measures is a mandatory field, check it exists and generate it in the helpers
-rw-r--r--src/kyclogic/kyclogic_api.c8
-rwxr-xr-xsrc/kyclogic/taler-exchange-helper-measure-freeze2
-rwxr-xr-xsrc/kyclogic/taler-exchange-helper-measure-test-form2
-rwxr-xr-xsrc/kyclogic/taler-exchange-helper-measure-test-oauth3
4 files changed, 10 insertions, 5 deletions
diff --git a/src/kyclogic/kyclogic_api.c b/src/kyclogic/kyclogic_api.c
index def2cbd29..3fb62d5fa 100644
--- 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
index 3505f5945..e3e03f6da 100755
--- 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
index ccddf346a..50b379df4 100755
--- 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
index 4d6c4a43a..994aadd99 100755
--- 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" : [
{