diff --git a/cyclonedx/model/tool.py b/cyclonedx/model/tool.py index b2b5ff41..bb639bbe 100644 --- a/cyclonedx/model/tool.py +++ b/cyclonedx/model/tool.py @@ -16,7 +16,8 @@ # Copyright (c) OWASP Foundation. All Rights Reserved. -from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Tuple, Type, Union +from itertools import chain +from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Type, Union from warnings import warn from xml.etree.ElementTree import Element # nosec B405 @@ -265,12 +266,14 @@ def __hash__(self) -> int: class _ToolRepositoryHelper(BaseHelper): @staticmethod - def __all_as_tools(o: ToolRepository) -> Tuple[Tool, ...]: - return ( - *o.tools, - *map(Tool.from_component, o.components), - *map(Tool.from_service, o.services), - ) + def __all_as_tools(o: ToolRepository) -> 'SortedSet[Tool]': + # use a set here, so the collection gets deduplicated. + # use SortedSet set here, so the order stays reproducible. + return SortedSet(chain( + o.tools, + map(Tool.from_component, o.components), + map(Tool.from_service, o.services), + )) @staticmethod def __supports_components_and_services(view: Any) -> bool: @@ -284,7 +287,8 @@ def json_normalize(cls, o: ToolRepository, *, view: Optional[Type['ViewType']], **__: Any) -> Any: if len(o.tools) > 0 or not cls.__supports_components_and_services(view): - return cls.__all_as_tools(o) or None + ts = cls.__all_as_tools(o) + return tuple(ts) if ts else None elem: Dict[str, Any] = {} if o.components: elem['components'] = tuple(o.components) diff --git a/tests/_data/models.py b/tests/_data/models.py index ce87efa6..72504e83 100644 --- a/tests/_data/models.py +++ b/tests/_data/models.py @@ -1172,6 +1172,31 @@ def get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate return _make_bom(metadata=BomMetaData(tools=tools)) +def get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate() -> Bom: + """on serialization, it is expected that only tools are emitted, and that they are deduplicated""" + tools = ToolRepository() + tcomp = tools.components + tserv = tools.services + ttools = tools.tools + tcomp.update(( + this_component(), + Component(name='test-component'), + Component(type=ComponentType.APPLICATION, + group='acme', + name='other-component'), + )) + tserv.update(( + Service(name='test-service'), + Service(group='acme', + name='other-service'), + )) + ttools.clear() + # duplicate components and services as tools + ttools.update(map(Tool.from_component, tcomp)) + ttools.update(map(Tool.from_service, tserv)) + return _make_bom(metadata=BomMetaData(tools=tools)) + + def get_bom_for_issue_497_urls() -> Bom: """regression test for issue #497 see https://github.com/CycloneDX/cyclonedx-python-lib/issues/497 diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.0.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.0.xml.bin new file mode 100644 index 00000000..acb06612 --- /dev/null +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.0.xml.bin @@ -0,0 +1,4 @@ + + + + diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.1.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.1.xml.bin new file mode 100644 index 00000000..55ef5cda --- /dev/null +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.1.xml.bin @@ -0,0 +1,4 @@ + + + + diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.2.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.2.json.bin new file mode 100644 index 00000000..0ca50ca7 --- /dev/null +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.2.json.bin @@ -0,0 +1,31 @@ +{ + "metadata": { + "timestamp": "2023-01-07T13:44:32.312678+00:00", + "tools": [ + { + "name": "cyclonedx-python-lib", + "vendor": "CycloneDX", + "version": "TESTING" + }, + { + "name": "other-component", + "vendor": "acme" + }, + { + "name": "other-service", + "vendor": "acme" + }, + { + "name": "test-component" + }, + { + "name": "test-service" + } + ] + }, + "serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac", + "version": 1, + "$schema": "http://cyclonedx.org/schema/bom-1.2b.schema.json", + "bomFormat": "CycloneDX", + "specVersion": "1.2" +} \ No newline at end of file diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.2.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.2.xml.bin new file mode 100644 index 00000000..e726653d --- /dev/null +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.2.xml.bin @@ -0,0 +1,27 @@ + + + + 2023-01-07T13:44:32.312678+00:00 + + + CycloneDX + cyclonedx-python-lib + TESTING + + + acme + other-component + + + acme + other-service + + + test-component + + + test-service + + + + diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.3.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.3.json.bin new file mode 100644 index 00000000..25fd5c20 --- /dev/null +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.3.json.bin @@ -0,0 +1,31 @@ +{ + "metadata": { + "timestamp": "2023-01-07T13:44:32.312678+00:00", + "tools": [ + { + "name": "cyclonedx-python-lib", + "vendor": "CycloneDX", + "version": "TESTING" + }, + { + "name": "other-component", + "vendor": "acme" + }, + { + "name": "other-service", + "vendor": "acme" + }, + { + "name": "test-component" + }, + { + "name": "test-service" + } + ] + }, + "serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac", + "version": 1, + "$schema": "http://cyclonedx.org/schema/bom-1.3a.schema.json", + "bomFormat": "CycloneDX", + "specVersion": "1.3" +} \ No newline at end of file diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.3.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.3.xml.bin new file mode 100644 index 00000000..0dfe7330 --- /dev/null +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.3.xml.bin @@ -0,0 +1,27 @@ + + + + 2023-01-07T13:44:32.312678+00:00 + + + CycloneDX + cyclonedx-python-lib + TESTING + + + acme + other-component + + + acme + other-service + + + test-component + + + test-service + + + + diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.4.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.4.json.bin new file mode 100644 index 00000000..16407cc3 --- /dev/null +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.4.json.bin @@ -0,0 +1,65 @@ +{ + "metadata": { + "timestamp": "2023-01-07T13:44:32.312678+00:00", + "tools": [ + { + "externalReferences": [ + { + "type": "build-system", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib/actions" + }, + { + "type": "distribution", + "url": "https://pypi.org/project/cyclonedx-python-lib/" + }, + { + "type": "documentation", + "url": "https://cyclonedx-python-library.readthedocs.io/" + }, + { + "type": "issue-tracker", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib/issues" + }, + { + "type": "license", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE" + }, + { + "type": "release-notes", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md" + }, + { + "type": "vcs", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib" + }, + { + "type": "website", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib/#readme" + } + ], + "name": "cyclonedx-python-lib", + "vendor": "CycloneDX", + "version": "TESTING" + }, + { + "name": "other-component", + "vendor": "acme" + }, + { + "name": "other-service", + "vendor": "acme" + }, + { + "name": "test-component" + }, + { + "name": "test-service" + } + ] + }, + "serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac", + "version": 1, + "$schema": "http://cyclonedx.org/schema/bom-1.4.schema.json", + "bomFormat": "CycloneDX", + "specVersion": "1.4" +} \ No newline at end of file diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.4.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.4.xml.bin new file mode 100644 index 00000000..f5504a7a --- /dev/null +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.4.xml.bin @@ -0,0 +1,53 @@ + + + + 2023-01-07T13:44:32.312678+00:00 + + + CycloneDX + cyclonedx-python-lib + TESTING + + + https://github.com/CycloneDX/cyclonedx-python-lib/actions + + + https://pypi.org/project/cyclonedx-python-lib/ + + + https://cyclonedx-python-library.readthedocs.io/ + + + https://github.com/CycloneDX/cyclonedx-python-lib/issues + + + https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE + + + https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md + + + https://github.com/CycloneDX/cyclonedx-python-lib + + + https://github.com/CycloneDX/cyclonedx-python-lib/#readme + + + + + acme + other-component + + + acme + other-service + + + test-component + + + test-service + + + + diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.5.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.5.json.bin new file mode 100644 index 00000000..d66bbf23 --- /dev/null +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.5.json.bin @@ -0,0 +1,75 @@ +{ + "metadata": { + "timestamp": "2023-01-07T13:44:32.312678+00:00", + "tools": [ + { + "externalReferences": [ + { + "type": "build-system", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib/actions" + }, + { + "type": "distribution", + "url": "https://pypi.org/project/cyclonedx-python-lib/" + }, + { + "type": "documentation", + "url": "https://cyclonedx-python-library.readthedocs.io/" + }, + { + "type": "issue-tracker", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib/issues" + }, + { + "type": "license", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE" + }, + { + "type": "release-notes", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md" + }, + { + "type": "vcs", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib" + }, + { + "type": "website", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib/#readme" + } + ], + "name": "cyclonedx-python-lib", + "vendor": "CycloneDX", + "version": "TESTING" + }, + { + "name": "other-component", + "vendor": "acme" + }, + { + "name": "other-service", + "vendor": "acme" + }, + { + "name": "test-component" + }, + { + "name": "test-service" + } + ] + }, + "properties": [ + { + "name": "key1", + "value": "val1" + }, + { + "name": "key2", + "value": "val2" + } + ], + "serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac", + "version": 1, + "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json", + "bomFormat": "CycloneDX", + "specVersion": "1.5" +} \ No newline at end of file diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.5.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.5.xml.bin new file mode 100644 index 00000000..40ae59a7 --- /dev/null +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.5.xml.bin @@ -0,0 +1,57 @@ + + + + 2023-01-07T13:44:32.312678+00:00 + + + CycloneDX + cyclonedx-python-lib + TESTING + + + https://github.com/CycloneDX/cyclonedx-python-lib/actions + + + https://pypi.org/project/cyclonedx-python-lib/ + + + https://cyclonedx-python-library.readthedocs.io/ + + + https://github.com/CycloneDX/cyclonedx-python-lib/issues + + + https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE + + + https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md + + + https://github.com/CycloneDX/cyclonedx-python-lib + + + https://github.com/CycloneDX/cyclonedx-python-lib/#readme + + + + + acme + other-component + + + acme + other-service + + + test-component + + + test-service + + + + + val1 + val2 + + diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.6.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.6.json.bin new file mode 100644 index 00000000..0cf661c0 --- /dev/null +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.6.json.bin @@ -0,0 +1,75 @@ +{ + "metadata": { + "timestamp": "2023-01-07T13:44:32.312678+00:00", + "tools": [ + { + "externalReferences": [ + { + "type": "build-system", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib/actions" + }, + { + "type": "distribution", + "url": "https://pypi.org/project/cyclonedx-python-lib/" + }, + { + "type": "documentation", + "url": "https://cyclonedx-python-library.readthedocs.io/" + }, + { + "type": "issue-tracker", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib/issues" + }, + { + "type": "license", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE" + }, + { + "type": "release-notes", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md" + }, + { + "type": "vcs", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib" + }, + { + "type": "website", + "url": "https://github.com/CycloneDX/cyclonedx-python-lib/#readme" + } + ], + "name": "cyclonedx-python-lib", + "vendor": "CycloneDX", + "version": "TESTING" + }, + { + "name": "other-component", + "vendor": "acme" + }, + { + "name": "other-service", + "vendor": "acme" + }, + { + "name": "test-component" + }, + { + "name": "test-service" + } + ] + }, + "properties": [ + { + "name": "key1", + "value": "val1" + }, + { + "name": "key2", + "value": "val2" + } + ], + "serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac", + "version": 1, + "$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json", + "bomFormat": "CycloneDX", + "specVersion": "1.6" +} \ No newline at end of file diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.6.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.6.xml.bin new file mode 100644 index 00000000..89d558fb --- /dev/null +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_duplicated_tools_irreversible_migrate-1.6.xml.bin @@ -0,0 +1,57 @@ + + + + 2023-01-07T13:44:32.312678+00:00 + + + CycloneDX + cyclonedx-python-lib + TESTING + + + https://github.com/CycloneDX/cyclonedx-python-lib/actions + + + https://pypi.org/project/cyclonedx-python-lib/ + + + https://cyclonedx-python-library.readthedocs.io/ + + + https://github.com/CycloneDX/cyclonedx-python-lib/issues + + + https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE + + + https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md + + + https://github.com/CycloneDX/cyclonedx-python-lib + + + https://github.com/CycloneDX/cyclonedx-python-lib/#readme + + + + + acme + other-component + + + acme + other-service + + + test-component + + + test-service + + + + + val1 + val2 + + diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.2.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.2.json.bin index 7aa7bc43..ca5d7d52 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.2.json.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.2.json.bin @@ -11,40 +11,35 @@ "hashes": [ { "alg": "SHA-256", - "content": "adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6" + "content": "49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca" } ], - "name": "test-tool-a", - "vendor": "example", - "version": "1.33.7" + "name": "other-component", + "vendor": "acme" }, { - "name": "test-tool-b" + "name": "other-service", + "vendor": "acme" }, { "hashes": [ { "alg": "SHA-256", - "content": "49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca" + "content": "adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6" } ], - "name": "other-component", - "vendor": "acme" - }, - { - "name": "cyclonedx-python-lib", - "vendor": "CycloneDX", - "version": "TESTING" + "name": "test-tool-a", + "vendor": "example", + "version": "1.33.7" }, { "name": "test-component" }, { - "name": "other-service", - "vendor": "acme" + "name": "test-service" }, { - "name": "test-service" + "name": "test-tool-b" } ] }, diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.2.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.2.xml.bin index ff3213ee..42294a3c 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.2.xml.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.2.xml.bin @@ -9,37 +9,32 @@ TESTING - example - test-tool-a - 1.33.7 + acme + other-component - adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6 + 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca - test-tool-b + acme + other-service - acme - other-component + example + test-tool-a + 1.33.7 - 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca + adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6 - - CycloneDX - cyclonedx-python-lib - TESTING - test-component - acme - other-service + test-service - test-service + test-tool-b diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.3.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.3.json.bin index 258f92e2..eefffde7 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.3.json.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.3.json.bin @@ -11,40 +11,35 @@ "hashes": [ { "alg": "SHA-256", - "content": "adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6" + "content": "49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca" } ], - "name": "test-tool-a", - "vendor": "example", - "version": "1.33.7" + "name": "other-component", + "vendor": "acme" }, { - "name": "test-tool-b" + "name": "other-service", + "vendor": "acme" }, { "hashes": [ { "alg": "SHA-256", - "content": "49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca" + "content": "adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6" } ], - "name": "other-component", - "vendor": "acme" - }, - { - "name": "cyclonedx-python-lib", - "vendor": "CycloneDX", - "version": "TESTING" + "name": "test-tool-a", + "vendor": "example", + "version": "1.33.7" }, { "name": "test-component" }, { - "name": "other-service", - "vendor": "acme" + "name": "test-service" }, { - "name": "test-service" + "name": "test-tool-b" } ] }, diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.3.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.3.xml.bin index 014efb51..b734059f 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.3.xml.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.3.xml.bin @@ -9,37 +9,32 @@ TESTING - example - test-tool-a - 1.33.7 + acme + other-component - adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6 + 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca - test-tool-b + acme + other-service - acme - other-component + example + test-tool-a + 1.33.7 - 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca + adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6 - - CycloneDX - cyclonedx-python-lib - TESTING - test-component - acme - other-service + test-service - test-service + test-tool-b diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.4.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.4.json.bin index 65e7df8b..4d6c2c33 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.4.json.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.4.json.bin @@ -58,15 +58,11 @@ "hashes": [ { "alg": "SHA-256", - "content": "adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6" + "content": "49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca" } ], - "name": "test-tool-a", - "vendor": "example", - "version": "1.33.7" - }, - { - "name": "test-tool-b" + "name": "other-component", + "vendor": "acme" }, { "externalReferences": [ @@ -82,57 +78,9 @@ "url": "https://cyclonedx.org" } ], - "hashes": [ - { - "alg": "SHA-256", - "content": "49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca" - } - ], - "name": "other-component", + "name": "other-service", "vendor": "acme" }, - { - "externalReferences": [ - { - "type": "build-system", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib/actions" - }, - { - "type": "distribution", - "url": "https://pypi.org/project/cyclonedx-python-lib/" - }, - { - "type": "documentation", - "url": "https://cyclonedx-python-library.readthedocs.io/" - }, - { - "type": "issue-tracker", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib/issues" - }, - { - "type": "license", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE" - }, - { - "type": "release-notes", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md" - }, - { - "type": "vcs", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib" - }, - { - "type": "website", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib/#readme" - } - ], - "name": "cyclonedx-python-lib", - "vendor": "CycloneDX", - "version": "TESTING" - }, - { - "name": "test-component" - }, { "externalReferences": [ { @@ -147,11 +95,24 @@ "url": "https://cyclonedx.org" } ], - "name": "other-service", - "vendor": "acme" + "hashes": [ + { + "alg": "SHA-256", + "content": "adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6" + } + ], + "name": "test-tool-a", + "vendor": "example", + "version": "1.33.7" + }, + { + "name": "test-component" }, { "name": "test-service" + }, + { + "name": "test-tool-b" } ] }, diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.4.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.4.xml.bin index f7f59286..55e694f9 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.4.xml.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.4.xml.bin @@ -35,11 +35,10 @@ - example - test-tool-a - 1.33.7 + acme + other-component - adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6 + 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca @@ -51,15 +50,9 @@ - - test-tool-b - acme - other-component - - 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca - + other-service https://cyclonedx.org @@ -71,42 +64,12 @@ - CycloneDX - cyclonedx-python-lib - TESTING - - - https://github.com/CycloneDX/cyclonedx-python-lib/actions - - - https://pypi.org/project/cyclonedx-python-lib/ - - - https://cyclonedx-python-library.readthedocs.io/ - - - https://github.com/CycloneDX/cyclonedx-python-lib/issues - - - https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE - - - https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md - - - https://github.com/CycloneDX/cyclonedx-python-lib - - - https://github.com/CycloneDX/cyclonedx-python-lib/#readme - - - - - test-component - - - acme - other-service + example + test-tool-a + 1.33.7 + + adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6 + https://cyclonedx.org @@ -117,9 +80,15 @@ + + test-component + test-service + + test-tool-b + diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.5.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.5.json.bin index 003ad286..f0ab4915 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.5.json.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.5.json.bin @@ -58,15 +58,11 @@ "hashes": [ { "alg": "SHA-256", - "content": "adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6" + "content": "49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca" } ], - "name": "test-tool-a", - "vendor": "example", - "version": "1.33.7" - }, - { - "name": "test-tool-b" + "name": "other-component", + "vendor": "acme" }, { "externalReferences": [ @@ -82,57 +78,9 @@ "url": "https://cyclonedx.org" } ], - "hashes": [ - { - "alg": "SHA-256", - "content": "49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca" - } - ], - "name": "other-component", + "name": "other-service", "vendor": "acme" }, - { - "externalReferences": [ - { - "type": "build-system", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib/actions" - }, - { - "type": "distribution", - "url": "https://pypi.org/project/cyclonedx-python-lib/" - }, - { - "type": "documentation", - "url": "https://cyclonedx-python-library.readthedocs.io/" - }, - { - "type": "issue-tracker", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib/issues" - }, - { - "type": "license", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE" - }, - { - "type": "release-notes", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md" - }, - { - "type": "vcs", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib" - }, - { - "type": "website", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib/#readme" - } - ], - "name": "cyclonedx-python-lib", - "vendor": "CycloneDX", - "version": "TESTING" - }, - { - "name": "test-component" - }, { "externalReferences": [ { @@ -147,11 +95,24 @@ "url": "https://cyclonedx.org" } ], - "name": "other-service", - "vendor": "acme" + "hashes": [ + { + "alg": "SHA-256", + "content": "adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6" + } + ], + "name": "test-tool-a", + "vendor": "example", + "version": "1.33.7" + }, + { + "name": "test-component" }, { "name": "test-service" + }, + { + "name": "test-tool-b" } ] }, diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.5.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.5.xml.bin index 36269a5f..e0cee50f 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.5.xml.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.5.xml.bin @@ -35,11 +35,10 @@ - example - test-tool-a - 1.33.7 + acme + other-component - adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6 + 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca @@ -51,15 +50,9 @@ - - test-tool-b - acme - other-component - - 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca - + other-service https://cyclonedx.org @@ -71,42 +64,12 @@ - CycloneDX - cyclonedx-python-lib - TESTING - - - https://github.com/CycloneDX/cyclonedx-python-lib/actions - - - https://pypi.org/project/cyclonedx-python-lib/ - - - https://cyclonedx-python-library.readthedocs.io/ - - - https://github.com/CycloneDX/cyclonedx-python-lib/issues - - - https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE - - - https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md - - - https://github.com/CycloneDX/cyclonedx-python-lib - - - https://github.com/CycloneDX/cyclonedx-python-lib/#readme - - - - - test-component - - - acme - other-service + example + test-tool-a + 1.33.7 + + adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6 + https://cyclonedx.org @@ -117,9 +80,15 @@ + + test-component + test-service + + test-tool-b + diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.6.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.6.json.bin index 9dcb98b2..d16d0598 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.6.json.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.6.json.bin @@ -58,15 +58,11 @@ "hashes": [ { "alg": "SHA-256", - "content": "adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6" + "content": "49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca" } ], - "name": "test-tool-a", - "vendor": "example", - "version": "1.33.7" - }, - { - "name": "test-tool-b" + "name": "other-component", + "vendor": "acme" }, { "externalReferences": [ @@ -82,57 +78,9 @@ "url": "https://cyclonedx.org" } ], - "hashes": [ - { - "alg": "SHA-256", - "content": "49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca" - } - ], - "name": "other-component", + "name": "other-service", "vendor": "acme" }, - { - "externalReferences": [ - { - "type": "build-system", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib/actions" - }, - { - "type": "distribution", - "url": "https://pypi.org/project/cyclonedx-python-lib/" - }, - { - "type": "documentation", - "url": "https://cyclonedx-python-library.readthedocs.io/" - }, - { - "type": "issue-tracker", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib/issues" - }, - { - "type": "license", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE" - }, - { - "type": "release-notes", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md" - }, - { - "type": "vcs", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib" - }, - { - "type": "website", - "url": "https://github.com/CycloneDX/cyclonedx-python-lib/#readme" - } - ], - "name": "cyclonedx-python-lib", - "vendor": "CycloneDX", - "version": "TESTING" - }, - { - "name": "test-component" - }, { "externalReferences": [ { @@ -147,11 +95,24 @@ "url": "https://cyclonedx.org" } ], - "name": "other-service", - "vendor": "acme" + "hashes": [ + { + "alg": "SHA-256", + "content": "adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6" + } + ], + "name": "test-tool-a", + "vendor": "example", + "version": "1.33.7" + }, + { + "name": "test-component" }, { "name": "test-service" + }, + { + "name": "test-tool-b" } ] }, diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.6.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.6.xml.bin index 2cef1e3c..5b560874 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.6.xml.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_and_tools_irreversible_migrate-1.6.xml.bin @@ -35,11 +35,10 @@ - example - test-tool-a - 1.33.7 + acme + other-component - adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6 + 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca @@ -51,15 +50,9 @@ - - test-tool-b - acme - other-component - - 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca - + other-service https://cyclonedx.org @@ -71,42 +64,12 @@ - CycloneDX - cyclonedx-python-lib - TESTING - - - https://github.com/CycloneDX/cyclonedx-python-lib/actions - - - https://pypi.org/project/cyclonedx-python-lib/ - - - https://cyclonedx-python-library.readthedocs.io/ - - - https://github.com/CycloneDX/cyclonedx-python-lib/issues - - - https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE - - - https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md - - - https://github.com/CycloneDX/cyclonedx-python-lib - - - https://github.com/CycloneDX/cyclonedx-python-lib/#readme - - - - - test-component - - - acme - other-service + example + test-tool-a + 1.33.7 + + adbbbe72c8f023b4a2d96a3978f69d94873ab2fef424e0298287c3368519c1a6 + https://cyclonedx.org @@ -117,9 +80,15 @@ + + test-component + test-service + + test-tool-b + diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.2.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.2.json.bin index fe7ad128..ea32ff1c 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.2.json.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.2.json.bin @@ -2,6 +2,11 @@ "metadata": { "timestamp": "2023-01-07T13:44:32.312678+00:00", "tools": [ + { + "name": "cyclonedx-python-lib", + "vendor": "CycloneDX", + "version": "TESTING" + }, { "hashes": [ { @@ -13,17 +18,12 @@ "vendor": "acme" }, { - "name": "cyclonedx-python-lib", - "vendor": "CycloneDX", - "version": "TESTING" + "name": "other-service", + "vendor": "acme" }, { "name": "test-component" }, - { - "name": "other-service", - "vendor": "acme" - }, { "name": "test-service" } diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.2.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.2.xml.bin index 127ca67d..ec74cfb1 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.2.xml.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.2.xml.bin @@ -3,6 +3,11 @@ 2023-01-07T13:44:32.312678+00:00 + + CycloneDX + cyclonedx-python-lib + TESTING + acme other-component @@ -11,17 +16,12 @@ - CycloneDX - cyclonedx-python-lib - TESTING + acme + other-service test-component - - acme - other-service - test-service diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.3.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.3.json.bin index 9a895165..fbeec8f3 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.3.json.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.3.json.bin @@ -2,6 +2,11 @@ "metadata": { "timestamp": "2023-01-07T13:44:32.312678+00:00", "tools": [ + { + "name": "cyclonedx-python-lib", + "vendor": "CycloneDX", + "version": "TESTING" + }, { "hashes": [ { @@ -13,17 +18,12 @@ "vendor": "acme" }, { - "name": "cyclonedx-python-lib", - "vendor": "CycloneDX", - "version": "TESTING" + "name": "other-service", + "vendor": "acme" }, { "name": "test-component" }, - { - "name": "other-service", - "vendor": "acme" - }, { "name": "test-service" } diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.3.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.3.xml.bin index 179cd42f..514e1f50 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.3.xml.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.3.xml.bin @@ -3,6 +3,11 @@ 2023-01-07T13:44:32.312678+00:00 + + CycloneDX + cyclonedx-python-lib + TESTING + acme other-component @@ -11,17 +16,12 @@ - CycloneDX - cyclonedx-python-lib - TESTING + acme + other-service test-component - - acme - other-service - test-service diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.4.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.4.json.bin index 0a8265dc..c45daad3 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.4.json.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.4.json.bin @@ -2,29 +2,6 @@ "metadata": { "timestamp": "2023-01-07T13:44:32.312678+00:00", "tools": [ - { - "externalReferences": [ - { - "comment": "No comment", - "hashes": [ - { - "alg": "SHA-256", - "content": "806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b" - } - ], - "type": "distribution", - "url": "https://cyclonedx.org" - } - ], - "hashes": [ - { - "alg": "SHA-256", - "content": "49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca" - } - ], - "name": "other-component", - "vendor": "acme" - }, { "externalReferences": [ { @@ -65,7 +42,27 @@ "version": "TESTING" }, { - "name": "test-component" + "externalReferences": [ + { + "comment": "No comment", + "hashes": [ + { + "alg": "SHA-256", + "content": "806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b" + } + ], + "type": "distribution", + "url": "https://cyclonedx.org" + } + ], + "hashes": [ + { + "alg": "SHA-256", + "content": "49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca" + } + ], + "name": "other-component", + "vendor": "acme" }, { "externalReferences": [ @@ -84,6 +81,9 @@ "name": "other-service", "vendor": "acme" }, + { + "name": "test-component" + }, { "name": "test-service" } diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.4.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.4.xml.bin index 37e5bb55..53304d72 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.4.xml.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_and_service_migrate-1.4.xml.bin @@ -3,22 +3,6 @@ 2023-01-07T13:44:32.312678+00:00 - - acme - other-component - - 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca - - - - https://cyclonedx.org - No comment - - 806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b - - - - CycloneDX cyclonedx-python-lib @@ -51,7 +35,20 @@ - test-component + acme + other-component + + 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca + + + + https://cyclonedx.org + No comment + + 806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b + + + acme @@ -66,6 +63,9 @@ + + test-component + test-service diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.2.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.2.json.bin index 9bd4cad8..b0ee39ea 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.2.json.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.2.json.bin @@ -2,6 +2,11 @@ "metadata": { "timestamp": "2023-01-07T13:44:32.312678+00:00", "tools": [ + { + "name": "cyclonedx-python-lib", + "vendor": "CycloneDX", + "version": "TESTING" + }, { "hashes": [ { @@ -12,11 +17,6 @@ "name": "other-component", "vendor": "acme" }, - { - "name": "cyclonedx-python-lib", - "vendor": "CycloneDX", - "version": "TESTING" - }, { "name": "test-component" } diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.2.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.2.xml.bin index 5b72b038..5614334a 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.2.xml.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.2.xml.bin @@ -3,6 +3,11 @@ 2023-01-07T13:44:32.312678+00:00 + + CycloneDX + cyclonedx-python-lib + TESTING + acme other-component @@ -10,11 +15,6 @@ 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca - - CycloneDX - cyclonedx-python-lib - TESTING - test-component diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.3.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.3.json.bin index b15f1484..6d5ee915 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.3.json.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.3.json.bin @@ -2,6 +2,11 @@ "metadata": { "timestamp": "2023-01-07T13:44:32.312678+00:00", "tools": [ + { + "name": "cyclonedx-python-lib", + "vendor": "CycloneDX", + "version": "TESTING" + }, { "hashes": [ { @@ -12,11 +17,6 @@ "name": "other-component", "vendor": "acme" }, - { - "name": "cyclonedx-python-lib", - "vendor": "CycloneDX", - "version": "TESTING" - }, { "name": "test-component" } diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.3.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.3.xml.bin index 9b323bdf..469b6dfc 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.3.xml.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.3.xml.bin @@ -3,6 +3,11 @@ 2023-01-07T13:44:32.312678+00:00 + + CycloneDX + cyclonedx-python-lib + TESTING + acme other-component @@ -10,11 +15,6 @@ 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca - - CycloneDX - cyclonedx-python-lib - TESTING - test-component diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.4.json.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.4.json.bin index 29a67eb3..a56d92b9 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.4.json.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.4.json.bin @@ -2,29 +2,6 @@ "metadata": { "timestamp": "2023-01-07T13:44:32.312678+00:00", "tools": [ - { - "externalReferences": [ - { - "comment": "No comment", - "hashes": [ - { - "alg": "SHA-256", - "content": "806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b" - } - ], - "type": "distribution", - "url": "https://cyclonedx.org" - } - ], - "hashes": [ - { - "alg": "SHA-256", - "content": "49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca" - } - ], - "name": "other-component", - "vendor": "acme" - }, { "externalReferences": [ { @@ -64,6 +41,29 @@ "vendor": "CycloneDX", "version": "TESTING" }, + { + "externalReferences": [ + { + "comment": "No comment", + "hashes": [ + { + "alg": "SHA-256", + "content": "806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b" + } + ], + "type": "distribution", + "url": "https://cyclonedx.org" + } + ], + "hashes": [ + { + "alg": "SHA-256", + "content": "49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca" + } + ], + "name": "other-component", + "vendor": "acme" + }, { "name": "test-component" } diff --git a/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.4.xml.bin b/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.4.xml.bin index 64dd255d..d64c901e 100644 --- a/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.4.xml.bin +++ b/tests/_data/snapshots/get_bom_with_tools_with_component_migrate-1.4.xml.bin @@ -3,22 +3,6 @@ 2023-01-07T13:44:32.312678+00:00 - - acme - other-component - - 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca - - - - https://cyclonedx.org - No comment - - 806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b - - - - CycloneDX cyclonedx-python-lib @@ -50,6 +34,22 @@ + + acme + other-component + + 49b420bd8d8182542a76d4422e0c7890dcc88a3d8ddad04da06366d8c40ac8ca + + + + https://cyclonedx.org + No comment + + 806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b + + + + test-component