summaryrefslogtreecommitdiff
path: root/http-tester.py
diff options
context:
space:
mode:
Diffstat (limited to 'http-tester.py')
-rw-r--r--http-tester.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/http-tester.py b/http-tester.py
deleted file mode 100644
index 7cb5197..0000000
--- a/http-tester.py
+++ /dev/null
@@ -1,32 +0,0 @@
-from hashlib import sha256
-from base64 import b64encode
-import json
-import requests
-
-
-URL = "http://localhost:8080/api"
-
-
-def sign_data(data):
- dump = json.dumps(data, separators=[",", ":"])
- print(dump)
- payload = b64encode(dump.encode())
- print(payload.decode())
- signature = sha256(payload).hexdigest()
- print(signature)
- return f"{payload.decode()}.{signature}"
-
-
-def test_get_user_key():
- data = {
- "User": "ivan",
- "Data": "andrew"
- }
-
- signed_data = sign_data(data)
- resp = requests.post(f"{URL}/getUserKey", data=signed_data)
- print(resp.status_code)
- print(resp.json())
-
-
-test_get_user_key() \ No newline at end of file