OPA Release v0.40.0 #188
srenatus
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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!
This snippet will evaluate to
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, viarego.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:
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.This has been a much-requested feature, but it's @rmetcalf9's issue #4449 that nudged this feature ahead.
Assignments with
:=
Remaining restrictions around the use of
:=
in rules and functions have been lifted (#4555). These constructs are now valid:In the wake of this, rules may now be "redeclared", i.e. you can use
:=
for more than one rule body:This was forbidden before, but didn't serve a real purpose: it would catch trivial-to-catch errors
like
But it would do no good in more difficult to debug "multiple assignment" problems like
Tooling, SDK, and Runtime
opa capabilities
: Expose capabilities through CLI, and allow using versions when passing--capabilities v0.39.0
to the various commands (#4236) authored by @IoannisMatzarisopa eval
: Don't use source locations when formatting partially evaluated output (#4609)opa inspect
: Fixing an issue where some errors encountered by the inspect command aren't properly reportedopa fmt
: Fix a bug with missing whitespace when formatting multiplewith
statements on one indented line (#4634)Experimental OCI support
When configured to do so, OPA's bundle and discovery plugins will retrieve bundles from any OCI registry. Please see the Services Configuration section for details.
Note that at this point, it's best considered a "feature preview". Be aware of this:
so its content may accumulate. By default, the OCI downloader will use a temporary file location.
docs, see OCI.md.
Thanks to @carabasdaniel for starting the work on this!
Rego and Topdown
net.cidr_merge
(#4596), reported by @alexhu20http.send
can now parse and cache YAML responses, analogous to JSON responsesDocumentation
every
over other constructions (#4603)Website + Ecosystem
Miscellaneous
Beta Was this translation helpful? Give feedback.
All reactions