Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/srenatus/opa-wasi-experiment

experimenting with wrapping OPA's Wasm modules into something WASI-compatible
https://github.com/srenatus/opa-wasi-experiment

Last synced: 11 days ago
JSON representation

experimenting with wrapping OPA's Wasm modules into something WASI-compatible

Awesome Lists containing this project

README

        

# OPA Wasm and WASI experiment

## What?

This is the scratchpad for rewrapping OPA's wasm modules into a format that can
be run with a plain WASI host.

## How?

Requirements:

- `export-audit` and `wasmlink` from https://github.com/fixpointOS/wasm-tools/
- [zig](https://ziglang.org/)

`run.sh` contains a set of steps that lead to a successful call of `wasmtime output.wasm`.

The policy.wasm has to be supplied out of band, there's no example here (yet).

The one I had used was

```rego
package play

allow := { "one": 1 }
```

- compiled to wasm via `opa build -t wasm x.rego -e play/allow`
- extracted via `tar zxvf bundle.tar.gz /policy.wasm`
`