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
366 367 368 369 370 371 372 373 374 375 | |
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 235 236 237 238 239 240 241 242 | |
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
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
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
172 173 174 175 176 177 178 179 180 181 182 183 184 185 | |
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
157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
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
187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
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
202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
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
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 | |
unique_categories(categories)
classmethod
¶
Ensure that all category names are unique and preserves their original order.
Source code in sereto/models/settings.py
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 | |