Skip to content

chore: bump github.com/open-policy-agent/opa from 0.39.0 to 0.40.0 #1245

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

Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github May 2, 2022

Bumps github.com/open-policy-agent/opa from 0.39.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 force-pushed the dependabot/go_modules/github.com/open-policy-agent/opa-0.40.0 branch from 306f4c6 to d28b14a Compare May 2, 2022 13:01
@coadler
Copy link
Contributor

coadler commented May 2, 2022

@dependabot rebase

@coadler coadler enabled auto-merge (squash) May 2, 2022 16:43
@dependabot dependabot bot force-pushed the dependabot/go_modules/github.com/open-policy-agent/opa-0.40.0 branch from d28b14a to 04013aa Compare May 2, 2022 16:44
@coadler coadler force-pushed the dependabot/go_modules/github.com/open-policy-agent/opa-0.40.0 branch from 04013aa to 154ffc1 Compare May 2, 2022 17:24
@codecov
Copy link

codecov bot commented May 2, 2022

Codecov Report

Merging #1245 (154ffc1) into main (7fb3c57) will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1245      +/-   ##
==========================================
+ Coverage   66.11%   66.13%   +0.01%     
==========================================
  Files         275      275              
  Lines       17948    17948              
  Branches      216      216              
==========================================
+ Hits        11867    11870       +3     
+ Misses       4847     4844       -3     
  Partials     1234     1234              
Flag Coverage Δ
unittest-go-macos-latest 53.35% <ø> (+0.02%) ⬆️
unittest-go-postgres- 65.08% <ø> (-0.03%) ⬇️
unittest-go-ubuntu-latest 55.79% <ø> (-0.04%) ⬇️
unittest-go-windows-2022 51.67% <ø> (-0.06%) ⬇️
unittest-js 70.69% <ø> (ø)
Impacted Files Coverage Δ
provisioner/echo/serve.go 56.80% <0.00%> (-2.41%) ⬇️
peerbroker/listen.go 85.71% <0.00%> (-1.69%) ⬇️
coderd/provisionerdaemons.go 62.98% <0.00%> (-1.01%) ⬇️
provisionerd/provisionerd.go 76.17% <0.00%> (-0.14%) ⬇️
peer/conn.go 79.85% <0.00%> (+0.49%) ⬆️
coderd/workspaceagents.go 56.97% <0.00%> (+0.93%) ⬆️
cli/cliui/provisionerjob.go 78.57% <0.00%> (+2.14%) ⬆️
peer/channel.go 87.86% <0.00%> (+3.46%) ⬆️

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 7fb3c57...154ffc1. Read the comment docs.

@coadler coadler merged commit 9032b7e into main May 2, 2022
@coadler coadler deleted the dependabot/go_modules/github.com/open-policy-agent/opa-0.40.0 branch May 2, 2022 17:36
kylecarbs pushed a commit that referenced this pull request Jun 10, 2022
…1245)

Bumps [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) from 0.39.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.39.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>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants