mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-31 22:16:49 +00:00
Fill in new shortdesc/data_type/tags for json fields
Update json_event_filter_factory::get_fields() to add the new info (shortdesc, data_type, tags) to field descriptions. This allows for richer outputs when printing info on the fields. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
This commit is contained in:
parent
64e8feb200
commit
455be15b0b
@ -1479,7 +1479,7 @@ std::list<gen_event_filter_factory::filter_fieldclass_info> json_event_filter_fa
|
||||
|
||||
cinfo.name = info.m_name;
|
||||
cinfo.desc = info.m_desc;
|
||||
cinfo.class_info = info.m_class_info;
|
||||
cinfo.shortdesc = info.m_shortdesc;
|
||||
|
||||
for(auto &field : info.m_fields)
|
||||
{
|
||||
@ -1487,15 +1487,14 @@ std::list<gen_event_filter_factory::filter_fieldclass_info> json_event_filter_fa
|
||||
info.name = field.m_name;
|
||||
info.desc = field.m_desc;
|
||||
|
||||
// All json fields work on strings
|
||||
info.data_type = "CHARBUF";
|
||||
|
||||
switch(field.m_idx_mode)
|
||||
{
|
||||
case json_event_filter_check::IDX_REQUIRED:
|
||||
case json_event_filter_check::IDX_ALLOWED:
|
||||
info.desc += " (";
|
||||
info.desc += json_event_filter_check::s_index_mode_strs[field.m_idx_mode];
|
||||
info.desc += ", ";
|
||||
info.desc += json_event_filter_check::s_index_type_strs[field.m_idx_type];
|
||||
info.desc += ")";
|
||||
info.tags.insert(json_event_filter_check::s_index_mode_strs[field.m_idx_mode]);
|
||||
break;
|
||||
case json_event_filter_check::IDX_NONE:
|
||||
default:
|
||||
|
@ -166,8 +166,8 @@ public:
|
||||
struct check_info
|
||||
{
|
||||
std::string m_name;
|
||||
std::string m_shortdesc;
|
||||
std::string m_desc;
|
||||
std::string m_class_info;
|
||||
|
||||
std::list<field_info> m_fields;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user