-
Notifications
You must be signed in to change notification settings - Fork 92
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 437, properly handle unknowns in the context. #1447
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for this contribution!
We can also remove the TODO in the comments on typecheck_restricted_expr()
.
Thank you for reviewing the PR. |
Signed-off-by: Mohamed Amine Ouali <[email protected]>
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.
Thanks for the contribution!
I'm not familiar with this code so I'm wondering how typechecking interacts in this case with the extensions. Is the use of unknown
s already checked against the extensions before we get to this code?
if restricted_expr.as_unknown().is_some() { | ||
return Ok(true); | ||
} |
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.
Do we need to check if the partial-eval
extension is enabled?
let result = typeValidator | ||
.typecheck_partial_value(&context.clone().into(), Extensions::all_available()); |
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.
All the tests use Extensions::all_available()
, but what happens if we don't use any?
Description of changes
Fixes the issues identified in #437
This change fix the validation of unknowns when validating the context.
Unit test have been added to meet the requirements specified in #437:
Some contexts containing unknowns should pass request validation, and others fail. For instance:
Issue #, if available
Resolves : #437
Checklist for requesting a review
The change in this PR is (choose one, and delete the other options):
cedar-policy
.I confirm that this PR (choose one, and delete the other options):
I confirm that
cedar-spec
(choose one, and delete the other options):I confirm that
docs.cedarpolicy.com
(choose one, and delete the other options):