-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add a tiny stub page on JavaScript policies #107
Conversation
- similar to the TypeScript page, minus the available example - I found out about Javy recently, think it might deserve a mention - especially for potential eventual compatibility with jsPolicy policies, similar to how there is Rego/OPA/Gatekeeper compat
Yes, I wanted to give Javy a try. Please, keep us posted if you run some experiments with Javy/QuickJS |
@divya-mohan0209: something to be ported to docusaurus branch 😅 |
Was curious to see if anyone else had made progress with JS support and it looks like this page doesn't exist on the v1.10+ versions of the docs. Was that intentional? |
We haven't working on adding JS as a supported language to write policies. We haven't received requests from the community, aside from this PR. Would you mind opening a new issue on https://github.com/kubewarden/kubewarden-controller/ please? |
I can, although the current "Writing Policies" > "Other languages" page says to open an issue or PR in this repo. And that makes more sense to me as the "Writing Policies" docs are the main place where language usage is documented. The Controller also isn't responsible for language usage either, so an issue there would be confusing to me (the Policy Server would sound closer to me, but also not quite accurate either). Since Javy and WASI have more stable adoption/usage these days, I was thinking of experimenting with both myself to support other languages (JS and Python as two very popular languages, with jsPolicy compat being nice to have too (as per the original description). I was looking at updating the Go WASI example too since the official compiler supports it better now too) |
About where to open the issue, it's just that we use the controller repository as a central place to coordinate the work on bigger issue, like this one.
Yes, they are definitely more mature solutions right now. The best way to implement support of these languages would be by adding a waPC guest driver for them. A faster way (in terms of coding efforts) would be the writing of a Kubewarden WASI policy, but this suffers some limitations (documented here). If you need some help feel free to join slack and ask. We'll be glad to help :)
What are you referring to? |
It looks like this effort has been moved to kubewarden/community#37
The current Go WASI template uses TinyGo, but Go has partial support for WASI preview 1 since Go 1.21 / golang/go#31105. The Kyverno policy also says its waPC support is blocked due to the lack of |
Description
Summary
Adds a tiny stub page on writing policies in JavaScript using Javy
Details
similar to the TypeScript stub page that just briefly mentions AssemblyScript
I found out about Javy recently, think it might deserve a mention
Test
N/A
To test this pull request, you can run the following commands:
Additional Information
Tradeoff
It's a stub, so not particularly useful and potentially even misleading, but it also shows potential users that there is opportunity for JS usage as well. Javy is also in beta, so could be abandoned, but it is also used by Shopify, so maybe not so likely. The stub is also transparent about the status, similar to the TypeScript stub.
Potential improvement
Just informing the Kubewarden and broader WASM and Policy communities about Javy