You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update how-to-write-a-parser.md
- it is 4 methods that have to be added not 3 (see the numbered list 1..4 )
- the location of the doc for a new parser is now in: `docs/content/en/connecting_your_tools/parsers/<file/api>/`
* Update how-to-write-a-parser.md 2
- update the import page documentation
* Update docs/content/en/open_source/contributing/how-to-write-a-parser.md
---------
Co-authored-by: Cody Maffucci <46459665+Maffooch@users.noreply.github.com>
|`unittests/scans/<parser_dir>/{many_vulns,no_vuln,one_vuln}.json` | Sample files containing meaningful data for unit tests. The minimal set.
38
38
|`unittests/tools/test_<parser_name>_parser.py` | Unit tests of the parser.
39
39
|`dojo/settings/settings.dist.py` | If you want to use a modern hashcode based deduplication algorithm
40
-
|`doc/content/en/integrations/parsers/<file/api>/<parser_file>.md` | Documentation, what kind of file format is required and how it should be obtained
40
+
|`docs/content/en/connecting_your_tools/parsers/<file/api>/<parser_file>.md` | Documentation, what kind of file format is required and how it should be obtained
41
+
41
42
42
43
## Factory contract
43
44
@@ -50,7 +51,7 @@ Parsers are loaded dynamicaly with a factory pattern. To have your parser loaded
50
51
3. The name of this class **MUST** be the Python module name without underscores and with `Parser` suffix.
51
52
- ex: `dojo.tools.my_tool.parser.MyToolParser`
52
53
4. This class **MUST** have an empty constructor or no constructor
53
-
5. This class **MUST** implement 3 methods:
54
+
5. This class **MUST** implement 4 methods:
54
55
1.`def get_scan_types(self)` This function return a list of all the *scan_type* supported by your parser. This identifiers are used internally. Your parser can support more than one *scan_type*. For example some parsers use different identifier to modify the behavior of the parser (aggregate, filter, etc...)
55
56
2.`def get_label_for_scan_types(self, scan_type):` This function return a string used to provide some text in the UI (short label)
56
57
3.`def get_description_for_scan_types(self, scan_type):` This function return a string used to provide some text in the UI (long description)
@@ -357,7 +358,7 @@ If you want to take a look at previous parsers that are now part of DefectDojo,
357
358
358
359
## Update the import page documentation
359
360
360
-
Please add a new .md file in [`docs/content/en/integrations/parsers`] with the details of your new parser. Include the following content headings:
361
+
Please add a new .md file in [`docs/content/en/connecting_your_tools/parsers`] with the details of your new parser. Include the following content headings:
361
362
362
363
* Acceptable File Type(s) - please include how to generate this type of file from the related tool, as some tools have multiple methods or require specific commands.
0 commit comments