summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine A <>2024-01-23 21:28:35 +0100
committerAntoine A <>2024-01-23 21:28:35 +0100
commit047d2d36186fdfa7142d42e867dbb5713ad226b3 (patch)
treec6f1eaafd71a4f3a32726b9042c6f75c7e9c692a
parent5441ffc36fc9273cd0eb359b9908ed6e6fb34e1e (diff)
downloadlibeufin-047d2d36186fdfa7142d42e867dbb5713ad226b3.tar.gz
libeufin-047d2d36186fdfa7142d42e867dbb5713ad226b3.tar.bz2
libeufin-047d2d36186fdfa7142d42e867dbb5713ad226b3.zip
Puth ebics keys in LIBEUFIN_NEXUS_HOMEv0.9.4-dev5v0.9.4-dev.5
-rw-r--r--contrib/nexus.conf6
-rw-r--r--nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt7
-rw-r--r--testbench/conf/netzbon.conf7
-rw-r--r--testbench/conf/postfinance.conf7
-rw-r--r--testbench/src/main/kotlin/Main.kt4
5 files changed, 17 insertions, 14 deletions
diff --git a/contrib/nexus.conf b/contrib/nexus.conf
index 796419ff..e2da3af8 100644
--- a/contrib/nexus.conf
+++ b/contrib/nexus.conf
@@ -1,3 +1,5 @@
+[paths]
+LIBEUFIN_NEXUS_HOME = /var/lib/libeufin-nexus
[nexus-ebics]
@@ -24,10 +26,10 @@ BIC = POFICHBE
NAME = LibEuFin
# File that holds the bank EBICS keys.
-BANK_PUBLIC_KEYS_FILE = bank-ebics-keys.json
+BANK_PUBLIC_KEYS_FILE = ${LIBEUFIN_NEXUS_HOME}/bank-ebics-keys.json
# File that holds the client/Nexus EBICS keys.
-CLIENT_PRIVATE_KEYS_FILE = client-ebics-keys.json
+CLIENT_PRIVATE_KEYS_FILE = ${LIBEUFIN_NEXUS_HOME}/client-ebics-keys.json
# Identifies the EBICS + ISO20022 style used by the bank.
# Typically, it is named after the bank itself.
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index 699af965..607e39c1 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -153,6 +153,9 @@ class EbicsSetupConfig(val config: TalerConfig) {
private val ebicsSetupRequireString = { option: String ->
config.requireString("nexus-ebics", option)
}
+ private val ebicsSetupRequirePath = { option: String ->
+ config.requirePath("nexus-ebics", option)
+ }
// debug utility to inspect what was loaded.
fun _dump() {
this.javaClass.declaredFields.forEach {
@@ -190,11 +193,11 @@ class EbicsSetupConfig(val config: TalerConfig) {
/**
* Filename where we store the bank public keys.
*/
- val bankPublicKeysFilename = ebicsSetupRequireString("bank_public_keys_file")
+ val bankPublicKeysFilename = ebicsSetupRequirePath("bank_public_keys_file")
/**
* Filename where we store our private keys.
*/
- val clientPrivateKeysFilename = ebicsSetupRequireString("client_private_keys_file")
+ val clientPrivateKeysFilename = ebicsSetupRequirePath("client_private_keys_file")
/**
* A name that identifies the EBICS and ISO20022 flavour
* that Nexus should honor in the communication with the
diff --git a/testbench/conf/netzbon.conf b/testbench/conf/netzbon.conf
index 00b140e6..84aed7aa 100644
--- a/testbench/conf/netzbon.conf
+++ b/testbench/conf/netzbon.conf
@@ -1,3 +1,6 @@
+[paths]
+LIBEUFIN_NEXUS_HOME = test/netzbon
+
[nexus-ebics]
CURRENCY = CHF
@@ -10,10 +13,6 @@ HOST_ID = PFEBICS
USER_ID = 5183101
PARTNER_ID = 51831
-
-BANK_PUBLIC_KEYS_FILE = test/netzbon/bank-keys.json
-CLIENT_PRIVATE_KEYS_FILE = test/netzbon/client-keys.json
-
IBAN = CH4009000000160948810
BIC = POFICHBEXXX
NAME = Genossenschaft Netz Soziale Oekonomie
diff --git a/testbench/conf/postfinance.conf b/testbench/conf/postfinance.conf
index a5cb15ad..7799b13e 100644
--- a/testbench/conf/postfinance.conf
+++ b/testbench/conf/postfinance.conf
@@ -1,3 +1,6 @@
+[paths]
+LIBEUFIN_NEXUS_HOME = test/postfinance
+
[nexus-ebics]
currency = CHF
@@ -10,10 +13,6 @@ HOST_ID = PFEBICS
USER_ID = PFC00563
PARTNER_ID = PFC00563
-# Key files
-BANK_PUBLIC_KEYS_FILE = test/postfinance/bank-keys.json
-CLIENT_PRIVATE_KEYS_FILE = test/postfinance/client-keys.json
-
#IBAN = CH2989144971918294289
IBAN = CH7789144474425692816
diff --git a/testbench/src/main/kotlin/Main.kt b/testbench/src/main/kotlin/Main.kt
index fef935b9..7ef820ac 100644
--- a/testbench/src/main/kotlin/Main.kt
+++ b/testbench/src/main/kotlin/Main.kt
@@ -85,8 +85,8 @@ class Cli : CliktCommand("Run integration tests on banks provider") {
val ebicsFlags = "$flags --transient --debug-ebics test/$name"
val cfg = loadConfig(conf)
- val clientKeysPath = Path(cfg.requireString("nexus-ebics", "client_private_keys_file"))
- val bankKeysPath = Path(cfg.requireString("nexus-ebics", "bank_public_keys_file"))
+ val clientKeysPath = Path(cfg.requirePath("nexus-ebics", "client_private_keys_file"))
+ val bankKeysPath = Path(cfg.requirePath("nexus-ebics", "bank_public_keys_file"))
var hasClientKeys = clientKeysPath.exists()
var hasBankKeys = bankKeysPath.exists()