mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-05 08:40:52 +00:00
refactor(userspace/engine): use supported_operators helper from libsinsp filter parser
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
@@ -63,19 +63,16 @@ static bool is_field_defined(
|
||||
return false;
|
||||
}
|
||||
|
||||
// todo(jasondellaluce): add an helper in libsinsp for this
|
||||
static bool is_operator_defined(const string& op)
|
||||
static inline bool is_operator_defined(const string& op)
|
||||
{
|
||||
static vector<string> ops = {"=", "==", "!=", "<=", ">=", "<", ">",
|
||||
"contains", "icontains", "bcontains", "glob", "bstartswith",
|
||||
"startswith", "endswith", "in", "intersects", "pmatch"};
|
||||
auto ops = libsinsp::filter::parser::supported_operators();
|
||||
return find(ops.begin(), ops.end(), op) != ops.end();
|
||||
}
|
||||
|
||||
// todo(jasondellaluce): add an helper in libsinsp for this
|
||||
static bool is_operator_for_list(const string& op)
|
||||
static inline bool is_operator_for_list(const string& op)
|
||||
{
|
||||
return op == "in" || op == "intersects" || op == "pmatch";
|
||||
auto ops = libsinsp::filter::parser::supported_operators(true);
|
||||
return find(ops.begin(), ops.end(), op) != ops.end();
|
||||
}
|
||||
|
||||
static bool is_format_valid(
|
||||
|
Reference in New Issue
Block a user