gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: handle conversion helper errors


From: gnunet
Subject: [taler-exchange] branch master updated: handle conversion helper errors better
Date: Sun, 12 Nov 2023 15:13:38 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 2359d8ae handle conversion helper errors better
2359d8ae is described below

commit 2359d8ae29b48f0280b1002a2dd0d1ba28bea0c6
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Nov 12 15:13:35 2023 +0100

    handle conversion helper errors better
---
 contrib/gana                           |  2 +-
 src/include/taler_kyclogic_plugin.h    |  8 +++++++-
 src/kyclogic/plugin_kyclogic_kycaid.c  | 29 +++++++++++++++++++++++++----
 src/kyclogic/plugin_kyclogic_oauth2.c  | 14 ++++++++++++++
 src/kyclogic/plugin_kyclogic_persona.c | 23 +++++++++++++++++++++++
 5 files changed, 70 insertions(+), 6 deletions(-)

diff --git a/contrib/gana b/contrib/gana
index d610d189..78712599 160000
--- a/contrib/gana
+++ b/contrib/gana
@@ -1 +1 @@
-Subproject commit d610d18984a87b2bde50778c2186f03baf83ec21
+Subproject commit 78712599c45ec873829c5111ee2f95116548baed
diff --git a/src/include/taler_kyclogic_plugin.h 
b/src/include/taler_kyclogic_plugin.h
index 22e4f894..a9a4dd97 100644
--- a/src/include/taler_kyclogic_plugin.h
+++ b/src/include/taler_kyclogic_plugin.h
@@ -99,7 +99,13 @@ enum TALER_KYCLOGIC_KycStatus
    * Return code set to not update the KYC status
    * at all.
    */
-  TALER_KYCLOGIC_STATUS_KEEP = 16
+  TALER_KYCLOGIC_STATUS_KEEP = 16,
+
+  /**
+   * We had an internal logic failure.
+   */
+  TALER_KYCLOGIC_STATUS_INTERNAL_ERROR = 32
+
 };
 
 
diff --git a/src/kyclogic/plugin_kyclogic_kycaid.c 
b/src/kyclogic/plugin_kyclogic_kycaid.c
index b1b9f0a4..726ba7ea 100644
--- a/src/kyclogic/plugin_kyclogic_kycaid.c
+++ b/src/kyclogic/plugin_kyclogic_kycaid.c
@@ -361,10 +361,10 @@ kycaid_load_configuration (void *cls,
     return NULL;
   }
   if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_get_value_filename (ps->cfg,
-                                               provider_section_name,
-                                               "KYC_KYCAID_CONVERTER_HELPER",
-                                               &pd->conversion_helper))
+      GNUNET_CONFIGURATION_get_value_string (ps->cfg,
+                                             provider_section_name,
+                                             "KYC_KYCAID_CONVERTER_HELPER",
+                                             &pd->conversion_helper))
   {
     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
                                provider_section_name,
@@ -968,6 +968,27 @@ handle_webhook_finished (void *cls,
             "-a",
             wh->pd->auth_token,
             NULL);
+      if (NULL == wh->econ)
+      {
+        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                    "Failed to start KYCAID conversion helper `%s'\n",
+                    wh->pd->conversion_helper);
+        resp = TALER_MHD_make_error (
+          TALER_EC_EXCHANGE_GENERIC_KYC_CONVERTER_FAILED,
+          NULL);
+        wh->cb (wh->cb_cls,
+                wh->process_row,
+                &wh->h_payto,
+                wh->pd->section,
+                wh->applicant_id,
+                wh->verification_id,
+                TALER_KYCLOGIC_STATUS_INTERNAL_ERROR,
+                GNUNET_TIME_UNIT_ZERO_ABS, /* expiration */
+                NULL,
+                MHD_HTTP_INTERNAL_SERVER_ERROR,
+                resp);
+        break;
+      }
       return;
     }
     break;
diff --git a/src/kyclogic/plugin_kyclogic_oauth2.c 
b/src/kyclogic/plugin_kyclogic_oauth2.c
index 5ef1330a..7c57b5ae 100644
--- a/src/kyclogic/plugin_kyclogic_oauth2.c
+++ b/src/kyclogic/plugin_kyclogic_oauth2.c
@@ -1023,6 +1023,20 @@ parse_proof_success_reply (struct 
TALER_KYCLOGIC_ProofHandle *ph,
     pd->conversion_binary,
     pd->conversion_binary,
     NULL);
+  if (NULL == ph->ec)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "Failed to start KYCAID conversion helper `%s'\n",
+                pd->conversion_binary);
+    ph->status = TALER_KYCLOGIC_STATUS_INTERNAL_ERROR;
+    ph->response
+      = TALER_MHD_make_error (
+          TALER_EC_EXCHANGE_GENERIC_KYC_CONVERTER_FAILED,
+          "Failed to launch KYC conversion helper");
+    ph->http_status
+      = MHD_HTTP_INTERNAL_SERVER_ERROR;
+    return;
+  }
 }
 
 
diff --git a/src/kyclogic/plugin_kyclogic_persona.c 
b/src/kyclogic/plugin_kyclogic_persona.c
index 7568af1f..2183c612 100644
--- a/src/kyclogic/plugin_kyclogic_persona.c
+++ b/src/kyclogic/plugin_kyclogic_persona.c
@@ -1257,6 +1257,20 @@ handle_proof_finished (void *cls,
                                    j,
                                    &proof_post_conversion_cb,
                                    ph);
+        if (NULL == ph->ec)
+        {
+          GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                      "Failed to start Persona conversion helper\n");
+          proof_reply_error (
+            ph,
+            ph->inquiry_id,
+            MHD_HTTP_BAD_GATEWAY,
+            "persona-logic-failure",
+            GNUNET_JSON_PACK (
+              TALER_JSON_pack_ec (
+                TALER_EC_EXCHANGE_GENERIC_KYC_CONVERTER_FAILED)));
+          break;
+        }
       }
       return; /* continued in proof_post_conversion_cb */
     }
@@ -1771,6 +1785,15 @@ handle_webhook_finished (void *cls,
                                    j,
                                    &webhook_post_conversion_cb,
                                    wh);
+        if (NULL == wh->ec)
+        {
+          GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                      "Failed to start Persona conversion helper\n");
+          webhook_reply_error (wh,
+                               inquiry_id,
+                               MHD_HTTP_INTERNAL_SERVER_ERROR);
+          break;
+        }
       }
       return; /* continued in webhook_post_conversion_cb */
     }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]