-
Notifications
You must be signed in to change notification settings - Fork 15
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
Followup to #145 #155
Followup to #145 #155
Conversation
1 => Ok(PrincipalOrResourceConstraint::IsType(ety)), | ||
1 => Ok(PrincipalOrResourceConstraint::IsTypeIn(ety, uid)) | ||
) | ||
} | ||
} | ||
fn arbitrary_principal_constraint_size_hint(depth: usize) -> (usize, Option<usize>) { |
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 not sure whether/how the *_size_hint
functions need to be updated. Suggestions welcome.
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.
@cdisselkoen may have written the original
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.
They are mostly performance optimizations; see docs on Arbitrary::size_hint. If/when we migrate to Bolero, they will go away.
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.
So it's fine to leave these functions as-is?
let uid = self | ||
.exprgenerator(Some(hierarchy)) | ||
.arbitrary_principal_uid(u)?; |
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.
generates the uid
even in the IsType
case where it isn't used. Probably ok though
Issue #, if available:
Description of changes:
Followup to #145, which updated generators with support for the
is
operator. This PR adds support for generatingis
in scope constraints toschema.rs
(which is used for most DRT targets). It mirrors the corresponding change made previously inpolicy.rs
(which is used for therbac
target).By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.