gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated (c7a8ed3 -> 826d4b4)


From: gnunet
Subject: [libeufin] branch master updated (c7a8ed3 -> 826d4b4)
Date: Tue, 08 Dec 2020 14:57:00 +0100

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

ms pushed a change to branch master
in repository libeufin.

    from c7a8ed3  Migrating to PostgreSQL: foreign keys issue
     new a7460ea  Launch quietly.
     new 826d4b4  rename DB table

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:
 integration-tests/tests.py                         |  4 +-
 integration-tests/util.py                          | 43 ++++++++++++----------
 nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt    | 35 +++++++++---------
 .../kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt |  8 ++--
 sandbox/libeufin-sandbox-dev-template              |  4 +-
 5 files changed, 49 insertions(+), 45 deletions(-)

diff --git a/integration-tests/tests.py b/integration-tests/tests.py
index 703711a..011a39b 100755
--- a/integration-tests/tests.py
+++ b/integration-tests/tests.py
@@ -150,7 +150,7 @@ def teardown_function():
 def test_env():
     print("Nexus and Sandbox are up and running!")
     try:
-        input("press enter to stop LibEuFin test environment ...")
+        input("\npress enter to stop LibEuFin test environment ...")
     except:
         pass
     print("exiting!")
@@ -311,7 +311,7 @@ def test_payment_double_submission():
         )
     )
     check_call([
-        "psql", "-d", DB,
+        "psql", "-d", DB, "-h 127.0.0.1", "-U", "libeufin",
         f"UPDATE PaymentInitiations SET submitted = false WHERE id = 
'{PAYMENT_UUID}'"
     ]) 
     # Submit payment the _second_ time, expecting 500 from Nexus.
diff --git a/integration-tests/util.py b/integration-tests/util.py
index e2c026a..6e96c45 100644
--- a/integration-tests/util.py
+++ b/integration-tests/util.py
@@ -51,23 +51,22 @@ def removeStaleTables(dbName):
     flushTablesSandbox(dbName)
 
 def makeNexusSuperuser(dbName):
-    db_full_path = str(Path.cwd() / dbName)
-    check_call(
-        [
-            "../gradlew",
-            "-q",
-            "-p",
-            "..",
-            "nexus:run",
-            "--console=plain",
-            f"--args=superuser admin --password x --db-name={db_full_path}",
-        ]
-    )
+    check_call([
+        "../gradlew",
+        "-q", "--console=plain",
+        "-p", "..",
+        "nexus:run",
+        f"--args=superuser admin --password x --db-name={dbName}",
+    ])
 
 def drop_public_schema(dbName):
