gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: sanity checks


From: gnunet
Subject: [libeufin] branch master updated: sanity checks
Date: Wed, 22 Mar 2023 22:12:47 +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 71aa5ab6 sanity checks
71aa5ab6 is described below

commit 71aa5ab6c70bc3c5d0882d1d3a9fdf2b50048272
Author: ms <ms@taler.net>
AuthorDate: Wed Mar 22 22:12:40 2023 +0100

    sanity checks
---
 sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index 4d91257d..0d2a80d0 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -1484,10 +1484,14 @@ val sandboxApp: Application.() -> Unit = {
                         throw forbidden("Cannot access bank account 
${bankAccount.label}")
                     // Paging values.
                     val page: Int = 
expectInt(call.request.queryParameters["page"] ?: "1")
+                    if (page < 1) throw badRequest("'page' param is less than 
1")
                     val size: Int = 
expectInt(call.request.queryParameters["size"] ?: "5")
+                    if (size < 1) throw badRequest("'size' param is less than 
1")
                     // Time range filter values
                     val fromMs = 
expectLong(call.request.queryParameters["from_ms"] ?: "0")
+                    if (fromMs < 0) throw badRequest("'from_ms' param is less 
than 0")
                     val untilMs = 
expectLong(call.request.queryParameters["until_ms"] ?: 
Long.MAX_VALUE.toString())
+                    if (untilMs < 0) throw badRequest("'until_ms' param is 
less than 0")
                     val ret = mutableListOf<RawPayment>()
                     /**
                      * Case where page number wasn't given,

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