gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: Prevent multiple connections with same


From: gnunet
Subject: [libeufin] branch master updated: Prevent multiple connections with same name.
Date: Mon, 23 Nov 2020 12:04:23 +0100

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 cf0929f  Prevent multiple connections with same name.
cf0929f is described below

commit cf0929fc71b1e9a3d2a8cc84d111fdc8355c0ac9
Author: MS <ms@taler.net>
AuthorDate: Mon Nov 23 12:03:21 2020 +0100

    Prevent multiple connections with same name.
---
 nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
index b5b0afb..3c2b60d 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
@@ -644,6 +644,9 @@ fun serverMain(dbName: String, host: String) {
                 val body = call.receive<CreateBankConnectionRequestJson>()
                 transaction {
                     val user = authenticateRequest(call.request)
+                    if (NexusBankAccountEntity.findById(body.name) != null) {
+                        throw NexusError(HttpStatusCode.NotAcceptable, 
"connection '${body.name}' exists already")
+                    }
                     when (body) {
                         is CreateBankConnectionFromBackupRequestJson -> {
                             val type = body.data.get("type")

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