gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] branch master updated: skeleton for /keys


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated: skeleton for /keys perturbating mitm function
Date: Thu, 04 May 2017 10:36:42 +0200

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

marcello pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 0b56f7b  skeleton for /keys perturbating mitm function
0b56f7b is described below

commit 0b56f7b986f13c50cbc491727c9f00f44694d836
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu May 4 10:36:17 2017 +0200

    skeleton for /keys perturbating mitm function
---
 src/mitm/talermerchantmitm/mitm.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/mitm/talermerchantmitm/mitm.py 
b/src/mitm/talermerchantmitm/mitm.py
index 8b46691..c998a1c 100644
--- a/src/mitm/talermerchantmitm/mitm.py
+++ b/src/mitm/talermerchantmitm/mitm.py
@@ -17,7 +17,6 @@
 
 from flask import (request,
                    Flask,
-                   jsonify,
                    make_response)
 import requests
 from urllib.parse import (urljoin,
@@ -44,6 +43,14 @@ def track_transaction(resp):
 def track_transfer(resp):
     return resp.text
 
+def keys(resp):
+    try:
+        keys = resp.json()
+        # Put here data perturbation logic
+        return json.dumps(keys)
+    except Exception:
+        return resp.text
+
 @app.route('/', defaults={'path': ''})
 @app.route('/<path:path>', methods=["GET", "POST"])
 def all(path):
@@ -59,7 +66,8 @@ def all(path):
         r = requests.get(urljoin(url, path), json=body)
     dispatcher = {
         "track_transaction": track_transaction,
-        "track_transfer": track_transfer
+        "track_transfer": track_transfer,
+        "keys": keys
     }
     func = dispatcher.get(request.headers.get("X-Taler-Mitm"),
                           lambda x: x.text)

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]