diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-08-18 15:39:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-08-18 15:39:39 +0200 |
commit | 3194ccabc1fa0ed52d59167668a7f546dbdbf377 (patch) | |
tree | a397c944bf75c30c9cedf71b8d0117a11212575e /src/kyclogic/kyclogic_api.c | |
parent | cb27943f1443c38a4dcfde118207688eb049f13c (diff) | |
download | exchange-3194ccabc1fa0ed52d59167668a7f546dbdbf377.tar.xz |
untested draft of webhook logic for persona
Diffstat (limited to 'src/kyclogic/kyclogic_api.c')
-rw-r--r-- | src/kyclogic/kyclogic_api.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/kyclogic/kyclogic_api.c b/src/kyclogic/kyclogic_api.c index 18707a18f..303869804 100644 --- a/src/kyclogic/kyclogic_api.c +++ b/src/kyclogic/kyclogic_api.c @@ -294,6 +294,7 @@ load_logic (const struct GNUNET_CONFIGURATION_Handle *cfg, return NULL; } plugin->library_name = lib_name; + plugin->name = GNUNET_strdup (name); GNUNET_array_append (kyc_logics, num_kyc_logics, plugin); @@ -737,6 +738,7 @@ TALER_KYCLOGIC_kyc_done (void) struct TALER_KYCLOGIC_Plugin *lp = kyc_logics[i]; char *lib_name = lp->library_name; + GNUNET_free (lp->name); GNUNET_assert (NULL == GNUNET_PLUGIN_unload (lib_name, lp)); GNUNET_free (lib_name); @@ -1092,6 +1094,29 @@ TALER_KYCLOGIC_kyc_test_required (enum TALER_KYCLOGIC_KycTriggerEvent event, } +void +TALER_KYCLOGIC_kyc_get_details ( + const char *logic_name, + TALER_KYCLOGIC_DetailsCallback cb, + void *cb_cls) +{ + for (unsigned int i = 0; i<num_kyc_providers; i++) + { + struct TALER_KYCLOGIC_KycProvider *kp = kyc_providers[i]; + + if (0 != + strcmp (kp->logic->name, + logic_name)) + continue; + if (GNUNET_OK != + cb (cb_cls, + kp->pd, + kp->logic->cls)) + return; + } +} + + enum GNUNET_GenericReturnValue TALER_KYCLOGIC_kyc_get_logic (const char *provider_section_name, struct TALER_KYCLOGIC_Plugin **plugin, @@ -1109,6 +1134,18 @@ TALER_KYCLOGIC_kyc_get_logic (const char *provider_section_name, *pd = kp->pd; return GNUNET_OK; } + for (unsigned int i = 0; i<num_kyc_logics; i++) + { + struct TALER_KYCLOGIC_Plugin *logic = kyc_logics[i]; + + if (0 != + strcasecmp (logic->name, + provider_section_name)) + continue; + *plugin = logic; + *pd = NULL; + return GNUNET_OK; + } GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Provider `%s' unknown\n", provider_section_name); |