-
Notifications
You must be signed in to change notification settings - Fork 80
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
Revise APIs of PrincipalOrResourceConstraint
#954
Conversation
…ResourceConstraint::get_euid` The original function returns an iterator that works on at most one element. So, this PR replaces it with a function returning an `Option` so that we can pattern match the return value more conveniently. Signed-off-by: Shaobo He <[email protected]>
PrincipalOrResourceConstraint::iter_euids
with ResourceConstraint::get_euid
PrincipalOrResourceConstraint::iter_euids
with PrincipalOrResourceConstraint::get_euid
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.
lgtm
Signed-off-by: Shaobo He <[email protected]>
PrincipalOrResourceConstraint::iter_euids
with PrincipalOrResourceConstraint::get_euid
PrincipalOrResourceConstraint
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.
Looks good. Name
and EntityUID
were already O(1) clone (they already contain Arc
s internally I believe), but I'm willing to believe this Arc
is still a good idea
Co-authored-by: Craig Disselkoen <[email protected]>
Looks like the downstream DRT will need to be fixed but the Java failure on Mac seems to be a glitch. |
Signed-off-by: Shaobo He <[email protected]>
Signed-off-by: Shaobo He <[email protected]>
Signed-off-by: Shaobo He <[email protected]>
Description of changes
PrincipalOrResourceConstraint::iter_euids
withPrincipalOrResourceConstraint::get_euid
Option
so that we can pattern match the return value more conveniently.Name
andEntityUID
withArc
Issue #, if available
Checklist for requesting a review
The change in this PR is (choose one, and delete the other options):
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):