gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: account deletion


From: gnunet
Subject: [libeufin] branch master updated: account deletion
Date: Thu, 19 May 2022 08:00:04 +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 f472eebf account deletion
f472eebf is described below

commit f472eebf3cfb3daf62cdc9aa32f14b11f35b732b
Author: ms <ms@taler.net>
AuthorDate: Thu May 19 07:59:57 2022 +0200

    account deletion
---
 cli/bin/libeufin-cli                                | 21 +++++++++++++--------
 .../src/main/kotlin/tech/libeufin/sandbox/Main.kt   |  6 ++++--
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/cli/bin/libeufin-cli b/cli/bin/libeufin-cli
index 43131b08..168fca7a 100755
--- a/cli/bin/libeufin-cli
+++ b/cli/bin/libeufin-cli
@@ -1263,18 +1263,23 @@ def sandbox_demobank_info(obj, bank_account):
     tell_user(resp, withsuccess=True)
 
 @sandbox_demobank.command("delete",
-    help="""delete the bank account pointed by LIBEUFIN_SANDBOX_{USERNAME, 
PASSWORD}."""
+    help="""delete bank account"""
+)
+@click.option(
+    "--bank-account",
+    help="Label of the bank account to delete.",
+    required=True
 )
 @click.pass_obj
-def sandbox_demobank_register(obj, public, name):
-    url = obj.access_api_url ("/testing/unregister")
-    req = dict(username=obj.username, password=obj.password, isPublic=public)
-    if name != "":
-        req.update(name=name)
+def sandbox_demobank_delete(obj, bank_account):
+    url = obj.access_api_url (f"/accounts/{bank_account}")
     try:
-        resp = post(
+        resp = delete(
             url,
-            json=req,
+            auth=auth.HTTPBasicAuth(
+              obj.username,
+              obj.password
+            )
         )
     except Exception as e:
         print(e)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index 63f62ab4..e255316d 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -1444,15 +1444,17 @@ val sandboxApp: Application.() -> Unit = {
                     call.respond(ret)
                     return@get
                 }
-                post("/testing/unregister") {
+                delete("accounts/{account_name}") {
                     // Check demobank was created.
                     ensureDemobank(call)
                     transaction {
                         val bankAccount = getBankAccountWithAuth(call)
+                        val customerAccount = getCustomer(bankAccount.owner)
                         bankAccount.delete()
+                        customerAccount.delete()
                     }
                     call.respond(object {})
-                    return@post
+                    return@delete
                 }
                 // Keeping the prefix "testing" not to break tests.
                 post("/testing/register") {

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