aboutsummaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_aml-decision.c
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-06-05 09:18:35 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2023-06-05 09:18:35 +0200
commit98b51edf496cdc14974690c9809f665f14858977 (patch)
treeeb48f666852c8df8b940d001bc0b0ef644df4a55 /src/exchange/taler-exchange-httpd_aml-decision.c
parentfb5bc18c588832747dfe299f9df1beb6645cf686 (diff)
parent8cc1edfe0aa77d3091f19aa87d06bb45c74b0128 (diff)
Merge branch 'master' into age-withdraw
Diffstat (limited to 'src/exchange/taler-exchange-httpd_aml-decision.c')
-rw-r--r--src/exchange/taler-exchange-httpd_aml-decision.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/exchange/taler-exchange-httpd_aml-decision.c b/src/exchange/taler-exchange-httpd_aml-decision.c
index 2830e54e..c1439adc 100644
--- a/src/exchange/taler-exchange-httpd_aml-decision.c
+++ b/src/exchange/taler-exchange-httpd_aml-decision.c
@@ -74,7 +74,7 @@ struct DecisionContext
/**
* KYC requirements imposed, NULL for none.
*/
- json_t *kyc_requirements;
+ const json_t *kyc_requirements;
};
@@ -261,8 +261,8 @@ TEH_handler_post_aml_decision (
GNUNET_JSON_spec_uint32 ("new_state",
&new_state32),
GNUNET_JSON_spec_mark_optional (
- GNUNET_JSON_spec_json ("kyc_requirements",
- &dc.kyc_requirements),
+ GNUNET_JSON_spec_array_const ("kyc_requirements",
+ &dc.kyc_requirements),
NULL),
GNUNET_JSON_spec_end ()
};
@@ -306,17 +306,6 @@ TEH_handler_post_aml_decision (
size_t index;
json_t *elem;
- if (! json_is_array (dc.kyc_requirements))
- {
- GNUNET_break_op (0);
- GNUNET_JSON_parse_free (spec);
- return TALER_MHD_reply_with_error (
- connection,
- MHD_HTTP_BAD_REQUEST,
- TALER_EC_GENERIC_PARAMETER_MALFORMED,
- "kyc_requirements must be an array");
- }
-
json_array_foreach (dc.kyc_requirements, index, elem)
{
const char *val;
@@ -324,7 +313,6 @@ TEH_handler_post_aml_decision (
if (! json_is_string (elem))
{
GNUNET_break_op (0);
- GNUNET_JSON_parse_free (spec);
return TALER_MHD_reply_with_error (
connection,
MHD_HTTP_BAD_REQUEST,
@@ -336,7 +324,6 @@ TEH_handler_post_aml_decision (
TALER_KYCLOGIC_check_satisfiable (val))
{
GNUNET_break_op (0);
- GNUNET_JSON_parse_free (spec);
return TALER_MHD_reply_with_error (
connection,
MHD_HTTP_BAD_REQUEST,
@@ -357,11 +344,9 @@ TEH_handler_post_aml_decision (
&make_aml_decision,
&dc))
{
- GNUNET_JSON_parse_free (spec);
return mhd_ret;
}
}
- GNUNET_JSON_parse_free (spec);
return TALER_MHD_reply_static (
connection,
MHD_HTTP_NO_CONTENT,