Skip to content
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: add rego function to consume modules and evaluate them #1787

Merged
merged 1 commit into from Apr 23, 2022

Conversation

hectorj2f
Copy link
Contributor

Signed-off-by: hectorj2f hectorf@vmware.com

Summary

Add a function that consumes rego policy modules and evaluate them. This would be useful for #1772 work when consuming rego policies and evaluate them.

I also added some unit tests.

Ticket Link

Fixes

Release Note


@hectorj2f hectorj2f added the enhancement New feature or request label Apr 22, 2022
@hectorj2f hectorj2f requested a review from vaikas April 22, 2022 11:13
@hectorj2f hectorj2f self-assigned this Apr 22, 2022
@codecov-commenter
Copy link

codecov-commenter commented Apr 22, 2022

Codecov Report

Merging #1787 (71139ad) into main (3c2084c) will increase coverage by 0.07%.
The diff coverage is 56.41%.

@@            Coverage Diff             @@
##             main    #1787      +/-   ##
==========================================
+ Coverage   31.47%   31.54%   +0.07%     
==========================================
  Files         144      144              
  Lines        8890     8929      +39     
==========================================
+ Hits         2798     2817      +19     
- Misses       5756     5771      +15     
- Partials      336      341       +5     
Impacted Files Coverage Δ
pkg/cosign/rego/rego.go 63.88% <56.41%> (-8.84%) ⬇️
pkg/cosign/tuf/client.go 61.68% <0.00%> (-0.82%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c2084c...71139ad. Read the comment docs.

@hectorj2f hectorj2f force-pushed the add_rego_module_functions branch 5 times, most recently from 8a2f717 to 6d653f8 Compare April 22, 2022 23:11
vaikas
vaikas previously approved these changes Apr 23, 2022
Copy link
Contributor

@vaikas vaikas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, the lint warning about dropping the else.

@vaikas
Copy link
Contributor

vaikas commented Apr 23, 2022

Thanks for doing this!

@hectorj2f hectorj2f force-pushed the add_rego_module_functions branch 2 times, most recently from f9fc70c to 4e12bbc Compare April 23, 2022 07:59
Signed-off-by: hectorj2f <hectorf@vmware.com>
@hectorj2f
Copy link
Contributor Author

@vaikas This is ready for a review.

Copy link
Contributor

@vaikas vaikas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@hectorj2f hectorj2f merged commit 8cac645 into sigstore:main Apr 23, 2022
@hectorj2f hectorj2f deleted the add_rego_module_functions branch April 23, 2022 18:13
@github-actions github-actions bot added this to the v1.8.0 milestone Apr 23, 2022
mlieberman85 pushed a commit to mlieberman85/cosign that referenced this pull request May 6, 2022
Signed-off-by: hectorj2f <hectorf@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants