[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: Revert (part of) #6646
From: |
gnunet |
Subject: |
[libeufin] branch master updated: Revert (part of) #6646 |
Date: |
Tue, 19 Jan 2021 16:54:02 +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 4edb7a0 Revert (part of) #6646
4edb7a0 is described below
commit 4edb7a093380f3909096141a8ac158f5bce0309e
Author: MS <ms@taler.net>
AuthorDate: Tue Jan 19 16:53:53 2021 +0100
Revert (part of) #6646
---
integration-tests/tests.py | 22 ----------------------
nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt | 2 +-
.../tech/libeufin/nexus/server/NexusServer.kt | 4 +---
3 files changed, 2 insertions(+), 26 deletions(-)
diff --git a/integration-tests/tests.py b/integration-tests/tests.py
index 08ecadd..e063c34 100755
--- a/integration-tests/tests.py
+++ b/integration-tests/tests.py
@@ -405,28 +405,6 @@ def test_double_connection_name():
[406] # expecting "406 Not acceptable"
)
- # Checking that _another_ user can pick the same connection name.
- assertResponse(
- post(
- f"{PERSONA.nexus.base_url}/users",
- auth=auth.HTTPBasicAuth("admin", "x"),
- json=dict(username="second-user", password="second-password"),
- )
- )
-
- assertResponse(
- post(
- f"{PERSONA.nexus.base_url}/bank-connections",
- json=dict(
- name=PERSONA.nexus.bank_connection, # same name from the
previous creation.
- source="new",
- type="ebics",
- data=PERSONA.ebics.get_as_dict(with_url=True),
- ),
- auth=auth.HTTPBasicAuth("second-user", "second-password")
- ),
- )
-
def test_ingestion_camt53_non_singleton():
with open("camt53-gls-style-1.xml") as f:
camt = f.read()
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
index 94d3263..c164aee 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
@@ -302,7 +302,7 @@ class NexusUserEntity(id: EntityID<String>) :
Entity<String>(id) {
}
object NexusBankConnectionsTable : IdTable<String>() {
- override val id = NexusBankConnectionsTable.text("id").entityId()
+ override val id =
NexusBankConnectionsTable.text("id").entityId().uniqueIndex()
val type = text("type")
val owner = reference("user", NexusUsersTable)
}
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 6f03ab0..3c8d06b 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
@@ -718,9 +718,7 @@ fun serverMain(dbName: String, host: String, port: Int) {
val body = call.receive<CreateBankConnectionRequestJson>()
transaction {
val user = authenticateRequest(call.request)
- if (NexusBankConnectionEntity.find {
- NexusBankConnectionsTable.id eq body.name and
(NexusBankConnectionsTable.owner eq user.id)
- }.firstOrNull() != null) {
+ if (NexusBankConnectionEntity.findById(body.name) != null)
{
throw NexusError(HttpStatusCode.NotAcceptable,
"connection '${body.name}' exists already")
}
when (body) {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: Revert (part of) #6646,
gnunet <=