OPA v1.17.0 #755
johanfylling
announced in
Announcements
OPA v1.17.0
#755
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:
future.keywords.notimport that adds improved semantics to thenotkeyword.Improved Negation Semantics (#8387)
This OPA release introduces a new
future.keywords.notimportthat fixes a long-standing semantic issue with negation in Rego.
Without the import, the compiler expands a negated composite expression like
not f(g(input.x))into a series of sub-expressions evaluated before thenot:If any sub-expression fails — for example,
input.xis undefined orgproduces an undefined result — the entire rule fails rather than the
notsucceeding.This is unintuitive: the user's intent is "the condition does not hold," but
an undefined intermediate value causes a silent failure instead of the expected
notresult.With
import future.keywords.not, composite-expression negation wraps the full compilerexpansion in an implicit body:
Now, if any sub-expression is undefined or fails, the body is unsatisfiable
and the
notexpression succeeds; matching the intuition that "the condition does not hold."Authored by @johanfylling
Rule Labels in Decision Logs (#2089)
Rule annotations now support a
labelsfield. Labels from all successfully evaluatedrules are collected and included in each decision log entry as a top-level
rule_labelsarray. Each element is the merged label map for one successfully evaluated rule, with
inner-scope-wins precedence across the rule's annotation chain
(
subpackages<package<document<rule). Merged maps are deduplicatedacross rules so that identical label sets collapse to a single entry.
The resulting decision log entry will contain:
{"rule_labels": [{"service": "authz", "severity": "low", "team": "platform"}]}Note how
severity: infofrom the package scope is overridden byseverity: lowfromthe rule scope. Queries against
rule_labelscan now rely on each entry carrying thefull label context for a single rule, rather than one entry per contributing scope.
Both the runtime and the Go SDK now process metadata annotations by default.
Authored by @srenatus, reported by @tsandall
Runtime, SDK, Tooling
$refinallOfin JSON schemas (#6523) authored by @deeglaze reported by @mosiac1Compiler, Topdown and Rego
json.verify_schemaandjson.match_schemabuilt-in functions (#6089) authored by @sspaink reported by @ewout8indexfield inMakeNumberRefStmtIR statement (#6266) authored by @sspaink reported by @johanfyllingGenerateJSONfunction (#8690) authored by @anderseknertDocs, Website, Ecosystem
Miscellaneous
inmem.NewFromASTObjectand add missing string case toast.InternedValue(#8707) authored by @anderseknertgo install->go install toolto control checksums (#8646) authored by @srenatusRelease notes and downloads can be found here.
Beta Was this translation helpful? Give feedback.
All reactions