[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: stop serving the SPA
From: |
gnunet |
Subject: |
[libeufin] branch master updated: stop serving the SPA |
Date: |
Tue, 01 Nov 2022 15:07:07 +0100 |
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 d90fb73b stop serving the SPA
d90fb73b is described below
commit d90fb73b1d1926ccbc11a4fdd89c253fab6fb626
Author: MS <ms@taler.net>
AuthorDate: Tue Nov 1 15:06:47 2022 +0100
stop serving the SPA
---
.../tech/libeufin/nexus/bankaccount/BankAccount.kt | 6 ++++
.../src/main/kotlin/tech/libeufin/sandbox/Main.kt | 39 ----------------------
sandbox/src/main/resources/static/spa.html | 9 -----
3 files changed, 6 insertions(+), 48 deletions(-)
diff --git
a/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
index ebd0c91e..9afde31d 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
@@ -397,6 +397,7 @@ fun importBankAccount(call: ApplicationCall,
offeredBankAccountId: String, nexus
)
// detect name collisions first.
NexusBankAccountEntity.findByName(nexusBankAccountId).run {
+ // This variable will either host a new, or a found imported bank
account.
val importedAccount = when (this) {
is NexusBankAccountEntity -> {
if (this.iban !=
offeredAccount[OfferedBankAccountsTable.iban]) {
@@ -406,8 +407,11 @@ fun importBankAccount(call: ApplicationCall,
offeredBankAccountId: String, nexus
"Cannot import two different accounts under one
label: $nexusBankAccountId"
)
}
+ // a imported bank account already exists and
+ // the user tried to import the same IBAN to it. Do
nothing
this
}
+ // such named imported account didn't exist. Make it
else -> {
val newImportedAccount = NexusBankAccountEntity.new {
bankAccountName = nexusBankAccountId
@@ -421,6 +425,8 @@ fun importBankAccount(call: ApplicationCall,
offeredBankAccountId: String, nexus
newImportedAccount
}
}
+ // Associate the bank account as named by the bank (the 'offered')
+ // with the imported/local one (the 'imported'). Rewrites are
acceptable.
OfferedBankAccountsTable.update(
{
OfferedBankAccountsTable.offeredAccountId eq
offeredBankAccountId and
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index cb0dcd38..fb5504bf 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -1033,45 +1033,6 @@ val sandboxApp: Application.() -> Unit = {
*/
get("/demobanks/{demobankid}") {
val demobank = ensureDemobank(call)
-
- /**
- * Respond the SPA if the content type is not "application/json".
- */
- if (call.request.headers["Content-Type"] != "application/json") {
- val spa: InputStream? =
ClassLoader.getSystemClassLoader().getResourceAsStream("static/spa.html")
- if (spa == null) throw internalServerError("SPA not found!")
- // load whole SPA from disk. Now <200KB, fine to block-read
it.
- var content = String(spa.readBytes(), Charsets.UTF_8)
- content = content.replace(
- "__LIBEUFIN_UI_IS_DEMO__",
- demobank.withSignupBonus.toString()
- )
- val landingUrl = System.getenv(
- "TALER_ENV_URL_INTRO") ?: "https://demo.taler.net/"
- content = content.replace("__DEMO_SITE_LANDING_URL__",
landingUrl)
- val bankUrl = System.getenv(
- "TALER_ENV_URL_BANK") ?:
"https://demo.taler.net/sandbox/demobanks/default/"
- content = content.replace("__DEMO_SITE_BANK_URL__", bankUrl)
- val blogUrl = System.getenv(
- "TALER_ENV_URL_MERCHANT_BLOG") ?:
"https://demo.taler.net/blog/"
- content = content.replace("__DEMO_SITE_BLOG_URL__", blogUrl)
- val donationsUrl = System.getenv(
- "TALER_ENV_URL_MERCHANT_DONATIONS") ?:
"https://demo.taler.net/donations/"
- content = content.replace("__DEMO_SITE_DONATIONS_URL__",
donationsUrl)
- val surveyUrl = System.getenv(
- "TALER_ENV_URL_MERCHANT_SURVEY") ?:
"https://demo.taler.net/survey/"
- content = content.replace("__DEMO_SITE_SURVEY_URL__",
surveyUrl)
- content = content.replace(
- "__LIBEUFIN_UI_ALLOW_REGISTRATIONS__",
- demobank.allowRegistrations.toString()
- )
- content = content.replace(
- "__LIBEUFIN_UI_BANK_NAME__",
- demobank.uiTitle
- )
- call.respondText(content, ContentType.Text.Html)
- return@get
- }
expectAdmin(call.request.basicAuth())
call.respond(getJsonFromDemobankConfig(demobank))
return@get
diff --git a/sandbox/src/main/resources/static/spa.html
b/sandbox/src/main/resources/static/spa.html
deleted file mode 100644
index 71780899..00000000
--- a/sandbox/src/main/resources/static/spa.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html><html lang="en" class="has-aside-left
has-aside-mobile-transition has-navbar-fixed-top
has-aside-expanded"><head><meta charset="utf-8"><title>taler-bank</title><meta
name="viewport" content="width=device-width,initial-scale=1"><meta
name="mobile-web-app-capable" content="yes"><meta
name="apple-mobile-web-app-capable" content="yes"><link rel="icon"
href="data:;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABILAAASCwAAAAAAAAAAAAD/////////////////////////
[...]
-Pure v0.6.2
-Copyright 2013 Yahoo!
-Licensed under the BSD License.
-https://github.com/yahoo/pure/blob/master/LICENSE.md
-*//*!
-normalize.css v^3.0 | MIT License | git.io/normalize
-Copyright (c) Nicolas Gallagher and Jonathan Neal
-*//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css
*/html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[
[...]
\ No newline at end of file
--
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: stop serving the SPA,
gnunet <=