gnunet-svn
[Top][All Lists]
Advanced

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

[taler-bank] branch master updated: fix API typo and add config response


From: gnunet
Subject: [taler-bank] branch master updated: fix API typo and add config responses
Date: Wed, 09 Sep 2020 17:45:56 +0200

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

dold pushed a commit to branch master
in repository bank.

The following commit(s) were added to refs/heads/master by this push:
     new b36599b  fix API typo and add config responses
b36599b is described below

commit b36599bbd264bce84292a7076ac907f60639dbc3
Author: Florian Dold <florian.dold@gmail.com>
AuthorDate: Wed Sep 9 21:15:51 2020 +0530

    fix API typo and add config responses
---
 talerbank/app/urls.py  |  9 +++++++--
 talerbank/app/views.py | 43 +++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 48 insertions(+), 4 deletions(-)

diff --git a/talerbank/app/urls.py b/talerbank/app/urls.py
index adcf8b1..42dc239 100644
--- a/talerbank/app/urls.py
+++ b/talerbank/app/urls.py
@@ -26,6 +26,7 @@ from . import views
 # These paths are part of the GNU Taler wire gatweay API
 taler_wire_gateway_patterns = [
     path("<str:acct_id>/", views.twg_base, name="twg-base"),
+    path("<str:acct_id>/config", views.twg_config, name="twg-config"),
     path(
         "<str:acct_id>/admin/add-incoming",
         views.twg_add_incoming,
@@ -92,11 +93,15 @@ urlpatterns = [
     path("profile", views.profile_page, name="profile"),
     path("history", views.serve_history, name="history"),
     path(
-        "api/withdraw-operation/<str:withdraw_id>",
+        "api/withdrawal-operation/<str:withdraw_id>",
         views.api_withdraw_operation,
         name="api-withdraw-operation",
     ),
-    path("api/register", views.register_headless, name="register-headless"),
+    path(
+        "api/config",
+        views.api_config,
+        name="api-config",
+    ),
     path("start-withdrawal", views.start_withdrawal, name="start-withdrawal"),
     path(
         "show-withdrawal/<str:withdraw_id>", views.show_withdrawal, 
name="withdraw-show"
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index 038b6b6..689b395 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -523,9 +523,31 @@ def logout_view(request):
     return redirect("index")
 
 
+@require_GET
 def config_view(request):
+    """
+    Config query of the taler bank access api
+    """
     return JsonResponse(
-        dict(version="0:0:0", currency=settings.TALER_CURRENCY), status=200
+        dict(
+            version="0:0:0", currency=settings.TALER_CURRENCY, 
name="taler-bank-access"
+        ),
+        status=200,
+    )
+
+
+@require_GET
+def api_config(request):
+    """
+    Config query of the taler bank integration api
+    """
+    return JsonResponse(
+        dict(
+            version="0:0:0",
+            currency=settings.TALER_CURRENCY,
+            name="taler-bank-integration",
+        ),
+        status=200,
     )
 
 
@@ -792,6 +814,23 @@ def twg_base(request, acct_id):
     return JsonResponse(dict(), status=200)
 
 
+@require_GET
+def twg_config(request, acct_id):
+    """
+    This endpoint is used by the exchange test cases to
+    check if the account is up, should not normally be used
+    for anything else.
+    """
+    return JsonResponse(
+        dict(
+            version="0:0:0",
+            name="taler-wire-gateway",
+            currency=settings.TALER_CURRENCY,
+        ),
+        status=200,
+    )
+
+
 @csrf_exempt
 @require_POST
 @login_via_headers
@@ -987,7 +1026,7 @@ def make_taler_withdraw_uri(request, withdraw_id):
     else:
         pfx_components = pfx.split("/")
     host = request.get_host()
-    p = "/".join([host] + pfx_components + [str(withdraw_id)])
+    p = "/".join([host] + pfx_components + ["api"] + [str(withdraw_id)])
     return f"taler{proto_extra}://withdraw/{p}"
 
 

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