[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: Admin command to create a new HostID.
From: |
gnunet |
Subject: |
[libeufin] branch master updated: Admin command to create a new HostID. |
Date: |
Tue, 28 Jan 2020 15:27:19 +0100 |
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 6d6ce02 Admin command to create a new HostID.
6d6ce02 is described below
commit 6d6ce026a37d8f88ceb3370efb40e86d4d26d8b9
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Jan 28 15:13:25 2020 +0100
Admin command to create a new HostID.
---
nexus/src/test/script/prepare_subscriber.sh | 2 +-
.../src/main/kotlin/tech/libeufin/sandbox/JSON.kt | 2 +-
.../src/main/kotlin/tech/libeufin/sandbox/Main.kt | 20 ++++++++++++++-
sandbox/src/main/python/libeufin-cli | 30 ++++++++++++++++++++++
4 files changed, 51 insertions(+), 3 deletions(-)
diff --git a/nexus/src/test/script/prepare_subscriber.sh
b/nexus/src/test/script/prepare_subscriber.sh
index 1bb2dd8..7f172b1 100755
--- a/nexus/src/test/script/prepare_subscriber.sh
+++ b/nexus/src/test/script/prepare_subscriber.sh
@@ -37,7 +37,7 @@ read x
printf "\n"
exe_echo libeufin-cli ebics new-subscriber \
- --ebics-url http://localhost:5001/ebicsweb \
+ --ebics-url http://localhost:5000/ebicsweb \
--user-id "user$1" \
--partner-id "partner$1" \
--host-id "host$1" && sleep 1
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/JSON.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/JSON.kt
index 8d8eafe..997cf57 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/JSON.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/JSON.kt
@@ -141,7 +141,7 @@ data class EbicsHostResponse(
)
data class EbicsHostCreateRequest(
- val hostID: String,
+ val hostId: String,
val ebicsVersion: String
)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index 6a2b893..4e68623 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -330,12 +330,30 @@ fun main() {
}
post("/ebics/hosts") {
val req = call.receive<EbicsHostCreateRequest>()
+
+ val pairA = CryptoUtil.generateRsaKeyPair(2048)
+ val pairB = CryptoUtil.generateRsaKeyPair(2048)
+ val pairC = CryptoUtil.generateRsaKeyPair(2048)
+
transaction {
+ addLogger(StdOutSqlLogger)
EbicsHostEntity.new {
this.ebicsVersion = req.ebicsVersion
- this.hostId = hostId
+ this.hostId = req.hostId
+ this.authenticationPrivateKey =
SerialBlob(pairA.private.encoded)
+ this.encryptionPrivateKey =
SerialBlob(pairB.private.encoded)
+ this.signaturePrivateKey =
SerialBlob(pairC.private.encoded)
+
}
}
+
+ call.respondText(
+ "Host created.",
+ ContentType.Text.Plain,
+ HttpStatusCode.OK
+ )
+ return@post
+
}
get("/ebics/hosts/{id}") {
val resp = transaction {
diff --git a/sandbox/src/main/python/libeufin-cli
b/sandbox/src/main/python/libeufin-cli
index 9311d44..68de4c0 100755
--- a/sandbox/src/main/python/libeufin-cli
+++ b/sandbox/src/main/python/libeufin-cli
@@ -23,6 +23,36 @@ def cli(ctx, nexus_base_url):
def admin():
pass
+
+@admin.command(help="Instruct the Sandbox to create a new EBICS host ID.")
+@click.option(
+ "--sandbox-url",
+ help="URL (with path) of the Sandbox that will activate the new
Subscriber",
+ required=True
+)
+@click.option(
+ "--host-id",
+ help="EBICS host ID",
+ required=True
+)
+@click.option(
+ "--ebics-version",
+ help="EBICS version to support",
+ required=True
+)
+def add_host(sandbox_url, host_id, ebics_version):
+ body = dict(
+ hostId=host_id,
+ ebicsVersion=ebics_version
+ )
+ try:
+ resp = post(sandbox_url, json=body)
+ except Exception:
+ print("Could not reach the Sandbox")
+ return
+
+ print(resp.content.decode("utf-8"))
+
@admin.command(help="Instruct the Sandbox to create a new EBICS Subscriber")
@click.option(
"--sandbox-url",
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: Admin command to create a new HostID.,
gnunet <=