[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] 01/02: SQL logging
From: |
gnunet |
Subject: |
[libeufin] 01/02: SQL logging |
Date: |
Wed, 29 Jan 2020 09:23:49 +0100 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository libeufin.
commit d3521c623c46918adf121ec2dad3b0d33498bad0
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Jan 29 08:31:58 2020 +0100
SQL logging
---
nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 16 ++++------------
sandbox/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
index ad9b20c..467bc81 100644
--- 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
index 8142ffe..7ef4625 100755
--- 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)
--
To stop receiving notification emails like this one, please contact
address@hidden.