Open c-leitner opened 6 months ago
Yes, this is currently not possible, unfortunately.
The reason is that reptor first loads the toml and therefore your template must have a valid format. testfield=<!--{{data.fail}}-->
, however, is no valid toml because the value is a string and strings must be enclosed with quotes.
The quickest workaround would be to enclose the value with quotes (testfield="<!--{{data.fail}}-->"
) and to transform the field type to string.
I will, however, have a look if we can cast int values to numbers to make it compatible with number fields.
Description:
I am encountering an issue with the TOML configuration when trying to pass integer values to a finding field with a custom written plugin. When the integer field (testfield) is included in the TOML file, the parsing fails, and an error is generated. However, string values are parsed and handled correctly.
Steps to Reproduce:
ciscatfinding = [{name="<!--{{data.passed}}-->", testfield=<!--{{data.fail}}-->}]
Expected Behavior:
The TOML file should be parsed without errors, and both fields should be correctly filled with values from the data placeholders.
Actual Behavior:
An error occurs when loading the TOML finding template:
WARNING Error while loading toml finding template /home/user/.sysreptor/plugins/ciscatpro/findings/ciscat.toml.
If the integer field testfield is removed, the finding is created successfully with the name field correctly pre-filled.
Additional Information:
The issue seems related specifically to integer handling in the TOML configuration.