[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libeufin] branch master updated: fix names
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libeufin] branch master updated: fix names |
Date: |
Wed, 09 Oct 2019 16:44:33 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new d146df5 fix names
d146df5 is described below
commit d146df52431f1a94ce79e257e5c84b65bbad75d1
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Oct 9 16:44:27 2019 +0200
fix names
---
sandbox/src/main/kotlin/JSON.kt | 16 ++++++++--------
sandbox/src/main/python/libeufin-cli | 25 ++++++++++++++++++-------
2 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/sandbox/src/main/kotlin/JSON.kt b/sandbox/src/main/kotlin/JSON.kt
index 5b43f7e..b62090a 100644
--- a/sandbox/src/main/kotlin/JSON.kt
+++ b/sandbox/src/main/kotlin/JSON.kt
@@ -51,10 +51,10 @@ data class IniLetter(
val date: String,
val time: String,
val recipient: String,
- val exp_length: Int,
- val exponent: String,
- val mod_length: Int,
- val modulus: String,
+ val public_exponent_length: Int,
+ val public_exponent: String,
+ val public_modulus_length: Int,
+ val public_modulus: String,
val hash: String
)
@@ -68,14 +68,14 @@ data class HiaLetter(
val date: String,
val time: String,
val recipient: String,
- val ia_exp_length: Int,
+ val ia_exponent_length: Int,
val ia_exponent: String,
- val ia_mod_length: Int,
+ val ia_modulus_length: Int,
val ia_modulus: String,
val ia_hash: String,
- val enc_exp_length: Int,
+ val enc_exponent_length: Int,
val enc_exponent: String,
- val enc_mod_length: Int,
+ val enc_modulus_length: Int,
val enc_modulus: String,
val enc_hash: String
)
diff --git a/sandbox/src/main/python/libeufin-cli
b/sandbox/src/main/python/libeufin-cli
index 03af95f..e80bd77 100755
--- a/sandbox/src/main/python/libeufin-cli
+++ b/sandbox/src/main/python/libeufin-cli
@@ -99,21 +99,27 @@ def customer_info(obj, customer_id):
)
@click.option(
"--customer-id",
+ required=True,
help="id of the customer at the bank (used to pick keyset on disk)"
)
@click.pass_obj
def keyletter(obj, customer_id):
+ url = urljoin(
+ obj["base_url"], "/admin/customers/{}".format(customer_id)
+ )
+
try:
- url = urljoin(
- obj["base_url"], "/admin/customers/{}".format(customer_id)
- )
resp = get(url)
except Exception:
print("Could not connect to the bank, aborting")
return
- assert(resp.status_code == 200)
+ if resp.status_code != 200:
+ print("Couldn't query info about the customer:
{}".format(resp.status_code))
+ return
+
+
user_id = resp.json().get("ebicsInfo", {}).get("userId")
name = resp.json().get("name")
assert(user_id)
@@ -157,7 +163,7 @@ def keyletter(obj, customer_id):
# Make the request body.
body = dict(
- INI=dict(
+ ini=dict(
userId=user_id,
customerId=customer_id,
name=name,
@@ -172,7 +178,7 @@ def keyletter(obj, customer_id):
hash=hashlib.sha256("{} {}".format(es_exponent,
es_modulus).encode()).hexdigest()
),
- HIA=dict(
+ hia=dict(
userId=user_id,
customerId=customer_id,
name=name,
@@ -194,14 +200,19 @@ def keyletter(obj, customer_id):
)
)
+ url = urljoin(
+ obj["base_url"],
"/admin/customers/{}/ebics/keyletter".format(customer_id)
+ )
+
try:
+ print("POSTing {}".format(body))
resp = post(url, json=body)
except Exception:
print("Could not reach the bank, aborting now")
return
if resp.status_code != 200:
- print("Bank did not accept this letter.")
+ print("Bank did not accept this letter: {}.".format(resp.status_code))
return
print("Letter accepted by the bank!")
--
To stop receiving notification emails like this one, please contact
address@hidden.