exchange

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

commit eb19447eaae40cf511f2f460490a9a5a6d9e167f
parent bc21c9bd6016912aa00a6fdd41bc1c05db84ed48
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue,  8 Oct 2024 20:09:45 +0200

return context in kyc-info

Diffstat:
Msrc/exchange/taler-exchange-httpd_kyc-info.c | 10+++++++---
Msrc/include/taler_kyclogic_lib.h | 2++
Msrc/kyclogic/kyclogic_api.c | 4++++
3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_kyc-info.c b/src/exchange/taler-exchange-httpd_kyc-info.c @@ -211,7 +211,7 @@ add_response_headers (void *cls, * @param[in,out] kyp request to reply on * @param legitimization_measure_row_id part of etag to set for the response * @param legitimization_outcome_row_id part of etag to set for the response - * @param jmeasures measures to encode + * @param jmeasures a `LegitimizationMeasures` object to encode * @param jvoluntary array of voluntary measures to encode, can be NULL * @return MHD status code */ @@ -222,7 +222,7 @@ generate_reply (struct KycPoller *kyp, const json_t *jmeasures, const json_t *jvoluntary) { - const json_t *measures; + const json_t *measures; /* array of MeasureInformation */ bool is_and_combinator = false; bool verboten; struct GNUNET_JSON_Specification spec[] = { @@ -241,7 +241,7 @@ generate_reply (struct KycPoller *kyp, unsigned int eline; json_t *kris; size_t i; - json_t *mi; + json_t *mi; /* a MeasureInformation object */ ret = GNUNET_JSON_parse (jmeasures, spec, @@ -261,11 +261,14 @@ generate_reply (struct KycPoller *kyp, { const char *check_name; const char *prog_name; + const json_t *context; struct GNUNET_JSON_Specification ispec[] = { GNUNET_JSON_spec_string ("check_name", &check_name), GNUNET_JSON_spec_string ("prog_name", &prog_name), + GNUNET_JSON_spec_object_const ("context", + &context), GNUNET_JSON_spec_end () }; json_t *kri; @@ -286,6 +289,7 @@ generate_reply (struct KycPoller *kyp, kri = TALER_KYCLOGIC_measure_to_requirement ( check_name, prog_name, + context, &kyp->access_token, i, legitimization_measure_row_id); diff --git a/src/include/taler_kyclogic_lib.h b/src/include/taler_kyclogic_lib.h @@ -570,6 +570,7 @@ TALER_KYCLOGIC_check_form ( * * @param check_name the prescribed check * @param prog_name the program to run + * @param context context to return, can be NULL * @param access_token access token for the measure * @param offset offset of the measure * @param legitimization_measure_row_id row in the legitimization_measures table @@ -579,6 +580,7 @@ json_t * TALER_KYCLOGIC_measure_to_requirement ( const char *check_name, const char *prog_name, + const json_t *context, const struct TALER_AccountAccessTokenP *access_token, size_t offset, uint64_t legitimization_measure_row_id); diff --git a/src/kyclogic/kyclogic_api.c b/src/kyclogic/kyclogic_api.c @@ -3020,6 +3020,7 @@ json_t * TALER_KYCLOGIC_measure_to_requirement ( const char *check_name, const char *prog_name, + const json_t *context, const struct TALER_AccountAccessTokenP *access_token, size_t offset, uint64_t legitimization_measure_row_id) @@ -3067,6 +3068,9 @@ TALER_KYCLOGIC_measure_to_requirement ( kc->details.form.name), GNUNET_JSON_pack_string ("id", xids), + GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_object_incref ("context", + (json_t *) context)), GNUNET_JSON_pack_string ("description", kc->description), GNUNET_JSON_pack_allow_null (