-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constrain the maximum number of results in a query #14917
Comments
Hi @0Tech. I'm not understanding the summary or the problem definition. What's wrong with the current pagination mechanism? If limits are kept reasonable, which are set by clients, then how can responses be huge? |
There are always malicious clients and end users. And we cannot stop them using our services. We could deal with it on other layers (e.g. transport layer), but it would be much nicer to have it on application layer too. Because the server must prepare the response of a huge size prior to transmission, and also gRPC already has the related design. |
This makes sense to me, we should have a max limit of what is possible to get per page. |
Sure, I agree.
Yes, you can. You can use firewalls. I'm not opposed to the idea though. |
You're right. We can always let firewalls replace the limit in the request. Thank you for the correction.
😄 |
The proposal looks good. We'll add it to our roadmap 👍 |
Summary
Query server should be able to constrain the maximum number of results in a single page.
Problem Definition
For now, end-users can request a query with a pagination of any limit. It means a huge size of the response.
This change would not introduce a break-change, and the clients already expect this behavior (refer: https://cloud.google.com/apis/design/design_patterns#list_pagination).
Proposal
MaxLimit
to constrain the maximum number of results.limit
intypes.query.Paginate()
andtypes.query.CollectionFilteredPaginate()
.MaxLimit
into variable (it's a constant now), so app developers can change the value.The text was updated successfully, but these errors were encountered: