[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: fix facade URL creation
From: |
gnunet |
Subject: |
[libeufin] branch master updated: fix facade URL creation |
Date: |
Tue, 03 Aug 2021 14:43:51 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new 4bf7300 fix facade URL creation
4bf7300 is described below
commit 4bf7300afa7ee9d0b1959833d448618d7dd34b0c
Author: Florian Dold <florian@dold.me>
AuthorDate: Tue Aug 3 14:43:45 2021 +0200
fix facade URL creation
---
debian/changelog | 6 ++++
.../tech/libeufin/nexus/server/NexusServer.kt | 32 ++++++++--------------
2 files changed, 18 insertions(+), 20 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index c715dde..bbae033 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libeufin (0.0.1-5) unstable; urgency=medium
+
+ * Fix facade URL.
+
+ -- Florian Dold <florian@dold.me> Tue, 03 Aug 2021 14:43:33 +0200
+
libeufin (0.0.1-4) unstable; urgency=medium
* Bugfixes in libeufin-cli and libeufin-nexus.
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 9b53c4b..b8c7404 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
@@ -40,6 +40,7 @@ import io.ktor.response.*
import io.ktor.routing.*
import io.ktor.server.engine.*
import io.ktor.server.netty.*
+import io.ktor.util.*
import org.jetbrains.exposed.exceptions.ExposedSQLException
import org.jetbrains.exposed.sql.and
import org.jetbrains.exposed.sql.transactions.transaction
@@ -145,24 +146,6 @@ suspend inline fun <reified T : Any>
ApplicationCall.receiveJson(): T {
}
}
-
-fun createLoopbackBankConnection(bankConnectionName: String, user:
NexusUserEntity, data: JsonNode) {
- val bankConn = NexusBankConnectionEntity.new {
- this.connectionId = bankConnectionName
- owner = user
- type = "loopback"
- }
- val bankAccount = jacksonObjectMapper().treeToValue(data,
BankAccount::class.java)
- NexusBankAccountEntity.new {
- bankAccountName = bankAccount.nexusBankAccountId
- iban = bankAccount.iban
- bankCode = bankAccount.bic
- accountHolder = bankAccount.ownerName
- defaultBankConnection = bankConn
- highestSeenBankMessageSerialId = 0
- }
-}
-
fun requireBankConnectionInternal(connId: String): NexusBankConnectionEntity {
return transaction {
NexusBankConnectionEntity.find {
NexusBankConnectionsTable.connectionId eq connId }.firstOrNull()
@@ -865,10 +848,15 @@ fun serverMain(dbName: String, host: String, port: Int) {
val f = FacadeEntity.findByName(fcid) ?: throw NexusError(
HttpStatusCode.NotFound, "Facade $fcid does not exist"
)
+ // FIXME: this only works for TWG urls.
FacadeShowInfo(
name = f.facadeName,
type = f.type,
- baseUrl =
"http://${host}/facades/${f.id.value}/${f.type}/",
+ twgBaseUrl = call.url {
+ parameters.clear()
+ encodedPath = ""
+ pathComponents("facades", f.facadeName, f.type)
+ },
config = getFacadeState(f.type, f)
)
}
@@ -890,7 +878,11 @@ fun serverMain(dbName: String, host: String, port: Int) {
FacadeShowInfo(
name = it.facadeName,
type = it.type,
- twgBaseUrl =
"http://${host}/facades/${it.facadeName}/${it.type}/",
+ twgBaseUrl = call.url {
+ parameters.clear()
+ encodedPath = ""
+ pathComponents("facades", it.facadeName,
it.type)
+ },
config = getFacadeState(it.type, it)
)
)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: fix facade URL creation,
gnunet <=