libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 104081254163dea144ed24d0b344acf5bafd5285
parent 838143b80becb19024e219eba4edd605e9d4fad5
Author: MS <ms@taler.net>
Date:   Tue, 23 Jun 2020 15:27:22 +0200

check facade type upon facade creation

Diffstat:
Mintegration-tests/test-taler-facade.py | 6+++---
Mnexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt | 4++++
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/integration-tests/test-taler-facade.py b/integration-tests/test-taler-facade.py @@ -163,7 +163,7 @@ assertResponse( amount="EUR:1", exchange_base_url="http//url", wtid="nice", - credit_account="payto://iban/THEBIC/THEIBAN?name=theName" + credit_account="payto://iban/THEBIC/THEIBAN?receiver-name=theName" ), headers=dict(Authorization=USER_AUTHORIZATION_HEADER) ) @@ -178,7 +178,7 @@ assertResponse( amount="EUR:2", exchange_base_url="http//url", wtid="more nice", - credit_account="payto://iban/THEBIC/THEIBAN?name=theName" + credit_account="payto://iban/THEBIC/THEIBAN?receiver-name=theName" ), headers=dict(Authorization=USER_AUTHORIZATION_HEADER) ) @@ -204,7 +204,7 @@ resp = assertResponse( json=dict( amount="EUR:1", reserve_pub="my-reserve-pub", - debit_account="payto://iban/DONATOR/MONEY?name=TheDonator" + debit_account="payto://iban/DONATOR/MONEY?sender-name=TheDonator" ), headers=dict(Authorization=USER_AUTHORIZATION_HEADER) ) diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt @@ -741,6 +741,10 @@ fun serverMain(dbName: String, host: String) { post("/facades") { val body = call.receive<FacadeInfo>() + if (body.type != "taler-wire-gateway") throw NexusError( + HttpStatusCode.NotImplemented, + "Facade type '${body.type}' is not implemented" + ) val newFacade = transaction { val user = authenticateRequest(call.request) FacadeEntity.new(body.name) {