Skip to content

Commit e7f8b7a

Browse files
authored
Revert "fix: handle.NewHandle() now accepts map instead of any (#26)" (#36)
This reverts commit 3def4df.
1 parent 7258a62 commit e7f8b7a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

handle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type Handle struct {
4242
// NewHandle creates and returns a new instance of the WAF with the given security rules and configuration
4343
// of the sensitive data obfuscator. The returned handle is nil in case of an error.
4444
// Rules-related metrics, including errors, are accessible with the `RulesetInfo()` method.
45-
func NewHandle(rules map[string]any, keyObfuscatorRegex string, valueObfuscatorRegex string) (*Handle, error) {
45+
func NewHandle(rules any, keyObfuscatorRegex string, valueObfuscatorRegex string) (*Handle, error) {
4646
// The order of action is the following:
4747
// - Open the ddwaf C library
4848
// - Encode the security rules as a ddwaf_object

waf_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func newArachniTestRule(inputs []ruleInput, actions []string) map[string]any {
139139
return parsed
140140
}
141141

142-
func newDefaultHandle(rule map[string]any) (*Handle, error) {
142+
func newDefaultHandle(rule any) (*Handle, error) {
143143
return NewHandle(rule, "", "")
144144
}
145145

@@ -152,7 +152,7 @@ func TestNewWAF(t *testing.T) {
152152
})
153153

154154
t.Run("invalid-rule", func(t *testing.T) {
155-
var parsed map[string]any
155+
var parsed any
156156

157157
require.NoError(t, json.Unmarshal([]byte(malformedRule), &parsed))
158158

@@ -610,7 +610,7 @@ func TestMetrics(t *testing.T) {
610610
]
611611
}
612612
`
613-
var parsed map[string]any
613+
var parsed any
614614

615615
require.NoError(t, json.Unmarshal([]byte(rules), &parsed))
616616

0 commit comments

Comments
 (0)