Enforce offset pagination limit on Projects API
What does this MR do and why?
Enforces the offset pagination limits to unauthenticated Projects API requests (defaults to 50,000 offset)
References
- Breaking Change Exception: https://gitlab.com/gitlab-com/Product/-/issues/14429
- Related to #581517
Screenshots or screen recordings
N/A
How to set up and validate locally
- Make an unauthenticated requests to
http://localhost:3000/api/v4/projects?page=2501- Based on
2501 (page) * 20 (default page size) = 50,020.
- Based on
- You should get the following result
{"error":"Offset pagination has a maximum allowed offset of 50000 for requests that return objects of type Project. Remaining records can be retrieved using keyset pagination."}
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Shane Maglangit