OPA v0.38.0 Release #145
peteroneilljr
announced in
Announcements
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 number of fixes and enhancements.
It contains one backwards-incompatible change to the JSON representation
of metrics in Status API payloads, please see the section below.
Rich Metadata
It is now possible to annotate Rego policies in a way that can be
processed programmatically, using Rich Metadata.
The available keys are:
Custom annotations can be used to annotate rules, packages, and
documents with whatever you specifically need, beyond the generic
keywords.
Annotations can be retrieved using the Golang library
or via the CLI,
opa inspect -a
.All the details can be found in the documentation on Annotations.
Every Keyword
A new keyword for explicit iteration is added to Rego:
every
.It comes in two forms, iterating values, or keys and values, of a
collection, and asserting that the body evaluates successfully for
each binding of key and value to the collection's elements:
To use it,
import future.keywords.every
orfuture.keywords
.For further information, please refer to the Every Keyword docs
and the new section on FOR SOME and FOR ALL in the Intro docs.
Tooling, SDK, and Runtime
disableInlining
option (#4357) reported and fixed by @srlkhttp_code
to response (#4259) reported and fixed by @jkbschmidopa deps
: Fix pretty printed output to show virtual documents (#4342)Rego and Topdown
Documentation and Website
WebAssembly
Miscellaneous
make build
now builds without errors (by disabling Wasm) on darwin/arm64 (M1)Backwards incompatible changes
The JSON representation of the Status API's payloads -- both for
GET /v1/status
responses and the metrics sent to a remote Status API endpoint -- have changed:
Previously, they had been serialized into JSON using the standard library "encoding/json"
methods. However, the metrics coming from the Prometheus integration are only available
in Golang structs generated from Protobuf definitions. For serializing these into JSON,
the standard library functions are unsuited:
snake_case
, notcamelCase
,Now, we're using the protobuf ecosystem's
jsonpb
package, to serialize the Prometheusmetrics into JSON in a way that is compliant with the Protobuf specification.
Concretely, what would before be
is now:
Note that
sample_count
is nowsampleCount
, and thetype
is using the enum'sstring representation,
"SUMMARY"
, not2
.Note: For compatibility reasons (the Prometheus golang client doesn't use the V2
protobuf API), this change uses
jsonpb
and notprotojson
.Beta Was this translation helpful? Give feedback.
All reactions