commit 6aaa8b6aeac30c428443d68f3e17d5e331d45fa0
parent 1985072fca834a5d9ef8b4823526fe9288ade237
Author: Marcello Stanisci <ms@taler.net>
Date: Fri, 8 May 2020 17:25:11 +0200
new API.
Re- include Main2 into compilation.
Diffstat:
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/nexus/build.gradle b/nexus/build.gradle
@@ -16,7 +16,7 @@ plugins {
sourceSets {
main.kotlin.srcDirs = ["src/main/kotlin"]
- main.kotlin.excludes = ["**/Main2.kt"]
+ // main.kotlin.excludes = ["**/Main2.kt"]
}
task installToPrefix(type: Copy) {
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Helpers.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Helpers.kt
@@ -325,7 +325,7 @@ fun extractUserAndHashedPassword(authorizationHeader: String): Pair<String, Byte
* and makes sure that the user exists in the system.
*
* @param authorization the Authorization:-header line.
- * @return subscriber id
+ * @return user id
*/
fun authenticateRequest(authorization: String?): String {
val headerLine = if (authorization == null) throw NexusError(
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main2.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Main2.kt
@@ -59,13 +59,15 @@ import javax.crypto.EncryptedPrivateKeyInfo
import javax.sql.rowset.serial.SerialBlob
-data class NexusError(val statusCode: HttpStatusCode, val reason: String) : Exception()
+/**
+ * Conflicts with current Main.kt
+data class NexusError(val statusCode: HttpStatusCode, val reason: String) : Exception()
val logger: Logger = LoggerFactory.getLogger("tech.libeufin.nexus")
-
fun isProduction(): Boolean {
return System.getenv("NEXUS_PRODUCTION") != null
}
+ */
@ExperimentalIoApi
@KtorExperimentalAPI
@@ -185,7 +187,7 @@ fun main() {
* Queries list of transactions ALREADY downloaded from the bank.
*/
get("/bank-accounts/{accountid}/collected-transactions") {
- return@post
+ return@get
}
/**
* Adds a new bank transport.
@@ -208,7 +210,7 @@ fun main() {
return@post
}
}
- logger.info("Up and running")
- server.start(wait = true)
}
+ logger.info("Up and running")
+ server.start(wait = true)
}
\ No newline at end of file