Infrastructure for packaging OPA policy and data files into bundles using native wrapper over OPA SDK
$ dotnet add package OpaDotNet.Compilation.InteropRego compiler which uses interop wrapper for subset
of OPA SDK for policy bundle compilation and packaging.
Note. Due to inclusion of native dependencies, nuget OpaDotNet.Compilation.Interop package is ~15MB.
| Version | OPA SDK Version | Platforms |
|---|---|---|
| v1.0.X | v0.67.0 | linux-x64 win-x64 |
using OpaDotNet.Compilation.Interop;
var compiler = new RegoInteropCompiler();
var bundleStream = await compiler.CompileFileAsync("example.rego", new() { Entrypoints = new HashSet<string>(["example/hello"]) });
// Use compiled policy bundle.
...