gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: Respond 500 when bank rotates keys.


From: gnunet
Subject: [libeufin] branch master updated: Respond 500 when bank rotates keys.
Date: Wed, 28 Jul 2021 13:55:51 +0200

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

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new a881a80  Respond 500 when bank rotates keys.
a881a80 is described below

commit a881a80f62e943fd5638b0d9ece83a3952cbae2c
Author: ms <ms@taler.net>
AuthorDate: Wed Jul 28 13:55:25 2021 +0200

    Respond 500 when bank rotates keys.
---
 .../kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt  |  1 -
 .../kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt   | 20 ++++++++++++--------
 util/src/main/kotlin/Ebics.kt                        | 12 +++++++-----
 3 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt
index d3ab535..65caf51 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt
@@ -81,7 +81,6 @@ suspend fun doEbicsDownloadTransaction(
     val initDownloadRequestStr = 
createEbicsRequestForDownloadInitialization(subscriberDetails, orderType, 
orderParams)
     val payloadChunks = LinkedList<String>()
     val initResponseStr = client.postToBank(subscriberDetails.ebicsUrl, 
initDownloadRequestStr)
-
     val initResponse = parseAndValidateEbicsResponse(subscriberDetails, 
initResponseStr)
 
     when (initResponse.technicalReturnCode) {
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
index 18f5848..2bbadbe 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
@@ -391,7 +391,6 @@ fun formatHex(ba: ByteArray): String {
 }
 
 class EbicsBankConnectionProtocol: BankConnectionProtocol {
-
     override suspend fun fetchTransactions(
         fetchSpec: FetchSpecJson,
         client: HttpClient,
@@ -478,13 +477,18 @@ class EbicsBankConnectionProtocol: BankConnectionProtocol 
{
                 }
             }
         }
-        for (spec in specs) {
-            try {
-                fetchEbicsC5x(spec.orderType, client, bankConnectionId, 
spec.orderParams, subscriberDetails)
-            } catch (e: Exception) {
-                logger.warn("Ingestion failed for $spec")
-            }
-        }
+        /* Not handling errors here because
+          sub-calls should throw and get caught by
+          global handlers.
+         */
+        for (spec in specs)
+            fetchEbicsC5x(
+                spec.orderType,
+                client,
+                bankConnectionId,
+                spec.orderParams,
+                subscriberDetails
+            )
     }
 
     override suspend fun submitPaymentInitiation(httpClient: HttpClient, 
paymentInitiationId: Long) {
diff --git a/util/src/main/kotlin/Ebics.kt b/util/src/main/kotlin/Ebics.kt
index 97eb54e..7926bad 100644
--- a/util/src/main/kotlin/Ebics.kt
+++ b/util/src/main/kotlin/Ebics.kt
@@ -440,19 +440,21 @@ fun parseAndValidateEbicsResponse(
     } catch (e: Exception) {
         throw EbicsProtocolError(
             HttpStatusCode.InternalServerError,
-            "Invalid XML (as EbicsResponse) received from bank: $responseStr"
+            "Invalid XML (as EbicsResponse) received from bank"
         )
     }
-
     if (!XMLUtil.verifyEbicsDocument(
             responseDocument,
             subscriberDetails.bankAuthPub ?: throw EbicsProtocolError(
-                HttpStatusCode.BadRequest,
-                "Invalid subscriber state: bankAuthPub missing, please send 
HPB first"
+                HttpStatusCode.InternalServerError,
+                "Bank's signature verification failed"
             )
         )
     ) {
-        throw EbicsProtocolError(HttpStatusCode.InternalServerError, "Bank's 
signature validation failed")
+        throw EbicsProtocolError(
+            HttpStatusCode.InternalServerError,
+            "Bank's signature verification failed"
+        )
     }
     val resp = try {
         XMLUtil.convertStringToJaxb<EbicsResponse>(responseStr)

-- 
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]