mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-08 10:09:40 +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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo(jasondellaluce): add an helper in libsinsp for this
|
static inline bool is_operator_defined(const string& op)
|
||||||
static bool is_operator_defined(const string& op)
|
|
||||||
{
|
{
|
||||||
static vector<string> ops = {"=", "==", "!=", "<=", ">=", "<", ">",
|
auto ops = libsinsp::filter::parser::supported_operators();
|
||||||
"contains", "icontains", "bcontains", "glob", "bstartswith",
|
|
||||||
"startswith", "endswith", "in", "intersects", "pmatch"};
|
|
||||||
return find(ops.begin(), ops.end(), op) != ops.end();
|
return find(ops.begin(), ops.end(), op) != ops.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo(jasondellaluce): add an helper in libsinsp for this
|
static inline bool is_operator_for_list(const string& op)
|
||||||
static 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(
|
static bool is_format_valid(
|
||||||
|
Reference in New Issue
Block a user