Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add resource constraints for CEL #3144
Add resource constraints for CEL #3144
Changes from 11 commits
ae09cbb
16283e1
11be065
eea4fd8
ff38644
efda13f
fa0b979
bf2b434
76e4605
e4b49ba
8bd777a
e541ae3
6a550cb
ac9e0e7
4e440b0
3e36b22
8736077
49fe807
5f96b1c
5f44379
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guarding against malformed/malicious expressions is definitely in scope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it's useful, but we could set a max length of a list based on the 3MB request limit and the size of the most compact encoding possible:
3*1024*1024 / 2
(0,0,0,0,0,0,0,0,0,...
encoding)3*1024*1024 / 3
("","","","","",...
encoding)3*1024*1024 / 3
([],[],[],[],[],...
encoding)3*1024*1024 / 3
({},{},{},{},{},...
encoding)I'm not sure if passing such big list sizes to CEL would make the cost subsystem go nuts or not, but we could check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'll give passing lists of that size through CEL a shot and see what happens. I think that list might work well to provide
maxLength
with a default value, though I'm concerned that there will be a large discrepancy between what we'd estimate resource usage to be versus what we'd see in practice if we actually ran the expressions. I suspect any solution that works withoutmaxLength
being explicitly set will run into the same issue, though.