DOPA.Cli
0.57.1
See the version list below for details.
dotnet add package DOPA.Cli --version 0.57.1
NuGet\Install-Package DOPA.Cli -Version 0.57.1
<PackageReference Include="DOPA.Cli" Version="0.57.1" />
paket add DOPA.Cli --version 0.57.1
#r "nuget: DOPA.Cli, 0.57.1"
// Install DOPA.Cli as a Cake Addin #addin nuget:?package=DOPA.Cli&version=0.57.1 // Install DOPA.Cli as a Cake Tool #tool nuget:?package=DOPA.Cli&version=0.57.1
DOPA.Cli
A dotnet wrapper on the OPA binaries designed primarily for DOPA to create WebAssembly bundles on the fly.
Usage
opa
commands are made available off the static Opa
class. Args are added with a fluent syntax, and then run with Execute()
or ExecuteAsync()
.
This document refers to the test files found in test/DOPA.Cli.Tests/policies.
Implemented commands
DOPA.Cli is not a complete replacement for running opa
, but it can help simplfy some automation. If you have a need for another arg, or command, PRs are welcome. Priority will be given to features needed by DOPA.
Currently, the following commands are implemented with a subset of the possible args.
Build
The build command is supported with optional capabilities, and the ability to build a WebAssembly module.
The Build
command returns a disposable Bundle
. A Bundle
contains the path to the generated opa bundle, and can extract contents from the bundle. The underlying file will be deleted when the Bundle
is disposed.
// Default
using Bundle bundle = Opa.Build.Files("policies/example.rego").Execute();
using Stream dataJson = bundle.ExtractData();
// WebAssembly
using Bundle bundle = await Opa.Build
.WebAssembly()
.Files("policies/builtins.rego")
.Entrypoints("builtins/firstValue")
.Capabilities("policies/builtins.capabilities.json")
.ExecuteAsync();
using Stream wasm = bundle.ExtractWebAssemblyModule();
Test
The test command is supported with files. OpaTestsFailedException
is thrown if any tests fail. The exception message contains the details about which test failed.
var results = Opa.Test.Files("policies/api.rego").Execute();
results.Trim().Should().BeEquivalentTo("PASS: 4/4");
Versioning
DOPA.Cli uses a Major.Minor.Patch.Revision
versioning scheme, where Major.Minor.Patch
match the corresponding Major.Minor.Patch
of the opa
binary used to run commands. e.g. DOPA.Cli@0.43.0.12
equates to revision 12 of opa@0.43.0
.
Contributing
Pull requests and issues are appreciated and encouraged.
License
DOPA is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- SharpZipLib (>= 1.4.2)
-
net7.0
- SharpZipLib (>= 1.4.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.68.0 | 3,014 | 8/30/2024 |
0.67.1 | 1,055 | 8/12/2024 |
0.67.0 | 289 | 7/26/2024 |
0.66.0 | 1,048 | 6/28/2024 |
0.65.0 | 996 | 6/1/2024 |
0.64.1 | 1,223 | 5/1/2024 |
0.63.0.1 | 1,014 | 4/6/2024 |
0.63.0 | 672 | 3/29/2024 |
0.62.1 | 546 | 3/8/2024 |
0.62.0 | 545 | 3/1/2024 |
0.58.0 | 1,472 | 10/30/2023 |
0.57.1 | 552 | 10/30/2023 |
0.57.0 | 2,498 | 10/3/2023 |
0.55.0 | 1,979 | 7/28/2023 |
0.54.0 | 1,201 | 6/30/2023 |
0.53.1 | 659 | 6/10/2023 |
0.53.0.1 | 531 | 6/3/2023 |
0.53.0 | 393 | 5/27/2023 |
0.52.0 | 517 | 5/2/2023 |
0.51.0 | 655 | 4/1/2023 |
0.50.0 | 586 | 3/12/2023 |
0.49.2 | 713 | 2/26/2023 |
0.49.1 | 631 | 2/22/2023 |
0.49.0 | 661 | 2/10/2023 |
0.48.0 | 2,848 | 1/12/2023 |
0.47.4 | 845 | 12/21/2022 |
0.47.3 | 778 | 12/13/2022 |
0.47.2 | 647 | 12/10/2022 |
0.47.1 | 706 | 12/8/2022 |
0.47.0 | 725 | 12/6/2022 |
0.46.1 | 813 | 11/4/2022 |
0.45.0 | 887 | 10/8/2022 |
0.44.0.1 | 781 | 10/6/2022 |
0.44.0 | 995 | 9/8/2022 |
0.43.1 | 862 | 9/7/2022 |
0.43.0.1 | 1,510 | 8/21/2022 |
0.43.0 | 1,013 | 8/19/2022 |
Bump OPA to v0.57.1.