Opa.Wasm 0.82.0

dotnet add package Opa.Wasm --version 0.82.0
NuGet\Install-Package Opa.Wasm -Version 0.82.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Opa.Wasm" Version="0.82.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Opa.Wasm --version 0.82.0
#r "nuget: Opa.Wasm, 0.82.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Opa.Wasm as a Cake Addin
#addin nuget:?package=Opa.Wasm&version=0.82.0

// Install Opa.Wasm as a Cake Tool
#tool nuget:?package=Opa.Wasm&version=0.82.0

About

Built and tested against Open Policy Agent v0.62.1.

Features

  • Simple API on top of Open Policy Agent Web Assembly ABI
  • Support for advanced scenarios (runtime and module caching)
  • Fast execution path on ABI version 1.2 and greater
  • Ability to define builtin0-4
  • Extended error messages via opa_abort / Wasmtime.TrapException

Usage

The simplest use case - load a WASM module into a policy object, pass data and evaluate based on input:

using var module = OpaPolicyModule.Load("example.wasm");
using var opaPolicy = module.CreatePolicyInstance();

// Use the typed methods to interact with the policy instance
opaPolicy.SetData(new { world = "world" });
var output = opaPolicy.Evaluate<bool>(new { message = "world" });

// Alternatively, send raw Json for the utmost control (advanced scenario)
opaPolicy.SetDataJson(@"{""world"": ""world""}");
string output = opaPolicy.EvaluateJson(@"{""message"": ""world""}");

For higher-performance scenarios, you can keep the engine as well as the loaded WASM module around. Note that one engine can handle multiple modules, and the OpaPolicyModule keeps the correct reference to the engine to guarantee thread safety:

using var engine = OpaPolicyModule.CreateEngine();
using var opaPolicyModule = OpaPolicyModule.Load("example.wasm", engine);

// Now instantiate as many policy objects you want on top of the engine & module
using var opaPolicy = opaPolicyModule.CreatePolicyInstance();
Product 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 was computed.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.82.0 1,046 3/17/2024
0.81.0 1,153 1/3/2024
0.80.0 8,624 5/26/2023
0.70.0 35,317 1/29/2023
0.60.0 350 12/9/2022
0.50.0 365 11/10/2022
0.40.0 518 9/27/2022
0.33.0 403 8/30/2022
0.32.0 451 7/30/2022
0.31.0 2,380 4/5/2022
0.30.0 478 3/10/2022
0.23.0 16,428 2/7/2022
0.22.0 316 1/8/2022
0.21.0 319 1/5/2022
0.20.0 6,830 11/18/2021
0.19.0 369 11/7/2021
0.18.0 366 11/2/2021
0.17.0 370 10/6/2021
0.16.0 342 9/18/2021
0.15.0 353 9/1/2021
0.14.0 35,345 6/16/2021
0.13.0 431 5/22/2021
0.12.0 356 4/27/2021
0.11.0 370 3/20/2021
0.9.0 1,130 1/24/2021
0.8.0 411 1/21/2021
0.7.0 363 1/15/2021
0.6.0 1,216 11/7/2020
0.5.0 490 8/3/2020
0.4.0 506 7/2/2020
0.3.0 495 7/2/2020
0.2.1 504 3/9/2020
0.2.0 508 3/9/2020
0.1.0 774 11/19/2019