A C++ interpreter for the OPA policy language Rego
MIT License
Bot releases are visible (Hide)
Point release updating the Trieste version.
This change should address build instability due to snmalloc updates.
Published by matajoh 4 months ago
Point release containing doc updates and bug fixes.
Bug Fixes
In
statement for some builds/environmentsPublished by matajoh 4 months ago
This minor version release updates rego-cpp
to use the latest version of Trieste and also brings it into line with OPA Rego v0.65.0, while fixing many bugs and adding some quality of life improvements.
New Features
json.marshal_with_options
numbers.range_step
rego.v1
import and behaviour, plus a set of tests in regov1.yaml
Result
when appropriate, and separates out the Bindings
and Terms
.rego
is now JSON instead of plain textregoOutputSize
, regoExpressions
, regoBindingsAtIndex
, and regoExpressionsAtIndex
to the C APIReader
, which parses Rego files, and a Rewriter
which performs unificationencoding
and graphs
builtinsset_log_level_from_string
and setLogLevelFromString
to make it easier to set the log level. All executables now use this option.Improvements
rego_fuzzer
xecutable allows for more fine-grained fuzzing and testing of the Rego toolchainDeprecation
regoSetInputJSON
method is a misnomer, as the input does not strictly need to be JSON. This has been replaced with an (otherwise identical) function called regoSetInputTerm
which does the same thing, and the JSON
version has been deprecated.Breaking Changes
rego
tool has changed. Any downstream tooling that was parsing that will need to be updated to parse the JSON.rego::wf_result
has changed. Any tooling that was using the output node directly will need to be updatedadd_*
methods on Interpreter
, as they now perform parsing, now produce either a nullptr
if successful or an error Node
.rego_trieste
executable has been replaced by the new rego_fuzzer
executableNew Test Coverage
base64builtins
base64urlbuiltins
hexbuiltins
jsonbuiltins
reachable
urlbuiltins
Published by matajoh 9 months ago
Minor improvements and bug fixes.
New Features
Bug fixes
Other
Published by matajoh about 1 year ago
Instrumentation and optimization.
New Features
REGOCPP_ACTION_METRICS
option is available. When turned on, it will compile rego-cpp withjoin
method.Improvements
ValueDef
now caches its str
and json
representations instead of computing them each time.join
method reduces allocations and copies for common string operationsObject
, Set
, and Array
nodes directly.functions
pass has been refactored to produce fewer temporary variables and to performimplicit_enums
now happens in its own pass, enum_locals
.Published by matajoh about 1 year ago
Fixing several impactful bugs.
Bug fixes
every_some
test forPublished by matajoh about 1 year ago
This release marks the first versions of the Rust and Python APIs, along with their example code.
Adding new examples for Python and Rust usage.
Python API
wrappers/python/
contains a Python package, regopy
, which wraps the libraryRust API
wrappers/rust/
contains a Rust crate, regorust
, which wraps the libraryBug Fixes
to_json()
was incorrectly sorting arrays when the sort
true
.clone()
invocations.New Features
Breaking changes
regoSetLoggingEnabled
function has been replaced withregoSetLoggingLevel
. This is also reflected in the C++ and Rust APIs.hregoSetExecutablePath
function has been removed due to theInterpreter::executable()
property being removed from the C++ API.to_json
method flag rego_set
has been changed to set_as_array
andfalse
by default).regoAddInput*
functions are now named regoSetInput*
and canregoGet/SetStrictBuiltInErrors
has been added.rego.hh
which contains the C++ APIrego_c.h
which contains the C APIrego.hh
header is now a C++ header and will not compile in C.internal.hh
header,Published by matajoh about 1 year ago
Adding a C API.
New Features
rego_c.h
contains a C API for the libraryexamples/c
contains an example that builds an interpreter using the C APIBreaking Change
The project was incorrectly configured to set the PUBLIC CMake build directory to include/rego
instead of include
. This meant that projects consuming the library using CMake FetchContent would include header files without a rego/
prefix, which would cause problems long term. This has been fixed, but as a result any projects using the library via CMake FetchContent will need to update their #include
statements to include the rego/
prefix.
Published by matajoh about 1 year ago
Adding further builtins and test coverage, plus some minor
refactoring.
Adds the bits
, casts
, types
builtins. Also adds the regex
builtins with the exception of regex.globs_match
, which we will
add later along with the globs
builtins.
New Features
bits
builtinscasts
builtinstypes
builtinsregex
builtins (w/out regex.globs_match
)any
all
New Test Coverage
any
all
bitsand
bitsnegate
bitsor
bitsshiftleft
bitsshiftright
bitsxor
casts
regexfind
regexfindallstringsubmatch
regexisvalid
regexmatch
regexreplace
regexsplit
regexmatchtemplate
Improvements
unwrap_arg
and the associated UnwrapOpt
struct provide aunwrap
provides a set-based way to do optional unwrapping of terms.Published by matajoh about 1 year ago
Minor release. From this point the implementation passes the Rego
test suite and can be considered a compatible Rego implementation.
Adds the semver
, objects
, and units
builtins.
New Features
semver
builtinsobjects
builtinsunits
builtinscast_array
cast_set
opa.runtime
json.marshal
time.now_ns
New Test Coverage
assignments
baseandvirtualdocs
completedoc
compositereferences
comprehensions
containskeyword
dataderef
defaultkeyword
disjunction
elsekeyword
embeddedvirtualdoc
eqexpr
evaltermexpr
every
example
fix1863
functionerrors
functions
indirectreferences
inputvalues
negation
nestedreferences
object*
partialdocconstants
partialiter
partialobjectdoc
partialsetdoc
refheads
semver*
subset
toarray
topdowndynamicdispatch
toset
type
undos
units
varreferences
virtualdocs
withkeyword
Published by matajoh about 1 year ago
Adding the remainder of the missing language features, bringing the implementation fully
compliant with the published v0.55.0 grammar.
New Features
every
keywordimport
supportwith
keywordprint
startswith
endswith
count
to_number
union
intersection
bin-infix
supportref
package namesBug fixes
Improvements
Published by matajoh over 1 year ago
Adding the in
, if
, contains
, and else
keywords.
New Features
in
, if
, contains
, and else
keywords to the runtimeBug fixes
ExprCall
nodes can now (correctly) be a RefHead
.Improvements
ExprCall
node as opposed toRefArgCall
node, to better reflect the target grammar.Published by matajoh over 1 year ago
Addresses various minor improvements, bugs, and documentation issues.
Bug fixes
Improvements
UnifyBody
nodes but will be Term
nodesPublished by matajoh over 1 year ago