crowdsec/pkg/types
Laurence Jones 19de3a8a77
Runtime whitelist parsing improvement (#2422)
* Improve whitelist parsing

* Split whitelist check into a function tied to whitelist, also since we check node debug we can make a pointer to node containing whitelist

* No point passing clog as an argument since it is just a pointer to node we already know about

* We should break instead of returning false, false as it may have been whitelisted by ips/cidrs

* reimplement early return if expr errors

* Fix lint and dont need to parse ip back to string just loop over sources

* Log error with node logger as it provides context

* Move getsource to a function cleanup some code

* Change func name

* Split out compile to a function so we can use in tests. Add a bunch of tests

* spell correction

* Use node logger so it has context

* alternative solution

* quick fixes

* Use containswls

* Change whitelist test to use parseipsource and only events

* Make it simpler

* Postoverflow tests, some basic ones to make sure it works

* Use official pkg

* Add @mmetc reco

* Add @mmetc reco

* Change if if to a switch to only evaluate once

* simplify assertions

---------

Co-authored-by: bui <thibault@crowdsec.net>
Co-authored-by: Marco Mariani <marco@crowdsec.net>
2023-10-16 10:08:57 +01:00
..
constants.go fix include_capi filter (#2478) 2023-09-20 11:56:00 +02:00
datasource.go trim pkg/types: move DataSet/GetData to pkg/cwhub, removed unused Clone function (#2271) 2023-06-08 16:49:51 +02:00
event.go Runtime whitelist parsing improvement (#2422) 2023-10-16 10:08:57 +01:00
event_test.go Runtime whitelist parsing improvement (#2422) 2023-10-16 10:08:57 +01:00
ip.go errors.Wrap -> fmt.Errorf (#2317) 2023-06-29 11:34:59 +02:00
ip_test.go simplify err.Error() to err when used in printf context (#1603) 2022-06-22 15:53:53 +02:00
line.go Refactor Acquisition Interface (#773) 2021-06-11 09:53:53 +02:00
utils.go pkg/types cleanup (#2398) 2023-08-24 09:44:46 +02:00