gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated (4af5dda -> 7ce7b83)


From: gnunet
Subject: [libeufin] branch master updated (4af5dda -> 7ce7b83)
Date: Wed, 29 Jan 2020 09:23:48 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a change to branch master
in repository libeufin.

    from 4af5dda  option
     new d3521c6  SQL logging
     new 7ce7b83  avoid NULL primary key

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt       |  1 -
 nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt     | 19 ++++++-------------
 sandbox/build.gradle                                  |  1 -
 sandbox/src/main/python/libeufin-cli                  |  6 +++---
 util/build.gradle                                     |  9 +--------
 .../test/{resources => kotlin}/EbicsMessagesTest.kt   |  1 +
 6 files changed, 11 insertions(+), 26 deletions(-)
 rename util/src/test/{resources => kotlin}/EbicsMessagesTest.kt (99%)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
index f399ee7..625ea57 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
@@ -26,7 +26,6 @@ object EbicsSubscribersTable : IdTable<String>() {
 class EbicsSubscriberEntity(id: EntityID<String>) : Entity<String>(id) {
 
     companion object : EntityClass<String, 
EbicsSubscriberEntity>(EbicsSubscribersTable)
-
     var ebicsURL by EbicsSubscribersTable.ebicsURL
     var hostID by EbicsSubscribersTable.hostID
     var partnerID by EbicsSubscribersTable.partnerID
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index ad9b20c..cc4bec5 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -38,6 +38,9 @@ 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.dao.EntityID
+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 +69,12 @@ fun testData() {
     val pairC = CryptoUtil.generateRsaKeyPair(2048)
 
     transaction {
-        EbicsSubscriberEntity.new {
+        addLogger(StdOutSqlLogger)
+        EbicsSubscriberEntity.new(id = "default-customer") {
             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 +96,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 +323,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 +337,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 +455,6 @@ fun main() {
                 )
             }
 
-
             get("/ebics/subscribers") {
 
                 var ret = EbicsSubscribersResponse()
diff --git a/sandbox/build.gradle b/sandbox/build.gradle
index b1fdee3..90f5243 100644
--- a/sandbox/build.gradle
+++ b/sandbox/build.gradle
@@ -50,7 +50,6 @@ dependencies {
 
 
 application {
-
     mainClassName = "tech.libeufin.sandbox.MainKt"
 }
 
diff --git a/sandbox/src/main/python/libeufin-cli 
b/sandbox/src/main/python/libeufin-cli
index 8142ffe..27ebe68 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)
@@ -342,7 +342,7 @@ def sync(obj, customer_id):
     print(resp.content.decode("utf-8"))
 
 
-@ebics.command(help="Retrieve all subscribers in the system")
+@ebics.command(help="Retrieve all the customers managed by Nexus")
 @click.pass_obj
 def subscribers(obj):
     
@@ -350,7 +350,7 @@ def subscribers(obj):
     try:
         resp = get(url)
     except Exception:
-        print("Could not reach the bank")
+        print("Could not reach Nexus at {}".format(url))
         return
 
     print(resp.content.decode("utf-8"))
diff --git a/util/build.gradle b/util/build.gradle
index d9efa8d..7e68386 100644
--- a/util/build.gradle
+++ b/util/build.gradle
@@ -4,12 +4,10 @@ plugins {
     id 'application'
 }
 
-
 sourceCompatibility = "11"
 targetCompatibility = "11"
 version '1.0-snapshot'
 
-
 compileKotlin {
 
     kotlinOptions {
@@ -46,9 +44,4 @@ dependencies {
     testImplementation group: 'junit', name: 'junit', version: '4.12'
     testImplementation 'org.jetbrains.kotlin:kotlin-test-junit:1.3.50'
     testImplementation 'org.jetbrains.kotlin:kotlin-test:1.3.50'
-}
-
-application {
-    mainClassName = "tech.libeufin.util.MainKt"
-}
-
+}
\ No newline at end of file
diff --git a/util/src/test/resources/EbicsMessagesTest.kt 
b/util/src/test/kotlin/EbicsMessagesTest.kt
similarity index 99%
rename from util/src/test/resources/EbicsMessagesTest.kt
rename to util/src/test/kotlin/EbicsMessagesTest.kt
index f748fbb..a8b5ab6 100644
--- a/util/src/test/resources/EbicsMessagesTest.kt
+++ b/util/src/test/kotlin/EbicsMessagesTest.kt
@@ -22,6 +22,7 @@ class EbicsMessagesTest {
     fun testImportNonRoot() {
         val classLoader = ClassLoader.getSystemClassLoader()
         val ini = classLoader.getResource("<?xml version=\"1.0\" 
encoding=\"utf-8\"?>\n<SignaturePubKeyOrderData 
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"; 
xsi:schemaLocation=\"http://www.ebics.org/S001 
http://www.ebics.org/S001/ebics_signature.xsd\"; 
xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\"; 
xmlns=\"http://www.ebics.org/S001\";>\n  <SignaturePubKeyInfo>\n    
<PubKeyValue>\n      <ds:RSAKeyValue>\n        
<ds:Modulus>s5ktpg3xGjbZZgVTYtW+0e6xsWg142UwvoM3mfuM+qrkIa5bPUGQLH [...]
+        assert(ini != null)
         val jaxb = 
XMLUtil.convertStringToJaxb<SignatureTypes.SignaturePubKeyOrderData>(ini.readText())
         assertEquals("A006", jaxb.value.signaturePubKeyInfo.signatureVersion)
     }

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]