OPA v1.9.0 #715
johanfylling
announced in
Announcements
OPA v1.9.0
#715
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This release contains a mix of new features, performance improvements, and bugfixes. Notably:
Compile Rego Queries Into SQL Filters (#7887)
Compile API extensions with support for SQL filter generation previously exclusive to EOPA has been ported into OPA.
Example
With OPA running with this policy, we'll compile the query
data.filters.includeinto SQL filters:Example Request
{ "input": { "favorite": "pineapple" } }Example Response
{ "result": { "query": "WHERE fruits.name = E'pineapple'" } }See the documentation for more details.
Authored by @srenatus and @philipaconrad
Improved Rule Indexing For "Naked" Refs (#7897)
OPA's rule indexer is a means by which OPA can optimize evaluation performance.
Briefly, the indexer can in some cases determine that a rule won't successfully evaluate before it's evaluated based on the query input.
The indexer previously only considered terms in certain compound expressions, ignoring single terms; e.g. an expression containing a sole "naked" ref. This has now changed!
Example
Given a policy with an
allowrule containing two "naked" refs:input.fooandinput.bar:and the input document:
{ "foo": 1 }before this improvement, when evaluating the query
data.example.allow, we get the trace log:Here, we can see that the
allowrule is evaluated, but fails on theinput.barexpression, as it's referencing anundefinedvalue.With the improvement to the indexer, we instead get:
Where we can see that the
allowrule was never evaluated, since the input doesn't meet the conditions established by the indexer; i.e. bothinput.fooandinput.barmust havedefinedvalues.Authored by @srenatus
Runtime, Tooling
opa runwhen loading bundles in watch-mode (--watch) (#7870) authored by @sspaink reported by @johanfyllingCompiler, Topdown and Rego
numbers.range_stepbuilt-in error message (#7882) authored by @charlieegan3Docs, Website
everyandnotexamples (#7901) authored by @charlieegan3io.jwtandtimebuilt-ins (#7892) authored by @charlieegan3regexandstringbuilt-ins (#7890) authored by @charlieegan3Miscellaneous
Release notes and downloads can be found here.
Beta Was this translation helpful? Give feedback.
All reactions