Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardSchwabe committed Jul 17, 2023
1 parent f0b3f73 commit cbced2d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
36 changes: 28 additions & 8 deletions reptor/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _fill_from_api(self, data: typing.Dict):
cls = getattr(sys.modules[__name__], model_class)
self.__setattr__(attr[0], list())
for k, v in data[attr[0]].items():
v['name'] = k
v["name"] = k
self.__getattribute__(attr[0]).append(cls(v))
else:
# Fill each attribute
Expand Down Expand Up @@ -158,6 +158,7 @@ class FindingData(BaseModel):
retest_status:
evidence:
"""

title: str = ""
cvss: str = ""
summary: str = ""
Expand Down Expand Up @@ -273,6 +274,23 @@ class ProjectFieldTypes(enum.Enum):


class ProjectDesignField(BaseModel):
"""
Attributes:
name:
type:
label:
origin:
default:
required:
spellcheck:
properties: "ProjectDesignField"
choices:
items:
suggestions:
"""

name: str = ""
type: ProjectFieldTypes = None
label: str = ""
Expand All @@ -288,14 +306,14 @@ class ProjectDesignField(BaseModel):
suggestions: typing.List[str] = []

def _fill_from_api(self, data: typing.Dict):
if data['type'] == ProjectFieldTypes.list.value:
data['items'] = ProjectDesignField(data['items'])
elif data['type'] == ProjectFieldTypes.object.value:
if data["type"] == ProjectFieldTypes.list.value:
data["items"] = ProjectDesignField(data["items"])
elif data["type"] == ProjectFieldTypes.object.value:
properties = list()
for name, field in data['properties'].items():
field['name'] = name
for name, field in data["properties"].items():
field["name"] = name
properties.append(ProjectDesignField(field))
data['properties'] = properties
data["properties"] = properties

attrs = typing.get_type_hints(self).keys()
for key, value in data.items():
Expand Down Expand Up @@ -327,9 +345,10 @@ class FindingDataField(BaseModel):
Finding data holds values only and does not contain type definitions.
Most data types cannot be differentiated (like strings and enums).
This model joins finding data values from an acutal report with project
This model joins finding data values from an acutal report with project
design field definitions.
"""

value: typing.Union[
str, # cvss, string, markdown, enum, user, combobox, date
typing.List, # list
Expand Down Expand Up @@ -361,6 +380,7 @@ class FindingDataJoined(BaseModel):
retest_status:
evidence:
"""

title: FindingDataField
cvss: FindingDataField
summary: FindingDataField
Expand Down
4 changes: 2 additions & 2 deletions reptor/plugins/core/Conf.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# ---------------------------------------------------------
# Name: Conf
# Purpose: Show configuration or set configuration
# Author:
# Created: 2022-07-18
# -------------------------------------------------------------------------------
# ---------------------------------------------------------

from reptor.lib.plugins.ConfBase import ConfBase

Expand Down
4 changes: 2 additions & 2 deletions reptor/plugins/core/Plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class Plugins(Base):
Create a new plugin from a template for the community
or yourself.
# Arguments:
# Arguments
* --search Allows you to search for a specific plugin by name and tag
* --copy PLUGINNAME Copies a plugin to your local folder for development
* --new PLUGINNAME Creates a new plugin based off a template and your input
* --verbose Provides more information about a plugin
# Developer Notes:
# Developer Notes
You can modify the `_list` method to change the output for search as
well as the default output.
"""
Expand Down

0 comments on commit cbced2d

Please sign in to comment.