summaryrefslogtreecommitdiff
path: root/nexus/src/main/kotlin/tech
diff options
context:
space:
mode:
authorMS <ms@taler.net>2020-05-26 13:55:28 +0200
committerMS <ms@taler.net>2020-05-26 13:55:28 +0200
commitc05a2ff6bf6d9d8067aaec6a23f411972295eabf (patch)
tree96d944494a1fe1e1edf771a6016584ac4b3b5833 /nexus/src/main/kotlin/tech
parent4ebe7337a586779b7ae8414523188cdf7e768ed8 (diff)
downloadlibeufin-c05a2ff6bf6d9d8067aaec6a23f411972295eabf.tar.gz
libeufin-c05a2ff6bf6d9d8067aaec6a23f411972295eabf.tar.bz2
libeufin-c05a2ff6bf6d9d8067aaec6a23f411972295eabf.zip
Custom DB for tests.
Plus fixing the conversion from dashed date to Long timestamp.
Diffstat (limited to 'nexus/src/main/kotlin/tech')
-rw-r--r--nexus/src/main/kotlin/tech/libeufin/nexus/Helpers.kt5
1 files changed, 3 insertions, 2 deletions
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Helpers.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Helpers.kt
index f648319d..0db30ba6 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Helpers.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Helpers.kt
@@ -11,6 +11,7 @@ import tech.libeufin.util.*
import tech.libeufin.util.ebics_h004.EbicsTypes
import java.security.interfaces.RSAPublicKey
import java.time.Instant
+import java.time.LocalDateTime
import java.time.ZoneId
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
@@ -123,7 +124,7 @@ fun processCamtMessage(
currency = camt53doc.pickString("//*[local-name()='Ntry']//*[local-name()='Amt']/@Ccy")
amount = camt53doc.pickString("//*[local-name()='Ntry']//*[local-name()='Amt']")
status = camt53doc.pickString("//*[local-name()='Ntry']//*[local-name()='Sts']")
- this.bookingDate = bookingDate.millis()
+ this.bookingDate = LocalDateTime.from(bookingDate).millis()
counterpartIban =
camt53doc.pickString("//*[local-name()='${if (this.transactionType == "DBIT") "CdtrAcct" else "DbtrAcct"}']//*[local-name()='IBAN']")
counterpartName =
@@ -441,7 +442,7 @@ fun authenticateRequest(request: ApplicationRequest): NexusUserEntity {
NexusUsersTable.id eq username
}.firstOrNull()
if (user == null) {
- throw NexusError(HttpStatusCode.Unauthorized, "Unknown user")
+ throw NexusError(HttpStatusCode.Unauthorized, "Unknown user '$username'")
}
if (!CryptoUtil.checkpw(password, user.passwordHash)) {
throw NexusError(HttpStatusCode.Forbidden, "Wrong password")