-
Notifications
You must be signed in to change notification settings - Fork 285
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
Fix the caveat expr limit to be processed by our code #1638
Conversation
cc0b6e2
to
8352d00
Compare
@TristonianJones if you have any insights on how we could do this in a "supported" fashion, I'd be quite happy for the guidance |
Right now, as a hack to ensure caveat error messages have the correct line and col information, we replace the preceding schema with newlines. However, the CEL parser has a default limit on the size of the expression it can be given, which was causing the error. With this change, we turn off the CEL check and instead check the *trimmed* expression ourselves for a limit. Long term, we'll want to issue a change in CEL to allow updating of the positioning information instead of this hack Adds tests and fixes authzed#1637
8352d00
to
49bfa31
Compare
The |
Can you point me to where I can set these? Last time I tried to do so, the error messages weren't be adjusted.
To ensure that the positioning is correct, we generate whitespace to mimic the position of the expression in the overall file, so yes, this can happen. The vast majority of it is just newlines. |
@TristonianJones if you have any pointers for the above, I'd be quite grateful :) |
Right now, as a hack to ensure caveat error messages have the correct line and col information, we replace the preceding schema with newlines. However, the CEL parser has a default limit on the size of the expression it can be given, which was causing the error. With this change, we turn off the CEL check and instead check the trimmed expression ourselves for a limit.
Long term, we'll want to issue a change in CEL to allow updating of the positioning information instead of this hack
Adds tests and fixes #1637