Skip to content
Branch: master
Find file History
tsandall Update to support OPA v0.15 calling convention
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Latest commit c80df97 Nov 16, 2019

Files

Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
app.js Update to support OPA v0.15 calling convention Nov 17, 2019
example.rego
package-lock.json
package.json

README.md

Simple opa-wasm node application

The application is in app.js and shows loading a *.wasm file, initializing the policy, and evaluating it with input.

Install dependencies

This requires the opa-wasm package, see package.json for details.

npm install

Build the WebAssembly binary for the example policy:

There is an example policy included with the example, see example.rego

opa build -d example.rego 'data.example = x'

Run the example Node JS code that invokes the Wasm binary:

node app.js '{"message": "world"}'
node app.js '{"message": "not-world"}'
You can’t perform that action at this time.