[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: nexus fetch: flag for extra EBICS logg
From: |
gnunet |
Subject: |
[libeufin] branch master updated: nexus fetch: flag for extra EBICS logging |
Date: |
Thu, 16 Nov 2023 16:38:38 +0100 |
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 4eb5992f nexus fetch: flag for extra EBICS logging
4eb5992f is described below
commit 4eb5992f951e4fb1ab1d1ec4c5c56a0e9142fef7
Author: MS <ms@taler.net>
AuthorDate: Thu Nov 16 16:38:08 2023 +0100
nexus fetch: flag for extra EBICS logging
---
.../src/main/kotlin/tech/libeufin/nexus/EbicsSubmit.kt | 17 ++++++++++++++---
.../src/main/kotlin/tech/libeufin/nexus/ebics/Ebics3.kt | 6 ++++--
.../kotlin/tech/libeufin/nexus/ebics/EbicsCommon.kt | 4 +++-
util/src/main/kotlin/ebics_h005/Ebics3Request.kt | 1 -
4 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSubmit.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSubmit.kt
index 47a895d8..6da3b526 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSubmit.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSubmit.kt
@@ -74,7 +74,12 @@ data class SubmissionContext(
/**
* Bank EBICS public keys.
*/
- val bankPublicKeysFile: BankPublicKeysFile
+ val bankPublicKeysFile: BankPublicKeysFile,
+
+ /**
+ * Causes EBICS messages to be logged to STDERR.
+ */
+ val ebicsExtraLog: Boolean = false
)
/**
@@ -232,6 +237,10 @@ class EbicsSubmit : CliktCommand("Submits any initiated
payment found in the dat
private val debug by option(
help = "Reads the pain.001 document from STDIN and submits it to the
bank"
).flag(default = false)
+
+ private val ebicsExtraLog by option(
+ help = "Logs init phase of uploaded EBICS messages to STDERR"
+ ).flag(default = false)
/**
* Submits any initiated payment that was not submitted
* so far and -- according to the configuration -- returns
@@ -260,7 +269,8 @@ class EbicsSubmit : CliktCommand("Submits any initiated
payment found in the dat
cfg = cfg,
bankPublicKeysFile = bankKeys,
clientPrivateKeysFile = clientKeys,
- httpClient = HttpClient()
+ httpClient = HttpClient(),
+ ebicsExtraLog = ebicsExtraLog
)
if (debug) {
logger.info("Running in debug mode, submitting STDIN to the bank")
@@ -272,7 +282,8 @@ class EbicsSubmit : CliktCommand("Submits any initiated
payment found in the dat
ctx.cfg,
ctx.clientPrivateKeysFile,
ctx.bankPublicKeysFile,
- ctx.httpClient
+ ctx.httpClient,
+ ctx.ebicsExtraLog
)
}
}
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/Ebics3.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/Ebics3.kt
index 578884c9..1928cef0 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/Ebics3.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/Ebics3.kt
@@ -212,7 +212,8 @@ suspend fun submitPain001(
cfg: EbicsSetupConfig,
clientKeys: ClientPrivateKeysFile,
bankkeys: BankPublicKeysFile,
- httpClient: HttpClient
+ httpClient: HttpClient,
+ ebicsExtraLog: Boolean = false
) {
val orderService: Ebics3Request.OrderDetails.Service =
Ebics3Request.OrderDetails.Service().apply {
serviceName = "MCT"
@@ -228,7 +229,8 @@ suspend fun submitPain001(
clientKeys,
bankkeys,
orderService,
- pain001xml.toByteArray(Charsets.UTF_8)
+ pain001xml.toByteArray(Charsets.UTF_8),
+ ebicsExtraLog
)
logger.debug("Payment submitted, report text is:
${maybeUploaded.reportText}," +
" EBICS technical code is: ${maybeUploaded.technicalReturnCode}," +
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsCommon.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsCommon.kt
index d58ce8cc..f539977c 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsCommon.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsCommon.kt
@@ -590,7 +590,8 @@ suspend fun doEbicsUpload(
clientKeys: ClientPrivateKeysFile,
bankKeys: BankPublicKeysFile,
orderService: Ebics3Request.OrderDetails.Service,
- payload: ByteArray
+ payload: ByteArray,
+ extraLog: Boolean = false
): EbicsResponseContent {
val preparedPayload = prepareUploadPayload(cfg, clientKeys, bankKeys,
payload, isEbics3 = true)
val initXml = createEbics3RequestForUploadInitialization(
@@ -600,6 +601,7 @@ suspend fun doEbicsUpload(
clientKeys,
orderService
)
+ if (extraLog) logger.debug(initXml)
val initResp = postEbics( // may throw EbicsEarlyException
client,
cfg,
diff --git a/util/src/main/kotlin/ebics_h005/Ebics3Request.kt
b/util/src/main/kotlin/ebics_h005/Ebics3Request.kt
index 5931c17e..d1e00fcb 100644
--- a/util/src/main/kotlin/ebics_h005/Ebics3Request.kt
+++ b/util/src/main/kotlin/ebics_h005/Ebics3Request.kt
@@ -440,7 +440,6 @@ class Ebics3Request {
bankEncPub: RSAPublicKey,
segmentsNumber: BigInteger,
aOrderService: OrderDetails.Service,
- // aOrderParams: OrderParamsEbics? = null
): Ebics3Request {
return Ebics3Request().apply {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: nexus fetch: flag for extra EBICS logging,
gnunet <=