Settings
sereto.models.settings
¶
BaseRecipe
¶
Bases: SeretoBaseModel
Base recipe for rendering and converting files using RenderTools.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
name of the recipe |
tools |
Annotated[list[str], MinLen(1)]
|
list of |
Source code in sereto/models/settings.py
82 83 84 85 86 87 88 89 90 91 | |
ConvertRecipe
¶
Bases: BaseRecipe
Recipe for converting between file formats using RenderTools.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
name of the recipe |
tools |
Annotated[list[str], MinLen(1)]
|
list of |
input_format |
FileFormat
|
input file format |
output_format |
FileFormat
|
output file format |
Source code in sereto/models/settings.py
106 107 108 109 110 111 112 113 114 115 116 117 | |
Plugins
¶
Bases: SeretoBaseModel
Plugins settings.
Attributes:
| Name | Type | Description |
|---|---|---|
enabled |
bool
|
whether plugins are enabled |
directory |
str
|
path to the directory containing plugins ( |
Source code in sereto/models/settings.py
308 309 310 311 312 313 314 315 316 317 | |
Render
¶
Bases: SeretoBaseModel
Rendering settings.
Attributes:
| Name | Type | Description |
|---|---|---|
report_recipes |
Annotated[list[RenderRecipe], MinLen(1)]
|
list of |
finding_group_recipes |
Annotated[list[RenderRecipe], MinLen(1)]
|
list of |
sow_recipes |
Annotated[list[RenderRecipe], MinLen(1)]
|
list of |
target_recipes |
Annotated[list[RenderRecipe], MinLen(1)]
|
list of |
convert_recipes |
Annotated[list[ConvertRecipe], MinLen(1)]
|
list of |
tools |
Annotated[list[RenderTool], MinLen(1)]
|
list of |
Source code in sereto/models/settings.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | |
get_convert_recipe(name, input_format, output_format)
¶
Get a convert recipe by name, input format, and output format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name of the recipe to get. If None, the first matching recipe is returned. |
required |
input_format
|
FileFormat
|
The input file format. |
required |
output_format
|
FileFormat
|
The output file format. |
required |
Source code in sereto/models/settings.py
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | |
get_finding_group_recipe(name)
¶
Get a finding group recipe by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name of the recipe to get. If None, the first recipe is returned. |
required |
Source code in sereto/models/settings.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 | |
get_report_recipe(name)
¶
Get a report recipe by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name of the recipe to get. If None, the first recipe is returned. |
required |
Source code in sereto/models/settings.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
get_sow_recipe(name)
¶
Get a SoW recipe by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name of the recipe to get. If None, the first recipe is returned. |
required |
Source code in sereto/models/settings.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 | |
get_target_recipe(name)
¶
Get a target recipe by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
The name of the recipe to get. If None, the first recipe is returned. |
required |
Source code in sereto/models/settings.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
RenderRecipe
¶
Bases: BaseRecipe
Recipe for rendering files using RenderTools.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
name of the recipe |
tools |
Annotated[list[str], MinLen(1)]
|
list of |
intermediate_format |
FileFormat
|
supported |
Source code in sereto/models/settings.py
94 95 96 97 98 99 100 101 102 103 | |
RenderTool
¶
Bases: SeretoBaseModel
Commands used in recipes.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
name of the tool |
command |
str
|
command to run |
args |
list[str]
|
list of arguments to pass to the command |
Source code in sereto/models/settings.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
Settings
¶
Bases: SeretoBaseSettings
Global settings:
Attributes:
| Name | Type | Description |
|---|---|---|
projects_path |
DirectoryPath
|
path to the directory containing all projects |
templates_path |
DirectoryPath
|
path to the directory containing templates |
default_people |
list[Person]
|
list of default people to use in new projects |
render |
Render
|
rendering settings |
categories |
TypeCategories
|
supported categories - list of strings (2-20 lower-alpha characters; also dash and underscore is possible in all positions except the first and last one) |
risk_due_dates |
dict[Risk, timedelta]
|
due dates for fixing the findings, for each risk level, as a timedelta |
plugins |
Plugins
|
plugins settings |
Raises:
| Type | Description |
|---|---|
SeretoPathError
|
If the file is not found or permission is denied. |
SeretoValueError
|
If the JSON file is invalid. |
Source code in sereto/models/settings.py
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | |
unique_categories(categories)
classmethod
¶
Ensure that all category names are unique and preserves their original order.
Source code in sereto/models/settings.py
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | |