-
Notifications
You must be signed in to change notification settings - Fork 107
Fix formatter soundness check #865
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
Conversation
Signed-off-by: Shaobo He <[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.
Can we add a test case?
Good idea. Working on it. |
Signed-off-by: Shaobo He <[email protected]>
Signed-off-by: Shaobo He <[email protected]>
let p1 = r#"permit (principal, action, resource) | ||
when { " | ||
a | ||
" };"#; | ||
let p2 = r#"permit (principal, action, resource) | ||
when { " | ||
a | ||
" };"#; | ||
assert!(soundness_check(p2, &parse_policyset(p1).unwrap()).is_err()); |
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.
Probably a dumb question, but why does the change in this PR help identify the issue in #862? Looking at the diff, it seems like the only change is to add a comparison of policy ids, which doesn't seem related.
Or is this test case unrelated to the changed code?
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.
templates()
to policies()
I think (line 45)
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.
Aha, thanks. @shaobo-he-aws can you add a description to the PR so it's easy not to miss this.
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.
Done.
"policies differ in meaning or annotations:\noriginal: {p}\nformatted: {f_p}" | ||
"policies differ in policy ids or meaning or annotations:\noriginal: {p}\nformatted: {f_p}" |
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.
Nit: probably easier for debugging if you separate these cases.
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 think I'll leave it to future work
Signed-off-by: Shaobo He <[email protected]>
Signed-off-by: Shaobo He <[email protected]>
Signed-off-by: Shaobo He <[email protected]>
Signed-off-by: Shaobo He <[email protected]>
Signed-off-by: Shaobo He <[email protected]>
Description of changes
There were two issues with the original function.
Issue #, if available
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):