gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: 401 on non-existing user trying to aut


From: gnunet
Subject: [libeufin] branch master updated: 401 on non-existing user trying to authenticate.
Date: Fri, 22 Sep 2023 17:38:31 +0200

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

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 2befa711 401 on non-existing user trying to authenticate.
2befa711 is described below

commit 2befa711f29e7c4b3f2299dabdc51ec23419b2a1
Author: MS <ms@taler.net>
AuthorDate: Fri Sep 22 17:38:02 2023 +0200

    401 on non-existing user trying to authenticate.
---
 bank/src/main/kotlin/tech/libeufin/bank/helpers.kt |  5 +----
 bank/src/test/kotlin/LibeuFinApiTest.kt            | 18 +++++++++---------
 contrib/wallet-core                                |  2 +-
 3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/bank/src/main/kotlin/tech/libeufin/bank/helpers.kt 
b/bank/src/main/kotlin/tech/libeufin/bank/helpers.kt
index c9794b8b..6e93454d 100644
--- a/bank/src/main/kotlin/tech/libeufin/bank/helpers.kt
+++ b/bank/src/main/kotlin/tech/libeufin/bank/helpers.kt
@@ -86,10 +86,7 @@ fun doBasicAuth(db: Database, encodedCredentials: String): 
Customer? {
         )
     val login = userAndPassSplit[0]
     val plainPassword = userAndPassSplit[1]
-    val maybeCustomer = db.customerGetFromLogin(login) ?: throw notFound(
-        "User not found",
-        TalerErrorCode.TALER_EC_END // FIXME: define EC.
-    )
+    val maybeCustomer = db.customerGetFromLogin(login) ?: throw unauthorized()
     if (!CryptoUtil.checkpw(plainPassword, maybeCustomer.passwordHash)) return 
null
     return maybeCustomer
 }
diff --git a/bank/src/test/kotlin/LibeuFinApiTest.kt 
b/bank/src/test/kotlin/LibeuFinApiTest.kt
index 06a3f47a..ef77c82e 100644
--- a/bank/src/test/kotlin/LibeuFinApiTest.kt
+++ b/bank/src/test/kotlin/LibeuFinApiTest.kt
@@ -244,7 +244,7 @@ class LibeuFinApiTest {
                 basicAuth("not", "not")
                 expectSuccess = false
             }
-            assert(shouldNot.status == HttpStatusCode.NotFound)
+            assert(shouldNot.status == HttpStatusCode.Unauthorized)
         }
     }
 
@@ -287,14 +287,6 @@ class LibeuFinApiTest {
                 )
             }
             assert(resp.status == HttpStatusCode.Created)
-            // Creating the administrator.
-            db.customerCreate(
-                Customer(
-                    "admin",
-                    CryptoUtil.hashpw("pass"),
-                    "CFO"
-                )
-            )
         }
     }
 
@@ -326,6 +318,14 @@ class LibeuFinApiTest {
                 )
             }
             assert(resp.status == HttpStatusCode.Unauthorized)
+            // Creating the administrator.
+            assert(db.customerCreate(
+                Customer(
+                    "admin",
+                    CryptoUtil.hashpw("pass"),
+                    "CFO"
+                )
+            ) != null)
             assert(maybeCreateAdminAccount(db, ctx)) // customer exists, this 
makes only the bank account.
             resp = client.post("/accounts") {
                 expectSuccess = false
diff --git a/contrib/wallet-core b/contrib/wallet-core
index 9e2d95b3..c5a3cd4c 160000
--- a/contrib/wallet-core
+++ b/contrib/wallet-core
@@ -1 +1 @@
-Subproject commit 9e2d95b39723a038eb714d723ac0910a5bf596e2
+Subproject commit c5a3cd4c50676c49fa6c67cbdeb609101c38e764

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