libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit d3521c623c46918adf121ec2dad3b0d33498bad0
parent 4af5dda67b77e90d997d5aa0e7ac5cdf1184e627
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Wed, 29 Jan 2020 08:31:58 +0100

SQL logging

Diffstat:
Mnexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 16++++------------
Msandbox/src/main/python/libeufin-cli | 2+-
2 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt @@ -38,6 +38,8 @@ import io.ktor.response.respondText import io.ktor.routing.* import io.ktor.server.engine.embeddedServer import io.ktor.server.netty.Netty +import org.jetbrains.exposed.sql.StdOutSqlLogger +import org.jetbrains.exposed.sql.addLogger import org.jetbrains.exposed.sql.transactions.transaction import org.joda.time.DateTime import org.slf4j.Logger @@ -66,12 +68,12 @@ fun testData() { val pairC = CryptoUtil.generateRsaKeyPair(2048) transaction { + addLogger(StdOutSqlLogger) EbicsSubscriberEntity.new { ebicsURL = "http://localhost:5000/ebicsweb" userID = "USER1" partnerID = "PARTNER1" hostID = "host01" - signaturePrivateKey = SerialBlob(pairA.private.encoded) encryptionPrivateKey = SerialBlob(pairB.private.encoded) authenticationPrivateKey = SerialBlob(pairC.private.encoded) @@ -93,7 +95,7 @@ val LOGGER: Logger = LoggerFactory.getLogger("tech.libeufin.nexus") fun main() { dbCreateTables() - // testData() + testData() val client = HttpClient(){ expectSuccess = false // this way, it does not throw exceptions on != 200 responses. } @@ -320,13 +322,10 @@ fun main() { } get("/ebics/subscribers/{id}/keyletter") { - val id = expectId(call.parameters["id"]) - var usernameLine = "TODO" var recipientLine = "TODO" val customerIdLine = "TODO" - var userIdLine = "" var esExponentLine = "" var esModulusLine = "" @@ -337,21 +336,15 @@ fun main() { var esKeyHashLine = "" var encKeyHashLine = "" var authKeyHashLine = "" - val esVersionLine = "A006" val authVersionLine = "X002" val encVersionLine = "E002" - val now = Date() val dateFormat = SimpleDateFormat("DD.MM.YYYY") val timeFormat = SimpleDateFormat("HH.mm.ss") var dateLine = dateFormat.format(now) var timeLine = timeFormat.format(now) - - - - transaction { val subscriber = EbicsSubscriberEntity.findById(id) ?: throw SubscriberNotFoundError( HttpStatusCode.NotFound @@ -461,7 +454,6 @@ fun main() { ) } - get("/ebics/subscribers") { var ret = EbicsSubscribersResponse() diff --git a/sandbox/src/main/python/libeufin-cli b/sandbox/src/main/python/libeufin-cli @@ -116,7 +116,7 @@ def native(ctx, sandbox_base_url): help="Customer id", required=True ) -def hev(customer_id): +def hev(obj, customer_id): url = urljoin(obj["nexus_base_url"], "/ebics/{}/sendHev".format(customer_id)) try: resp = get(url)