-    check_call(
-        ["psql", "-d", dbName, "-c", "DROP SCHEMA public CASCADE; CREATE 
SCHEMA public;"]
-     )
+    check_call([
+        "psql",
+        "-d", dbName, "-q",
+        "-h", "127.0.0.1", "-p", "5433",
+        "-U", "libeufin",
+        "-c", "DROP SCHEMA public CASCADE; CREATE SCHEMA public;"
+    ])
 def flushTablesSandbox(dbName):
     drop_public_schema(dbName)
 
@@ -75,10 +74,16 @@ def flushTablesNexus(dbName):
     drop_public_schema(dbName)
 
 def startSandbox(dbName):
-    check_call(["../gradlew", "-q", "-p", "..", "sandbox:assemble"])
+    check_call(["../gradlew", "-q", "--console=plain", "-p", "..", 
"sandbox:assemble"])
     checkPort(5000)
-    sandbox = Popen(
-        ["../gradlew", "-q", "-p", "..", "sandbox:run", "--console=plain", 
"--args=serve --db-name={}".format(db_full_path)],
+    sandbox = Popen([
+        "../gradlew",
+        "-q",
+        "-p",
+        "..",
+        "sandbox:run",
+        "--console=plain",
+        "--args=serve --db-name={}".format(dbName)],
         stdin=DEVNULL,
         stdout=open("sandbox-stdout.log", "w"),
         stderr=open("sandbox-stderr.log", "w"),
@@ -100,7 +105,7 @@ def startSandbox(dbName):
 
 def startNexus(dbName):
     check_call(
-        ["../gradlew", "-q", "-p", "..", "nexus:assemble",]
+        ["../gradlew", "-q", "--console=plain", "-p", "..", "nexus:assemble",]
     )
     checkPort(5001)
     nexus = Popen(
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
index 5d5e4cf..6b939ad 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
@@ -30,7 +30,6 @@ import org.jetbrains.exposed.sql.transactions.transaction
 import tech.libeufin.nexus.iso20022.EntryStatus
 import tech.libeufin.util.EbicsInitState
 import tech.libeufin.util.amount
-import java.net.URLEncoder
 import java.sql.Connection
 
 /**
@@ -261,7 +260,7 @@ class NexusBankAccountEntity(id: EntityID<String>) : 
Entity<String>(id) {
     var lastNotificationCreationTimestamp by 
NexusBankAccountsTable.lastNotificationCreationTimestamp
 }
 
-object EbicsSubscribersTable : IntIdTable() {
+object NexusEbicsSubscribersTable : IntIdTable() {
     val ebicsURL = text("ebicsURL")
     val hostID = text("hostID")
     val partnerID = text("partnerID")
@@ -278,21 +277,21 @@ object EbicsSubscribersTable : IntIdTable() {
 }
 
 class EbicsSubscriberEntity(id: EntityID<Int>) : IntEntity(id) {
-    companion object : 
IntEntityClass<EbicsSubscriberEntity>(EbicsSubscribersTable)
-
-    var ebicsURL by EbicsSubscribersTable.ebicsURL
-    var hostID by EbicsSubscribersTable.hostID
-    var partnerID by EbicsSubscribersTable.partnerID
-    var userID by EbicsSubscribersTable.userID
-    var systemID by EbicsSubscribersTable.systemID
-    var signaturePrivateKey by EbicsSubscribersTable.signaturePrivateKey
-    var encryptionPrivateKey by EbicsSubscribersTable.encryptionPrivateKey
-    var authenticationPrivateKey by 
EbicsSubscribersTable.authenticationPrivateKey
-    var bankEncryptionPublicKey by 
EbicsSubscribersTable.bankEncryptionPublicKey
-    var bankAuthenticationPublicKey by 
EbicsSubscribersTable.bankAuthenticationPublicKey
-    var nexusBankConnection by NexusBankConnectionEntity referencedOn 
EbicsSubscribersTable.nexusBankConnection
-    var ebicsIniState by EbicsSubscribersTable.ebicsIniState
-    var ebicsHiaState by EbicsSubscribersTable.ebicsHiaState
+    companion object : 
IntEntityClass<EbicsSubscriberEntity>(NexusEbicsSubscribersTable)
+
+    var ebicsURL by NexusEbicsSubscribersTable.ebicsURL
+    var hostID by NexusEbicsSubscribersTable.hostID
+    var partnerID by NexusEbicsSubscribersTable.partnerID
+    var userID by NexusEbicsSubscribersTable.userID
+    var systemID by NexusEbicsSubscribersTable.systemID
+    var signaturePrivateKey by NexusEbicsSubscribersTable.signaturePrivateKey
+    var encryptionPrivateKey by NexusEbicsSubscribersTable.encryptionPrivateKey
+    var authenticationPrivateKey by 
NexusEbicsSubscribersTable.authenticationPrivateKey
+    var bankEncryptionPublicKey by 
NexusEbicsSubscribersTable.bankEncryptionPublicKey
+    var bankAuthenticationPublicKey by 
NexusEbicsSubscribersTable.bankAuthenticationPublicKey
+    var nexusBankConnection by NexusBankConnectionEntity referencedOn 
NexusEbicsSubscribersTable.nexusBankConnection
+    var ebicsIniState by NexusEbicsSubscribersTable.ebicsIniState
+    var ebicsHiaState by NexusEbicsSubscribersTable.ebicsHiaState
 }
 
 object NexusUsersTable : IdTable<String>() {
@@ -396,7 +395,7 @@ fun dbCreateTables(dbName: String) {
         SchemaUtils.create(
             NexusUsersTable,
             PaymentInitiationsTable,
-            EbicsSubscribersTable,
+            NexusEbicsSubscribersTable,
             NexusBankAccountsTable,
             NexusBankTransactionsTable,
             TalerIncomingPayments,
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
index 43e0275..fffc4f8 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsNexus.kt
@@ -325,7 +325,7 @@ private fun getEbicsSubscriberDetails(bankConnectionId: 
String): EbicsClientSubs
         throw NexusError(HttpStatusCode.NotFound, "transport not found")
     }
     val subscriber = EbicsSubscriberEntity.find {
-        EbicsSubscribersTable.nexusBankConnection eq transport.id
+        NexusEbicsSubscribersTable.nexusBankConnection eq transport.id
     }.first()
     // transport exists and belongs to caller.
     return getEbicsSubscriberDetailsInternal(subscriber)
@@ -433,7 +433,7 @@ fun Route.ebicsBankConnectionRoutes(client: HttpClient) {
         transaction {
             val conn = requireBankConnection(call, "connid")
             val subscriber =
-                EbicsSubscriberEntity.find { 
EbicsSubscribersTable.nexusBankConnection eq conn.id }.first()
+                EbicsSubscriberEntity.find { 
NexusEbicsSubscribersTable.nexusBankConnection eq conn.id }.first()
             subscriber.bankAuthenticationPublicKey = 
ExposedBlob((hpbData.authenticationPubKey.encoded))
             subscriber.bankEncryptionPublicKey = 
ExposedBlob((hpbData.encryptionPubKey.encoded))
         }
@@ -602,7 +602,7 @@ private suspend fun tentativeHpb(client: HttpClient, 
connId: String): Boolean {
             throw NexusError(HttpStatusCode.NotFound, "bank connection 
'$connId' not found")
         }
         val subscriberEntity =
-            EbicsSubscriberEntity.find { 
EbicsSubscribersTable.nexusBankConnection eq conn.id }.first()
+            EbicsSubscriberEntity.find { 
NexusEbicsSubscribersTable.nexusBankConnection eq conn.id }.first()
         subscriberEntity.ebicsIniState = EbicsInitState.SENT
         subscriberEntity.ebicsHiaState = EbicsInitState.SENT
         subscriberEntity.bankAuthenticationPublicKey =
@@ -648,7 +648,7 @@ suspend fun connectEbics(client: HttpClient, connId: 
String) {
             throw NexusError(HttpStatusCode.NotFound, "bank connection 
'$connId' not found")
         }
         val subscriberEntity =
-            EbicsSubscriberEntity.find { 
EbicsSubscribersTable.nexusBankConnection eq conn.id }.first()
+            EbicsSubscriberEntity.find { 
NexusEbicsSubscribersTable.nexusBankConnection eq conn.id }.first()
         if (iniDone) {
             subscriberEntity.ebicsIniState = EbicsInitState.SENT
         }
diff --git a/sandbox/libeufin-sandbox-dev-template 
b/sandbox/libeufin-sandbox-dev-template
index 2e284c0..bf8a3bb 100644
--- a/sandbox/libeufin-sandbox-dev-template
+++ b/sandbox/libeufin-sandbox-dev-template
@@ -2,7 +2,7 @@
 
 ARGS="$@"
 cd PROJECT
-if (( $# > 0 )); then ./gradlew --console=plain sandbox:run --args="$ARGS"
-else ./gradlew --console=plain sandbox:run
+if (( $# > 0 )); then ./gradlew -q --console=plain sandbox:run --args="$ARGS"
+else ./gradlew -q --console=plain sandbox:run
 fi
 cd - > /dev/null

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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