gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: get is_public properly from DB


From: gnunet
Subject: [libeufin] branch master updated: get is_public properly from DB
Date: Mon, 25 Sep 2023 00:41:31 +0200

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

dold pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new f5e670cc get is_public properly from DB
f5e670cc is described below

commit f5e670cc0bb8dc8424eb1aa891fc0161064395ca
Author: Florian Dold <florian@dold.me>
AuthorDate: Mon Sep 25 00:41:35 2023 +0200

    get is_public properly from DB
---
 bank/src/main/kotlin/tech/libeufin/bank/CorebankApiHandlers.kt | 8 +++++---
 bank/src/main/kotlin/tech/libeufin/bank/Database.kt            | 1 +
 bank/src/test/kotlin/LibeuFinApiTest.kt                        | 2 ++
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/bank/src/main/kotlin/tech/libeufin/bank/CorebankApiHandlers.kt 
b/bank/src/main/kotlin/tech/libeufin/bank/CorebankApiHandlers.kt
index f072c5a6..b1717e0d 100644
--- a/bank/src/main/kotlin/tech/libeufin/bank/CorebankApiHandlers.kt
+++ b/bank/src/main/kotlin/tech/libeufin/bank/CorebankApiHandlers.kt
@@ -118,8 +118,8 @@ fun Routing.accountsMgmtHandlers(db: Database, ctx: 
BankApplicationContext) {
                         maybeCustomerExists.email == 
req.challenge_contact_data?.email &&
                         maybeCustomerExists.phone == 
req.challenge_contact_data?.phone &&
                         maybeCustomerExists.cashoutPayto == 
req.cashout_payto_uri &&
-                        CryptoUtil.checkpw(req.password, 
maybeCustomerExists.passwordHash)
-                        && maybeHasBankAccount.isPublic == req.is_public &&
+                        CryptoUtil.checkpw(req.password, 
maybeCustomerExists.passwordHash) &&
+                        maybeHasBankAccount.isPublic == req.is_public &&
                         maybeHasBankAccount.isTalerExchange == 
req.is_taler_exchange &&
                         maybeHasBankAccount.internalPaytoUri == internalPayto
             if (isIdentic) {
@@ -132,7 +132,9 @@ fun Routing.accountsMgmtHandlers(db: Database, ctx: 
BankApplicationContext) {
                     hint = "Idempotency check failed."
                 )
             )
-        } // From here: fresh user being added.
+        }
+
+        // From here: fresh user being added.
         val newCustomer = Customer(
             login = req.username,
             name = req.name,
diff --git a/bank/src/main/kotlin/tech/libeufin/bank/Database.kt 
b/bank/src/main/kotlin/tech/libeufin/bank/Database.kt
index 68ef6038..8b1999db 100644
--- a/bank/src/main/kotlin/tech/libeufin/bank/Database.kt
+++ b/bank/src/main/kotlin/tech/libeufin/bank/Database.kt
@@ -427,6 +427,7 @@ class Database(private val dbConfig: String, private val 
bankCurrency: String) {
                 owningCustomerId = it.getLong("owning_customer_id"),
                 hasDebt = it.getBoolean("has_debt"),
                 isTalerExchange = it.getBoolean("is_taler_exchange"),
+                isPublic = it.getBoolean("is_public"),
                 maxDebt = TalerAmount(
                     value = it.getLong("max_debt_val"),
                     frac = it.getInt("max_debt_frac"),
diff --git a/bank/src/test/kotlin/LibeuFinApiTest.kt 
b/bank/src/test/kotlin/LibeuFinApiTest.kt
index 2d9e496f..2c14d45f 100644
--- a/bank/src/test/kotlin/LibeuFinApiTest.kt
+++ b/bank/src/test/kotlin/LibeuFinApiTest.kt
@@ -270,6 +270,7 @@ class LibeuFinApiTest {
                     "username": "foo",
                     "password": "bar",
                     "name": "Jane",
+                    "is_public": true,
                     "internal_payto_uri": "$ibanPayto"
                 }""".trimIndent()
                 )
@@ -284,6 +285,7 @@ class LibeuFinApiTest {
                     "username": "foo",
                     "password": "bar",
                     "name": "Jane",
+                    "is_public": true,
                     "internal_payto_uri": "$ibanPayto"
                 }""".trimIndent()
                 )

-- 
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]