gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] 01/02: minor CLI changes, ignore extra JSON fields


From: gnunet
Subject: [libeufin] 01/02: minor CLI changes, ignore extra JSON fields
Date: Tue, 03 Aug 2021 14:00:27 +0200

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

dold pushed a commit to branch master
in repository libeufin.

commit fa88d5aa851e4ae8fe835ee10e807b4a478fdbf9
Author: Florian Dold <florian@dold.me>
AuthorDate: Tue Aug 3 13:54:32 2021 +0200

    minor CLI changes, ignore extra JSON fields
---
 cli/bin/libeufin-cli                               |  7 +++----
 nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt | 22 ----------------------
 .../tech/libeufin/nexus/server/NexusServer.kt      |  5 ++---
 3 files changed, 5 insertions(+), 29 deletions(-)

diff --git a/cli/bin/libeufin-cli b/cli/bin/libeufin-cli
index dcd8abd..6bab568 100755
--- a/cli/bin/libeufin-cli
+++ b/cli/bin/libeufin-cli
@@ -804,10 +804,9 @@ def transactions(obj, compact, account_name):
         tell_user(resp, withsuccess=True)
     check_response_status(resp)
 
-@facades.command(help="List active facades in the Nexus")
-@click.argument("connection-name")
+@facades.command("list", help="List active facades in the Nexus")
 @click.pass_obj
-def list_facades(obj, connection_name):
+def list_facades(obj):
     url = urljoin(obj.nexus_base_url, "/facades")
     try:
         resp = get(url, auth=auth.HTTPBasicAuth(obj.username, obj.password))
@@ -819,7 +818,7 @@ def list_facades(obj, connection_name):
     check_response_status(resp)
 
 
-@facades.command(help="create a new (Taler) facade")
+@facades.command("new-taler-wire-gateway-facade", help="create a new Taler 
Wire Gateway facade")
 @click.option("--facade-name", help="Name of the facade", required=True)
 @click.option("--currency", help="Facade's currency", required=True)
 @click.argument("connection-name")
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt
index 16519c4..bdeb91b 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Taler.kt
@@ -23,12 +23,9 @@ import 
com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
 import io.ktor.application.ApplicationCall
 import io.ktor.application.call
 import io.ktor.client.HttpClient
-import io.ktor.client.request.post
-import io.ktor.client.statement.*
 import io.ktor.content.TextContent
 import io.ktor.http.ContentType
 import io.ktor.http.HttpStatusCode
-import io.ktor.http.contentType
 import io.ktor.request.receive
 import io.ktor.response.respond
 import io.ktor.response.respondText
@@ -93,29 +90,10 @@ data class TalerOutgoingHistory(
     var outgoing_transactions: MutableList<TalerOutgoingBankTransaction> = 
mutableListOf()
 )
 
-/** Test APIs' data structures. */
-data class TalerAdminAddIncoming(
-    val amount: String,
-    val reserve_pub: String,
-    /**
-     * This account is the one giving money to the exchange.  It doesn't
-     * have to be 'created' as it might (and normally is) simply be a payto://
-     * address pointing to a bank account hosted in a different financial
-     * institution.
-     */
-    val debit_account: String
-)
-
 data class GnunetTimestamp(
     val t_ms: Long
 )
 
-data class TalerAddIncomingResponse(
-    val timestamp: GnunetTimestamp,
-    val row_id: Long
-)
-
-
 /** Sort query results in descending order for negative deltas, and ascending 
otherwise.  */
 fun <T : Entity<Long>> SizedIterable<T>.orderTaler(delta: Int): List<T> {
     return if (delta < 0) {
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 465ec45..476aede 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
@@ -23,6 +23,7 @@ import com.fasterxml.jackson.core.util.DefaultIndenter
 import com.fasterxml.jackson.core.util.DefaultPrettyPrinter
 import com.fasterxml.jackson.databind.JsonNode
 import com.fasterxml.jackson.core.JsonParseException
+import com.fasterxml.jackson.databind.DeserializationFeature
 import com.fasterxml.jackson.databind.SerializationFeature
 import com.fasterxml.jackson.databind.exc.MismatchedInputException
 import com.fasterxml.jackson.module.kotlin.KotlinModule
@@ -39,9 +40,6 @@ import io.ktor.response.*
 import io.ktor.routing.*
 import io.ktor.server.engine.*
 import io.ktor.server.netty.*
-import io.ktor.util.*
-import io.ktor.util.pipeline.*
-import io.ktor.utils.io.*
 import org.jetbrains.exposed.exceptions.ExposedSQLException
 import org.jetbrains.exposed.sql.and
 import org.jetbrains.exposed.sql.transactions.transaction
@@ -204,6 +202,7 @@ fun serverMain(dbName: String, host: String, port: Int) {
                     indentObjectsWith(DefaultIndenter("  ", "\n"))
                 })
                 registerModule(KotlinModule(nullisSameAsDefault = true))
+                configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, 
false)
             }
         }
         install(StatusPages) {

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