open-policy-agent / opa

Open Policy Agent (OPA) is an open source, general-purpose policy engine.
https://www.openpolicyagent.org
Apache License 2.0
9.58k stars 1.33k forks source link

opa build: Containing data inside a Wasm file #6809

Open shkup opened 6 months ago

shkup commented 6 months ago

When I create a regular bundle I can contain there both data and policy. I would like to request a similar option when creating a wasm file. Sometimes the data is a json file that reading it, parsing it and set it by a loadData call is cumbersome and costly in terms of performance. Also, it will be nice if the build -t wasmcommand will create a wasm directly rather a bundle file that you need to extract the wasm file from (Not the end of the work though but I think makes sense that this is like a "compilation" product).

srenatus commented 3 months ago

That's a neat idea. But would setData() overwrite the data or error?

Also, this is a feature request for OPA, I think: it builds the wasm module, after all. It might even be doable without having to change the SDKs (like this one).

I'll transfer the issue 🔄

anderseknert commented 3 months ago

Also, it will be nice if the build -t wasmcommand will create a wasm directly rather a bundle file that you need to extract the wasm file from (Not the end of the work though but I think makes sense that this is like a "compilation" product).

Agreed, same for -t plan. If we can avoid users having to repeat extra steps in these flows, we should.

stale[bot] commented 2 months ago

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days. Although currently inactive, the issue could still be considered and actively worked on in the future. More details about the use-case this issue attempts to address, the value provided by completing it or possible solutions to resolve it would help to prioritize the issue.