coraza icon indicating copy to clipboard operation
coraza copied to clipboard

Tinygo support

Open jcchavezs opened this issue 2 years ago • 7 comments

Summary

Tinygo is desirable as it would open doors for delivering coraza features in embedded runtimes like wasm. Currently tinygo has a set of limitations in terms of support of stdlib and hence we need to decide if we want to support tinygo as a first class or shall we be able to deliver tinygo integration (which requires coraza to be more flexible)

Notably, libraries like encoding/xml isn't supported and there is no easy replacement for it.

Motivation

Provide coraza as a wasm plugin for envoy.

jcchavezs avatar Mar 30 '22 12:03 jcchavezs

The changes were approved in the last meeting.

Please try to compile Coraza removing JSON and XML support and we will use that as a starting point.

Project requirements

  1. Build constraints, we should add special building tags, so tinygo support doesn't mess with standard go. For tinygo we would have to run
tinygo build -tags tinygo *.go

And files with compatibility issues must have multiple versions, for example:

// bodyprocessors/json_tinygo.go
// build: +tinygo
package bodyprocessors

import json"github.com/buger/jsonparser"
//...
}
// bodyprocessors/json.go
// build: !tinygo
package bodyprocessors

import "encoding/json"
//...
}
  1. Tests must be created, they must cover:
  • Import Coraza using WASM
  • Running CRS

Under development

jptosso avatar Mar 30 '22 21:03 jptosso

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Apr 30 '22 03:04 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar May 14 '22 03:05 github-actions[bot]

I am curious on why this has been closed and I have no option to reopen it. Sounds like a mistake, issue isn't resolved but I guess dependabot isn't smart enough to realise the truth cc @jptosso

jcchavezs avatar May 14 '22 12:05 jcchavezs

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jun 14 '22 03:06 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jun 29 '22 03:06 github-actions[bot]

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Aug 11 '22 03:08 github-actions[bot]

Already merged

jptosso avatar Aug 18 '22 03:08 jptosso