@@ -11,7 +11,7 @@ import (
1111 "github.com/crowdsecurity/go-cs-lib/ptr"
1212
1313 "github.com/crowdsecurity/crowdsec/pkg/models"
14- "github.com/crowdsecurity/crowdsec/pkg/types "
14+ "github.com/crowdsecurity/crowdsec/pkg/pipeline "
1515)
1616
1717func TestNewAlertContext (t * testing.T ) {
@@ -43,7 +43,7 @@ func TestEventToContext(t *testing.T) {
4343 name string
4444 contextToSend map [string ][]string
4545 valueLength int
46- events []types .Event
46+ events []pipeline .Event
4747 expectedResult models.Meta
4848 }{
4949 {
@@ -53,7 +53,7 @@ func TestEventToContext(t *testing.T) {
5353 "nonexistent_field" : {"evt.Parsed.nonexist" },
5454 },
5555 valueLength : 100 ,
56- events : []types .Event {
56+ events : []pipeline .Event {
5757 {
5858 Parsed : map [string ]string {
5959 "source_ip" : "1.2.3.4" ,
@@ -76,7 +76,7 @@ func TestEventToContext(t *testing.T) {
7676 "cve" : {"evt.Parsed.cve" },
7777 },
7878 valueLength : 100 ,
79- events : []types .Event {
79+ events : []pipeline .Event {
8080 {
8181 Parsed : map [string ]string {
8282 "source_ip" : "1.2.3.4" ,
@@ -122,7 +122,7 @@ func TestEventToContext(t *testing.T) {
122122 "uri" : {"evt.Parsed.uri" },
123123 },
124124 valueLength : 100 ,
125- events : []types .Event {
125+ events : []pipeline .Event {
126126 {
127127 Parsed : map [string ]string {
128128 "source_ip" : "1.2.3.4" ,
@@ -168,7 +168,7 @@ func TestEventToContext(t *testing.T) {
168168 "uri" : {"evt.Parsed.uri" },
169169 },
170170 valueLength : 100 ,
171- events : []types .Event {
171+ events : []pipeline .Event {
172172 {
173173 Parsed : map [string ]string {
174174 "source_ip" : "1.2.3.4" ,
@@ -244,7 +244,7 @@ func TestAppsecEventToContext(t *testing.T) {
244244 tests := []struct {
245245 name string
246246 contextToSend map [string ][]string
247- match types .AppsecEvent
247+ match pipeline .AppsecEvent
248248 req * http.Request
249249 expectedResult models.Meta
250250 expectedErrLen int
@@ -254,8 +254,8 @@ func TestAppsecEventToContext(t *testing.T) {
254254 contextToSend : map [string ][]string {
255255 "id" : {"match.id" },
256256 },
257- match : types .AppsecEvent {
258- MatchedRules : types .MatchedRules {
257+ match : pipeline .AppsecEvent {
258+ MatchedRules : pipeline .MatchedRules {
259259 {
260260 "id" : "test" ,
261261 },
@@ -275,8 +275,8 @@ func TestAppsecEventToContext(t *testing.T) {
275275 contextToSend : map [string ][]string {
276276 "ua" : {"req.UserAgent()" },
277277 },
278- match : types .AppsecEvent {
279- MatchedRules : types .MatchedRules {
278+ match : pipeline .AppsecEvent {
279+ MatchedRules : pipeline .MatchedRules {
280280 {
281281 "id" : "test" ,
282282 },
@@ -300,8 +300,8 @@ func TestAppsecEventToContext(t *testing.T) {
300300 contextToSend : map [string ][]string {
301301 "foobarxx" : {"req.Header.Values('Foobar')" },
302302 },
303- match : types .AppsecEvent {
304- MatchedRules : types .MatchedRules {
303+ match : pipeline .AppsecEvent {
304+ MatchedRules : pipeline .MatchedRules {
305305 {
306306 "id" : "test" ,
307307 },
@@ -326,8 +326,8 @@ func TestAppsecEventToContext(t *testing.T) {
326326 contextToSend : map [string ][]string {
327327 "foobarxx" : {"len(req.Header.Values('Foobar'))" },
328328 },
329- match : types .AppsecEvent {
330- MatchedRules : types .MatchedRules {
329+ match : pipeline .AppsecEvent {
330+ MatchedRules : pipeline .MatchedRules {
331331 {
332332 "id" : "test" ,
333333 },
@@ -352,8 +352,8 @@ func TestAppsecEventToContext(t *testing.T) {
352352 contextToSend : map [string ][]string {
353353 "ja4h" : {"JA4H(req)" },
354354 },
355- match : types .AppsecEvent {
356- MatchedRules : types .MatchedRules {
355+ match : pipeline .AppsecEvent {
356+ MatchedRules : pipeline .MatchedRules {
357357 {
358358 "id" : "test" ,
359359 },
@@ -404,8 +404,8 @@ func TestEvalAlertContextRules(t *testing.T) {
404404 tests := []struct {
405405 name string
406406 contextToSend map [string ][]string
407- event types .Event
408- match types .MatchedRule
407+ event pipeline .Event
408+ match pipeline .MatchedRule
409409 req * http.Request
410410 expectedResult map [string ][]string
411411 expectedErrLen int
@@ -416,7 +416,7 @@ func TestEvalAlertContextRules(t *testing.T) {
416416 "source_ip" : {"evt.Parsed.source_ip" },
417417 "id" : {"match.id" },
418418 },
419- event : types .Event {
419+ event : pipeline .Event {
420420 Parsed : map [string ]string {
421421 "source_ip" : "1.2.3.4" ,
422422 "source_machine" : "mymachine" ,
0 commit comments