gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: enable Anastasis facade and offer API.


From: gnunet
Subject: [libeufin] branch master updated: enable Anastasis facade and offer API.
Date: Tue, 17 Aug 2021 16:51:20 +0200

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

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 01d0acf  enable Anastasis facade and offer API.
01d0acf is described below

commit 01d0acf19a84fa10d97b2df533c4b7ea1151ad82
Author: MS <ms@taler.net>
AuthorDate: Tue Aug 17 03:50:29 2021 -1100

    enable Anastasis facade and offer API.
---
 nexus/src/main/kotlin/tech/libeufin/nexus/Anastasis.kt          | 9 +++++++++
 nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt | 8 ++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Anastasis.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/Anastasis.kt
index 043c5cd..6086119 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Anastasis.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Anastasis.kt
@@ -1,6 +1,7 @@
 package tech.libeufin.nexus
 
 import io.ktor.application.*
+import io.ktor.client.*
 import io.ktor.http.*
 import io.ktor.response.*
 import org.jetbrains.exposed.sql.transactions.transaction
@@ -12,6 +13,7 @@ import tech.libeufin.util.EbicsProtocolError
 import kotlin.math.abs
 import kotlin.math.min
 import io.ktor.content.TextContent
+import io.ktor.routing.*
 
 data class AnastasisIncomingBankTransaction(
     val row_id: Long,
@@ -103,4 +105,11 @@ private suspend fun historyIncoming(call: ApplicationCall) 
{
         }
     }
     return call.respond(TextContent(customConverter(history), 
ContentType.Application.Json))
+}
+
+fun anastasisFacadeRoutes(route: Route, httpClient: HttpClient) {
+    route.get("/history/incoming") {
+        historyIncoming(call)
+        return@get
+    }
 }
\ No newline at end of file
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
index 853056f..c2aa267 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
@@ -61,7 +61,7 @@ import kotlin.system.exitProcess
 fun getFacadeState(type: String, facade: FacadeEntity): JsonNode {
     return transaction {
         when (type) {
-            "taler-wire-gateway" -> {
+            "taler-wire-gateway", "anastasis" -> {
                 val state = FacadeStateEntity.find {
                     FacadeStateTable.facade eq facade.id
                 }.firstOrNull()
@@ -959,7 +959,8 @@ fun serverMain(host: String, port: Int) {
                 requireSuperuser(call.request)
                 val body = call.receive<FacadeInfo>()
                 requireValidResourceName(body.name)
-                if (body.type != "taler-wire-gateway") throw NexusError(
+                if (!listOf("taler-wire-gateway", 
"anastasis").contains(body.type))
+                 throw NexusError(
                     HttpStatusCode.NotImplemented,
                     "Facade type '${body.type}' is not implemented"
                 )
@@ -1048,6 +1049,9 @@ fun serverMain(host: String, port: Int) {
             route("/facades/{fcid}/taler-wire-gateway") {
                 talerFacadeRoutes(this, client)
             }
+            route("/facades/{fcid}/anastasis") {
+                anastasisFacadeRoutes(this, client)
+            }
 
             // Hello endpoint.
             get("/") {

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