Cap unbounded list endpoints with mandatory pagination #13
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
List endpoints return all matching records without a limit cap:
canonical_control_routes.py:276-293—limitparameter is optional with no enforced maximumA single query against a large tenant could return 100,000+ rows, causing memory exhaustion and timeouts.
Required Actions
PaginatedResponsebase schema tocompliance/schemas/pagination.py:limit: int = Query(100, ge=1, le=1000)— default 100, hard cap 1000PaginatedResponsefrom every list endpointAcceptance Criteria
total,offset,limitmetadatatotal > limitcase (shows load-more or page controls)