package waf import ( "archive/zip" "bytes" "io/fs" "net/http" "net/http/httptest" "os" "path/filepath" "strings" "sync/atomic" "testing" "testing/fstest" "go.miragespace.co/specter/config" "go.miragespace.co/specter/spec/protocol" "github.com/ProtonMail/go-crypto/openpgp/packet" openpgp "github.com/ProtonMail/go-crypto/openpgp/v2" "github.com/stretchr/testify/require" "go.uber.org/zap" ) func writeFixtureRules(t *testing.T, w *zip.Writer) { t.Helper() for _, file := range []struct{ name, contents string }{ {"crs-setup.conf.example", "SecDefaultAction \"phase:1,pass,log\"\nSecDefaultAction \"phase:2,pass,log\"\n"}, {"rules/REQUEST-901-INITIALIZATION.conf", `SecRule ARGS "@contains