exchange

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

commit 2a99f2e7abf0ae5fa5f7cd04589398b0ed7ea9a3
parent 93256675348e70b249cc9e622a7a2ffff9625f2e
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Sat, 15 Aug 2026 21:21:37 +0200

use provider name, not config section name

Diffstat:
Msrc/kyclogic/plugin_kyclogic_kycaid.c | 47+++++++++++++++++++++++++++++++----------------
Msrc/kyclogic/plugin_kyclogic_persona.c | 27+++++++++++++++++++++------
2 files changed, 52 insertions(+), 22 deletions(-)

diff --git a/src/kyclogic/plugin_kyclogic_kycaid.c b/src/kyclogic/plugin_kyclogic_kycaid.c @@ -77,6 +77,13 @@ struct TALER_KYCLOGIC_ProviderDetails char *section; /** + * Name of the provider, that is @e section without + * the "kyc-provider-" prefix. This is the name used + * in the database. + */ + char *provider_name; + + /** * Authorization token to use when talking * to the service. */ @@ -308,6 +315,7 @@ kycaid_unload_configuration (struct TALER_KYCLOGIC_ProviderDetails *pd) GNUNET_free (pd->auth_token); GNUNET_free (pd->form_id); GNUNET_free (pd->section); + GNUNET_free (pd->provider_name); GNUNET_free (pd); } @@ -329,6 +337,13 @@ kycaid_load_configuration (void *cls, pd = GNUNET_new (struct TALER_KYCLOGIC_ProviderDetails); pd->ps = ps; pd->section = GNUNET_strdup (provider_section_name); + pd->provider_name + = GNUNET_strdup ( + (0 == strncasecmp (provider_section_name, + "kyc-provider-", + strlen ("kyc-provider-"))) + ? &provider_section_name[strlen ("kyc-provider-")] + : provider_section_name); if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (ps->cfg, provider_section_name, @@ -715,7 +730,7 @@ proof_reply (void *cls) } ph->cb (ph->cb_cls, TALER_KYCLOGIC_STATUS_PROVIDER_FAILED, - ph->pd->section, + ph->pd->provider_name, NULL, /* user id */ NULL, /* provider legi ID */ GNUNET_TIME_UNIT_ZERO_ABS, /* expiration */ @@ -885,7 +900,7 @@ webhook_conversion_cb (void *cls, wh->process_row, &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, wh->applicant_id, wh->verification_id, TALER_KYCLOGIC_STATUS_PROVIDER_FAILED, @@ -916,7 +931,7 @@ webhook_conversion_cb (void *cls, wh->process_row, &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, wh->applicant_id, wh->verification_id, TALER_KYCLOGIC_STATUS_PROVIDER_FAILED, @@ -947,7 +962,7 @@ webhook_conversion_cb (void *cls, wh->process_row, &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, wh->applicant_id, wh->verification_id, TALER_KYCLOGIC_STATUS_PROVIDER_FAILED, @@ -966,7 +981,7 @@ webhook_conversion_cb (void *cls, wh->process_row, &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, wh->applicant_id, wh->verification_id, TALER_KYCLOGIC_STATUS_SUCCESS, @@ -1031,7 +1046,7 @@ handle_webhook_finished (void *cls, wh->process_row, &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, wh->applicant_id, wh->verification_id, ks, @@ -1069,7 +1084,7 @@ handle_webhook_finished (void *cls, wh->process_row, &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, wh->applicant_id, wh->verification_id, TALER_KYCLOGIC_STATUS_INTERNAL_ERROR, @@ -1100,7 +1115,7 @@ handle_webhook_finished (void *cls, wh->process_row, &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, wh->applicant_id, wh->verification_id, TALER_KYCLOGIC_STATUS_PROVIDER_FAILED, @@ -1123,7 +1138,7 @@ handle_webhook_finished (void *cls, wh->process_row, &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, wh->applicant_id, wh->verification_id, TALER_KYCLOGIC_STATUS_PROVIDER_FAILED, @@ -1142,7 +1157,7 @@ handle_webhook_finished (void *cls, wh->process_row, &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, wh->applicant_id, wh->verification_id, TALER_KYCLOGIC_STATUS_PROVIDER_FAILED, @@ -1169,7 +1184,7 @@ handle_webhook_finished (void *cls, wh->process_row, &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, wh->applicant_id, wh->verification_id, TALER_KYCLOGIC_STATUS_PROVIDER_FAILED, @@ -1188,7 +1203,7 @@ handle_webhook_finished (void *cls, wh->process_row, &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, wh->applicant_id, wh->verification_id, TALER_KYCLOGIC_STATUS_PROVIDER_FAILED, @@ -1207,7 +1222,7 @@ handle_webhook_finished (void *cls, wh->process_row, &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, wh->applicant_id, wh->verification_id, TALER_KYCLOGIC_STATUS_PROVIDER_FAILED, @@ -1234,7 +1249,7 @@ handle_webhook_finished (void *cls, wh->process_row, &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, wh->applicant_id, wh->verification_id, TALER_KYCLOGIC_STATUS_PROVIDER_FAILED, @@ -1265,7 +1280,7 @@ async_webhook_reply (void *cls) ? NULL : &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, wh->applicant_id, /* provider user ID */ wh->verification_id, /* provider legi ID */ TALER_KYCLOGIC_STATUS_PROVIDER_FAILED, @@ -1399,7 +1414,7 @@ kycaid_webhook (void *cls, return wh; } qs = plc (plc_cls, - pd->section, + pd->provider_name, verification_id, &wh->h_payto, &wh->is_wallet, diff --git a/src/kyclogic/plugin_kyclogic_persona.c b/src/kyclogic/plugin_kyclogic_persona.c @@ -91,6 +91,13 @@ struct TALER_KYCLOGIC_ProviderDetails char *section; /** + * Name of the provider, that is @e section without + * the "kyc-provider-" prefix. This is the name used + * in the database. + */ + char *provider_name; + + /** * Salt to use for idempotency. */ char *salt; @@ -385,6 +392,7 @@ persona_unload_configuration (struct TALER_KYCLOGIC_ProviderDetails *pd) GNUNET_free (pd->conversion_binary); GNUNET_free (pd->salt); GNUNET_free (pd->section); + GNUNET_free (pd->provider_name); GNUNET_free (pd->post_kyc_redirect_url); GNUNET_free (pd); } @@ -407,6 +415,13 @@ persona_load_configuration (void *cls, pd = GNUNET_new (struct TALER_KYCLOGIC_ProviderDetails); pd->ps = ps; pd->section = GNUNET_strdup (provider_section_name); + pd->provider_name + = GNUNET_strdup ( + (0 == strncasecmp (provider_section_name, + "kyc-provider-", + strlen ("kyc-provider-"))) + ? &provider_section_name[strlen ("kyc-provider-")] + : provider_section_name); if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (ps->cfg, provider_section_name, @@ -970,7 +985,7 @@ proof_generic_reply (struct TALER_KYCLOGIC_ProofHandle *ph, } ph->cb (ph->cb_cls, status, - ph->pd->section, + ph->pd->provider_name, account_id, inquiry_id, GNUNET_TIME_UNIT_ZERO_ABS, @@ -1127,7 +1142,7 @@ proof_post_conversion_cb (void *cls, false); ph->cb (ph->cb_cls, TALER_KYCLOGIC_STATUS_SUCCESS, - ph->pd->section, + ph->pd->provider_name, ph->account_id, ph->inquiry_id, expiration, @@ -1628,7 +1643,7 @@ webhook_generic_reply (struct TALER_KYCLOGIC_WebhookHandle *wh, wh->process_row, &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, account_id, inquiry_id, status, @@ -1699,7 +1714,7 @@ webhook_post_conversion_cb (void *cls, wh->process_row, &wh->h_payto, wh->is_wallet, - wh->pd->section, + wh->pd->provider_name, NULL, wh->inquiry_id, TALER_KYCLOGIC_STATUS_PROVIDER_FAILED, @@ -2008,7 +2023,7 @@ async_webhook_reply (void *cls) : &wh->h_payto, wh->is_wallet, (NULL != wh->pd) - ? wh->pd->section + ? wh->pd->provider_name : "<unknown>", NULL, wh->inquiry_id, /* provider legi ID */ @@ -2237,7 +2252,7 @@ persona_webhook (void *cls, return wh; } qs = plc (plc_cls, - wh->pd->section, + wh->pd->provider_name, persona_inquiry_id, &wh->h_payto, &wh->is_wallet,