11# OPA-WASM
22
33This directory contains a library that implements various low-level
4- operations for policies compiled into WebAssembly (WASM). Specifically, the
5- library implements:
6-
7- * JSON parsing
8- * JSON AST (e.g., comparison, iteration, lookup, etc.)
9- * String operations
10- * Memory allocation
4+ operations for policies compiled into WebAssembly (Wasm). Specifically, the
5+ library implements most of the built-in functions provided by OPA. See the "Wasm"
6+ tag next to each function listed in the
7+ [ built-in function reference] ( https://www.openpolicyagent.org/docs/latest/policy-reference/#built-in-functions )
8+ for the complete list, or the
9+ [ builtin_metadata.json] ( https://github.com/open-policy-agent/opa/blob/main/builtin_metadata.json ) file for programmatic purposes.
1110
1211This library does not make any backwards compatibility guarantees.
1312
13+ ## Documentation
14+
15+ See the [ OPA docs] ( https://www.openpolicyagent.org/docs/latest/wasm/ ) on Wasm for an overview of the integration,
16+ compilation options, and more.
17+
1418## Development
1519
1620You should have Docker installed to build and test changes to the library. We
17- commit the output of the build (` opa.wasm ` ) into the repository so it's
21+ commit the output of the build (` opa.wasm ` ) into the repository, so it's
1822important for the build output to be reproducible.
1923
2024You can build the library by running ` make build ` . This will produce WASM
2125executables under the ` _obj ` directory.
2226
23- You can test the library by running ` make test ` . By default the test runner
27+ You can test the library by running ` make test ` . By default, the test runner
2428does not print messages when tests pass. If you run ` make test VERBOSE=1 ` it
2529will log all of the tests that were run.
2630
@@ -44,4 +48,4 @@ target will:
4448
45491 . Build the OPA-WASM library
46502 . Copy the library into the [ internal/compiler/wasm/opa] ( ../internal/compiler/wasm/opa ) directory.
47- 3 . Run the tool to generate the [ internal/compiler/wasm/opa/opa.go] ( ../internal/compiler/wasm/opa/opa.go ) file.
51+ 3 . Run the tool to generate the [ internal/compiler/wasm/opa/opa.go] ( ../internal/compiler/wasm/opa/opa.go ) file.
0 commit comments