-
Notifications
You must be signed in to change notification settings - Fork 88
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 entity manifests bug caused by aliasing between entity literal and var #1429
Conversation
…d var Signed-off-by: John Kastner <[email protected]>
Signed-off-by: John Kastner <[email protected]>
assert_eq!( | ||
uid1, uid2, | ||
"attempting to merge entities with different uids!" | ||
); | ||
assert_eq!( | ||
ancestors1, ancestors2, | ||
"attempting to merge entities with different ancestors!" | ||
); | ||
assert!( | ||
tags1.is_empty() && tags2.is_empty(), | ||
"attempting to merge entities with tags!" | ||
); |
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.
consider debug_assert
instead of assert
, since these might have nontrivial runtime cost?
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 actually closer to lifting this to an Err
result for invariant violation
Signed-off-by: John Kastner <[email protected]>
Signed-off-by: John Kastner <[email protected]>
Signed-off-by: John Kastner <[email protected]>
Description of changes
Given a policy like
and a request where the principal is
a::""
, the slicing algorithm failed to select take the attributeA
because it did not correctly account forprincipal
anda::""
referencing the same entity.Issue #, if available
Checklist for requesting a review
The change in this PR is (choose one, and delete the other options):
cedar-policy
(e.g., changes to the signature of an existing API).cedar-policy
(e.g., addition of a new API).cedar-policy
.cedar-policy-core
,cedar-validator
, etc.)I confirm that this PR (choose one, and delete the other options):
I confirm that
cedar-spec
(choose one, and delete the other options):cedar-spec
, and how you have tested that your updates are correct.)cedar-spec
. (Post your PR anyways, and we'll discuss in the comments.)I confirm that
docs.cedarpolicy.com
(choose one, and delete the other options):cedar-docs
. PRs should be targeted at astaging-X.Y
branch, notmain
.)