Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
chore: Update rego to be partial execution friendly #3449
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
chore: Update rego to be partial execution friendly #3449
Changes from 20 commits
b3536bc
75e3a12
6cdf575
f5eacd0
4a7c68e
df75be5
e90ac2d
1e774e0
38917dc
e139a1f
c44d4d1
19f3557
f9dd9aa
bed9f4f
74d90f4
fe0d05a
dd5c55c
ae22f89
0266963
af457b9
21f4f21
2c87220
1c407ab
9f9b2d1
ab55cf5
abf098d
44c7370
4611322
c8e26a8
510e94b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This function is only used internally, so seems like it might not need to be exported like 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.
I need it for my Fake authorizer to work for some unit tests. I can't fake it without an interface☹️
recordingAuthorizer
always returns false and save the auth calls so I can assert them in my tests.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 don't see any use case for exposing the
PreparedAuthorized
to consumers of authorization --- why not just expose the Filter() method here?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 wish I could, but you can't make generic methods on structs. The nice thing about the generic
Filter()
method is you can pass in and return the same typed slice.If I made it a non-generic function, you'd have to take your slice of
[]Workspace
, convert it to[]rbac.Object
, and then convert it back to[]Workspace
. I could do this all in somerbac.Authorize
, but it takes a lot of slice copying I prefer to avoid.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.
Well, that sucks. Go generics continue to disappoint.
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.
Yea, it's really dumb because I don't see why it's not possible. Like I would like to know the objection to it.