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

Bump github.com/open-policy-agent/opa from 0.35.0 to 0.41.0 #1812

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Apr 28, 2022

Bumps github.com/open-policy-agent/opa from 0.35.0 to 0.40.0.

Release notes

Sourced from github.com/open-policy-agent/opa's releases.

v0.40.0

This release contains a number of fixes and enhancements.

Metadata introspection

The rich metadata added in the v0.38.0 release can now be introspected from the policies themselves!

package example

METADATA

title: Edits by owner only

description: |

Only the owner is allowed to edit their data.

deny[{"allowed": false, "message": rego.metadata.rule().description}] { input.user != input.owner }

This snippet will evaluate to

[{
  "allowed": false,
  "message": "Only the owner is allowed to edit their data.\n"
}]

Both the rule's metadata can be accessed, via rego.metadata.rule(), and the entire chain of metadata attached to the rule via the various scopes that different metadata annotations can have, via rego.metadata.chain().

All the details can be found in the documentation of these new built-in functions.

Function mocking

It is now possible to mock functions in tests! Both built-in and non-built-in functions can be mocked:

package authz
import data.jwks.cert
import data.helpers.extract_token

allow { [true, _, _] = io.jwt.decode_verify(extract_token(input.headers), {"cert": cert, "iss": "corp.issuer.com"}) }

test_allow { allow with input.headers as [] with data.jwks.cert as "mock-cert" with io.jwt.decode_verify as [true, {}, {}] # mocked built-in with extract_token as "my-jwt" # mocked non-built-in }

For further information about policy testing with data and function mock, see the Policy Testing docs. All details about with can be found in its Policy Language section.

... (truncated)

Changelog

Sourced from github.com/open-policy-agent/opa's changelog.

0.40.0

This release contains a number of fixes and enhancements.

Metadata introspection

The rich metadata added in the v0.38.0 release can now be introspected from the policies themselves!

package example

METADATA

title: Edits by owner only

description: |

Only the owner is allowed to edit their data.

deny[{"allowed": false, "message": rego.metadata.rule().description}] { input.user != input.owner }

This snippet will evaluate to

[{
  "allowed": false,
  "message": "Only the owner is allowed to edit their data.\n"
}]

Both the rule's metadata can be accessed, via rego.metadata.rule(), and the entire chain of metadata attached to the rule via the various scopes that different metadata annotations can have, via rego.metadata.chain().

All the details can be found in the documentation of these new built-in functions.

Function mocking

It is now possible to mock functions in tests! Both built-in and non-built-in functions can be mocked:

package authz
import data.jwks.cert
import data.helpers.extract_token

allow { [true, _, _] = io.jwt.decode_verify(extract_token(input.headers), {"cert": cert, "iss": "corp.issuer.com"}) }

test_allow { allow with input.headers as [] with data.jwks.cert as "mock-cert" with io.jwt.decode_verify as [true, {}, {}] # mocked built-in

... (truncated)

Commits
  • b3c8d80 Prepare v0.40.0 Release (#4631)
  • 39125a0 downloader: support for downloading bundles from an OCI registry (#4558)
  • 2f6b417 format: keep whitespaces for multiple indented same-line withs (#4635)
  • 7e50293 ast+topdown+planner: replacement of non-built-in functions via 'with' (#4616)
  • 02c1c1e bundle/status: Include bundle type in status information
  • 654b245 docs: update version in kubernetes examples (#4627)
  • 8e79fc9 build(deps): bump github.com/fsnotify/fsnotify v1.5.2 -> v1.5.4 (#4628)
  • 4154d99 Dockerfile: add source annotation (#4626)
  • b481f00 topdown/net: require prefix length for IPv6 in net.cidr_merge (#4613)
  • eb94b73 website: add playground button to navbar (#4622)
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added dependencies Pull requests that update a dependency file go Pull requests that update Go code labels Apr 28, 2022
@codecov-commenter
Copy link

codecov-commenter commented Apr 28, 2022

Codecov Report

Merging #1812 (f5e1dda) into main (25b4d5e) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1812   +/-   ##
=======================================
  Coverage   26.21%   26.21%           
=======================================
  Files         127      127           
  Lines        7407     7407           
=======================================
  Hits         1942     1942           
  Misses       5210     5210           
  Partials      255      255           

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 25b4d5e...f5e1dda. Read the comment docs.

@cpanato
Copy link
Member

cpanato commented Apr 28, 2022

blocked on #1448 (comment)

will close

@cpanato cpanato closed this Apr 28, 2022
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Apr 28, 2022

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@cpanato cpanato deleted the dependabot/go_modules/github.com/open-policy-agent/opa-0.40.0 branch April 28, 2022 16:24
@cpanato
Copy link
Member

cpanato commented Jun 7, 2022

@dependabot reopen

@dependabot dependabot bot reopened this Jun 7, 2022
@dependabot dependabot bot restored the dependabot/go_modules/github.com/open-policy-agent/opa-0.40.0 branch June 7, 2022 17:56
@cpanato
Copy link
Member

cpanato commented Jun 7, 2022

@dependabot rebase

@dependabot dependabot bot force-pushed the dependabot/go_modules/github.com/open-policy-agent/opa-0.40.0 branch from 23dca5f to 3fe478e Compare June 7, 2022 17:58
@cpanato cpanato changed the title Bump github.com/open-policy-agent/opa from 0.35.0 to 0.40.0 Bump github.com/open-policy-agent/opa from 0.35.0 to 0.41.0 Jun 7, 2022
@cpanato
Copy link
Member

cpanato commented Jun 7, 2022

cc @dlorenc @SantiagoTorres

@dependabot dependabot bot force-pushed the dependabot/go_modules/github.com/open-policy-agent/opa-0.40.0 branch from 3fe478e to 510df9c Compare June 8, 2022 23:30
Bumps [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) from 0.35.0 to 0.40.0.
- [Release notes](https://github.com/open-policy-agent/opa/releases)
- [Changelog](https://github.com/open-policy-agent/opa/blob/main/CHANGELOG.md)
- [Commits](open-policy-agent/opa@v0.35.0...v0.40.0)

---
updated-dependencies:
- dependency-name: github.com/open-policy-agent/opa
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/go_modules/github.com/open-policy-agent/opa-0.40.0 branch from 510df9c to f5e1dda Compare June 14, 2022 13:43
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Jul 4, 2022

Superseded by #2046.

@dependabot dependabot bot closed this Jul 4, 2022
@dependabot dependabot bot deleted the dependabot/go_modules/github.com/open-policy-agent/opa-0.40.0 branch July 4, 2022 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants