fluidattacks_core_models 13.2.0__tar.gz → 14.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/PKG-INFO +1 -1
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/state_machines/__init__.py +1 -3
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/state_machines/component_orchestrator.py +4 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/state_machines/root_scanner.py +0 -8
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/pyproject.toml +1 -1
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/tests/test_component_orchestrator.py +29 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/tests/test_root_scanner.py +0 -43
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/uv.lock +1 -1
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/.envrc +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/.gitignore +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/build/default.nix +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/build/filter.nix +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/flake.lock +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/flake.nix +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/__init__.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/py.typed +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/scanners/__init__.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/scanners/apk_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/scanners/common_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/scanners/containers_sca_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/scanners/cspm_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/scanners/dast_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/scanners/loader.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/scanners/sast_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/scanners/sbom_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/scanners/sca_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/scanners/scan_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/scanners/sniffs_config.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/fluidattacks_core/models/state_machines/types.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/import-linter.cfg +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/mypy.ini +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/ruff.toml +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/tests/__init__.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/tests/test_loader_env.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/tests/test_model_scanner.py +0 -0
- {fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/tests/test_state_machines.py +0 -0
|
@@ -2,6 +2,7 @@ from fluidattacks_core.models.state_machines.component_orchestrator import (
|
|
|
2
2
|
ComponentScanOptions,
|
|
3
3
|
ResolvesScanOptions,
|
|
4
4
|
StateMachineComponentOrchestrator,
|
|
5
|
+
TracesScanOptions,
|
|
5
6
|
)
|
|
6
7
|
from fluidattacks_core.models.state_machines.root_scanner import (
|
|
7
8
|
ContextualizesScanInput,
|
|
@@ -9,8 +10,6 @@ from fluidattacks_core.models.state_machines.root_scanner import (
|
|
|
9
10
|
PerRootScanOptions,
|
|
10
11
|
StateMachineExecutePerRootInput,
|
|
11
12
|
TJobNameSegment,
|
|
12
|
-
TracesScanInput,
|
|
13
|
-
TracesScanOptions,
|
|
14
13
|
TStorageKey,
|
|
15
14
|
)
|
|
16
15
|
from fluidattacks_core.models.state_machines.types import (
|
|
@@ -38,6 +37,5 @@ __all__ = [
|
|
|
38
37
|
"TCloningTrigger",
|
|
39
38
|
"TJobNameSegment",
|
|
40
39
|
"TStorageKey",
|
|
41
|
-
"TracesScanInput",
|
|
42
40
|
"TracesScanOptions",
|
|
43
41
|
]
|
|
@@ -44,10 +44,6 @@ class ContextualizesScanOptions(PerRootScanOptions):
|
|
|
44
44
|
pass
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
class TracesScanOptions(PerRootScanOptions):
|
|
48
|
-
pass
|
|
49
|
-
|
|
50
|
-
|
|
51
47
|
TOptions = TypeVar("TOptions", bound=PerRootScanOptions)
|
|
52
48
|
|
|
53
49
|
|
|
@@ -98,7 +94,3 @@ class StateMachineExecutePerRootInput(BaseModel, Generic[TOptions]):
|
|
|
98
94
|
|
|
99
95
|
class ContextualizesScanInput(StateMachineExecutePerRootInput[ContextualizesScanOptions]):
|
|
100
96
|
pass
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
class TracesScanInput(StateMachineExecutePerRootInput[TracesScanOptions]):
|
|
104
|
-
pass
|
|
@@ -7,6 +7,7 @@ from fluidattacks_core.models.state_machines.component_orchestrator import (
|
|
|
7
7
|
ComponentScanOptions,
|
|
8
8
|
ResolvesScanOptions,
|
|
9
9
|
StateMachineComponentOrchestrator,
|
|
10
|
+
TracesScanOptions,
|
|
10
11
|
)
|
|
11
12
|
from fluidattacks_core.models.state_machines.root_scanner import (
|
|
12
13
|
MACHINE_NAME_DIGEST_LENGTH,
|
|
@@ -176,3 +177,31 @@ def test_resolves_options_add_no_fields_of_their_own() -> None:
|
|
|
176
177
|
)
|
|
177
178
|
with pytest.raises(ValidationError):
|
|
178
179
|
ResolvesScanOptions.model_validate({**options.model_dump(), "seed_domain": "acme.com"})
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def _traces_options(**overrides: str) -> TracesScanOptions:
|
|
183
|
+
arguments: dict[str, str] = {
|
|
184
|
+
"config_id": "123456",
|
|
185
|
+
"entity_name": "nickname",
|
|
186
|
+
"group_name": "acme",
|
|
187
|
+
"user_email": "test@fluidattacks.com",
|
|
188
|
+
}
|
|
189
|
+
arguments.update(overrides)
|
|
190
|
+
return TracesScanOptions(**arguments)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def test_traces_options_declare_the_group_the_orchestrator_does_not_carry() -> None:
|
|
194
|
+
options = _traces_options()
|
|
195
|
+
assert set(options.model_dump()) == set(ComponentScanOptions.model_fields) | {"group_name"}
|
|
196
|
+
with pytest.raises(ValidationError):
|
|
197
|
+
TracesScanOptions.model_validate(_options().model_dump())
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def test_traces_group_name_is_a_storage_key_and_reaches_the_scanner_on_the_wire() -> None:
|
|
201
|
+
for value in ("a/b", "..", "acme corp", "_leading", ""):
|
|
202
|
+
with pytest.raises(ValidationError):
|
|
203
|
+
_traces_options(group_name=value)
|
|
204
|
+
machine_input = StateMachineComponentOrchestrator[TracesScanOptions].model_validate(
|
|
205
|
+
_wire_payload(options=_traces_options(), scanner_name="traces-scan")
|
|
206
|
+
)
|
|
207
|
+
assert json.loads(machine_input.execution_options)["group_name"] == "acme"
|
{fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/tests/test_root_scanner.py
RENAMED
|
@@ -11,8 +11,6 @@ from fluidattacks_core.models.state_machines.root_scanner import (
|
|
|
11
11
|
ContextualizesScanOptions,
|
|
12
12
|
PerRootScanOptions,
|
|
13
13
|
StateMachineExecutePerRootInput,
|
|
14
|
-
TracesScanInput,
|
|
15
|
-
TracesScanOptions,
|
|
16
14
|
)
|
|
17
15
|
|
|
18
16
|
|
|
@@ -267,44 +265,3 @@ def test_execute_per_root_machine_name_is_injective() -> None:
|
|
|
267
265
|
assert len(names) == 2
|
|
268
266
|
assert len(masked) == 2
|
|
269
267
|
assert len(roots) == 2
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
def _traces_options(**overrides: str) -> TracesScanOptions:
|
|
273
|
-
arguments: dict[str, str] = {
|
|
274
|
-
"config_id": "123456",
|
|
275
|
-
"group_name": "acme",
|
|
276
|
-
"root_nickname": "nickname",
|
|
277
|
-
"user_email": "test@fluidattacks.com",
|
|
278
|
-
}
|
|
279
|
-
arguments.update(overrides)
|
|
280
|
-
return TracesScanOptions(**arguments)
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
def _traces_input(options: TracesScanOptions | None = None) -> TracesScanInput:
|
|
284
|
-
return TracesScanInput.model_validate(
|
|
285
|
-
{
|
|
286
|
-
"job_definition": "traces_run",
|
|
287
|
-
"job_queue": "traces",
|
|
288
|
-
"scanner_name": "traces-scan-run",
|
|
289
|
-
"options": options if options is not None else _traces_options(),
|
|
290
|
-
}
|
|
291
|
-
)
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
def test_traces_scan_options_are_exactly_the_shared_per_root_fields() -> None:
|
|
295
|
-
options = _traces_options()
|
|
296
|
-
assert set(options.model_dump()) == set(PerRootScanOptions.model_fields)
|
|
297
|
-
assert TracesScanOptions.model_validate_json(options.model_dump_json()) == options
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
def test_traces_scan_input_keeps_the_seven_wire_keys_the_machine_reads() -> None:
|
|
301
|
-
dumped = _traces_input().to_wire()
|
|
302
|
-
assert set(dumped) == {
|
|
303
|
-
"configId",
|
|
304
|
-
"executionOptions",
|
|
305
|
-
"groupName",
|
|
306
|
-
"jobDefinition",
|
|
307
|
-
"jobQueue",
|
|
308
|
-
"rootNickname",
|
|
309
|
-
"scannerName",
|
|
310
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/tests/test_loader_env.py
RENAMED
|
File without changes
|
{fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/tests/test_model_scanner.py
RENAMED
|
File without changes
|
{fluidattacks_core_models-13.2.0 → fluidattacks_core_models-14.0.0}/tests/test_state_machines.py
RENAMED
|
File without changes
|