You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by wa...@apache.org on 2026/02/26 23:18:58 UTC

(tooling-trusted-releases) branch proper-pagination-validation-checks created (now 8d56a44f)

This is an automated email from the ASF dual-hosted git repository.

wave pushed a change to branch proper-pagination-validation-checks
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


      at 8d56a44f Proper pagination validation checks

This branch includes the following new commits:

     new 8d56a44f Proper pagination validation checks

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org


(tooling-trusted-releases) 01/01: Proper pagination validation checks

Posted by wa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wave pushed a commit to branch proper-pagination-validation-checks
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git

commit 8d56a44f4e98def1dfc18414dde8a3127857f31b
Author: Dave Fisher <da...@comcast.net>
AuthorDate: Thu Feb 26 15:18:49 2026 -0800

    Proper pagination validation checks
---
 atr/api/__init__.py | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/atr/api/__init__.py b/atr/api/__init__.py
index 7e2c6117..251e268e 100644
--- a/atr/api/__init__.py
+++ b/atr/api/__init__.py
@@ -1471,9 +1471,20 @@ async def _match_unfinished(release_directory: pathlib.Path, data: models.api.Si
 def _pagination_args_validate(query_args: Any) -> None:
     # Users could request any amount using limit=N with arbitrarily high N
     # We therefore limit the maximum limit to 1000
-    if hasattr(query_args, "limit") and (query_args.limit > 1000):
-        # quart.abort(400, "Limit is too high")
-        raise exceptions.BadRequest("Maximum limit of 1000 exceeded")
+    if hasattr(query_args, "limit"):
+        limit = query_args.limit
+        if limit > 1000:
+            raise exceptions.BadRequest("Maximum limit of 1000 exceeded")
+        elif limit < 1:
+            raise exceptions.BadRequest("Minimum limit less than 1 is nonsense")
+    # Users could request any amount using offset=N with arbitrarily high N
+    # We therefore limit the maximum offset to 1000000
+    if hasattr(query_args, "offest"):
+        offset = query_args.offset
+        if offset > 1000000:
+            raise exceptions.BadRequest("Maximum offset of 1000000 exceeded")
+        elif offset < 0:
+            raise exceptions.BadRequest("Minimum offset less than 0 is nonsense")
 
 
 def _simple_check(*args: str | None) -> None:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org