summaryrefslogtreecommitdiff
path: root/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt')
-rw-r--r--sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt11
1 files changed, 10 insertions, 1 deletions
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
index a2454ff4..fdea79c2 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
@@ -31,6 +31,7 @@ import tech.libeufin.util.*
import java.security.interfaces.RSAPublicKey
import java.util.*
import java.util.zip.DeflaterInputStream
+import kotlin.reflect.KProperty
data class DemobankConfig(
val allowRegistrations: Boolean,
@@ -43,9 +44,17 @@ data class DemobankConfig(
val smsTan: String? = null, // fixme: move the config subcommand
val emailTan: String? = null, // fixme: same as above.
val suggestedExchangeBaseUrl: String? = null,
- val suggestedExchangePayto: String? = null
+ val suggestedExchangePayto: String? = null,
+ val nexusBaseUrl: String? = null,
+ val usernameAtNexus: String? = null,
+ val passwordAtNexus: String? = null,
+ val enableConversionService: Boolean = false
)
+fun <T>getConfigValueOrThrow(configKey: KProperty<T?>): T {
+ return configKey.getter.call() ?: throw nullConfigValueError(configKey.name)
+}
+
/**
* Helps to communicate Camt values without having
* to parse the XML each time one is needed.