Skip to content

Commit 0d7b205

Browse files
committed
Merge branch 'main' into feat/bom.definitions-full
2 parents e104148 + 6003feb commit 0d7b205

File tree

16 files changed

+181
-168
lines changed

16 files changed

+181
-168
lines changed

cyclonedx/model/__init__.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class DataFlow(str, Enum):
6464
This is our internal representation of the dataFlowType simple type within the CycloneDX standard.
6565
6666
.. note::
67-
See the CycloneDX Schema: https://cyclonedx.org/docs/1.4/xml/#type_dataFlowType
67+
See the CycloneDX Schema: https://cyclonedx.org/docs/1.6/xml/#type_dataFlowType
6868
"""
6969
INBOUND = 'inbound'
7070
OUTBOUND = 'outbound'
@@ -82,7 +82,7 @@ class DataClassification:
8282
8383
.. note::
8484
See the CycloneDX Schema for dataClassificationType:
85-
https://cyclonedx.org/docs/1.4/xml/#type_dataClassificationType
85+
https://cyclonedx.org/docs/1.6/xml/#type_dataClassificationType
8686
"""
8787

8888
def __init__(
@@ -160,7 +160,7 @@ class Encoding(str, Enum):
160160
This is our internal representation of the encoding simple type within the CycloneDX standard.
161161
162162
.. note::
163-
See the CycloneDX Schema: https://cyclonedx.org/docs/1.4/#type_encoding
163+
See the CycloneDX Schema: https://cyclonedx.org/docs/1.6/#type_encoding
164164
"""
165165
BASE_64 = 'base64'
166166

@@ -171,7 +171,7 @@ class AttachedText:
171171
This is our internal representation of the `attachedTextType` complex type within the CycloneDX standard.
172172
173173
.. note::
174-
See the CycloneDX Schema for hashType: https://cyclonedx.org/docs/1.3/#type_attachedTextType
174+
See the CycloneDX Schema for hashType: https://cyclonedx.org/docs/1.6/#type_attachedTextType
175175
"""
176176

177177
DEFAULT_CONTENT_TYPE = 'text/plain'
@@ -263,7 +263,7 @@ class HashAlgorithm(str, Enum):
263263
This is our internal representation of the hashAlg simple type within the CycloneDX standard.
264264
265265
.. note::
266-
See the CycloneDX Schema: https://cyclonedx.org/docs/1.3/#type_hashAlg
266+
See the CycloneDX Schema: https://cyclonedx.org/docs/1.6/#type_hashAlg
267267
"""
268268
# see `_HashTypeRepositorySerializationHelper.__CASES` for view/case map
269269
BLAKE2B_256 = 'BLAKE2b-256' # Only supported in >= 1.2
@@ -386,7 +386,7 @@ class HashType:
386386
This is our internal representation of the hashType complex type within the CycloneDX standard.
387387
388388
.. note::
389-
See the CycloneDX Schema for hashType: https://cyclonedx.org/docs/1.3/#type_hashType
389+
See the CycloneDX Schema for hashType: https://cyclonedx.org/docs/1.6/#type_hashType
390390
"""
391391

392392
@staticmethod
@@ -542,7 +542,7 @@ class ExternalReferenceType(str, Enum):
542542
Enum object that defines the permissible 'types' for an External Reference according to the CycloneDX schema.
543543
544544
.. note::
545-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.3/#type_externalReferenceType
545+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/#type_externalReferenceType
546546
"""
547547
# see `_ExternalReferenceSerializationHelper.__CASES` for view/case map
548548
ADVERSARY_MODEL = 'adversary-model' # Only supported in >= 1.5
@@ -810,7 +810,7 @@ class ExternalReference:
810810
a CycloneDX BOM document.
811811
812812
.. note::
813-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.3/#type_externalReference
813+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/#type_externalReference
814814
"""
815815

816816
def __init__(
@@ -923,7 +923,7 @@ class Property:
923923
a CycloneDX BOM document.
924924
925925
.. note::
926-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.4/xml/#type_propertyType
926+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/xml/#type_propertyType
927927
928928
Specifies an individual property with a name and value.
929929
"""
@@ -997,7 +997,7 @@ class NoteText:
997997
a CycloneDX BOM document.
998998
999999
.. note::
1000-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.4/xml/#type_releaseNotesType
1000+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/xml/#type_releaseNotesType
10011001
"""
10021002

10031003
DEFAULT_CONTENT_TYPE: str = 'text/plain'
@@ -1088,7 +1088,7 @@ class Note:
10881088
a CycloneDX BOM document.
10891089
10901090
.. note::
1091-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.4/xml/#type_releaseNotesType
1091+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/xml/#type_releaseNotesType
10921092
10931093
@todo: Replace ``NoteText`` with ``AttachedText``?
10941094
"""
@@ -1171,7 +1171,7 @@ class IdentifiableAction:
11711171
This is our internal representation of the `identifiableActionType` complex type.
11721172
11731173
.. note::
1174-
See the CycloneDX specification: https://cyclonedx.org/docs/1.4/xml/#type_identifiableActionType
1174+
See the CycloneDX specification: https://cyclonedx.org/docs/1.6/xml/#type_identifiableActionType
11751175
"""
11761176

11771177
def __init__(
@@ -1261,7 +1261,7 @@ class Copyright:
12611261
This is our internal representation of the `copyrightsType` complex type.
12621262
12631263
.. note::
1264-
See the CycloneDX specification: https://cyclonedx.org/docs/1.4/xml/#type_copyrightsType
1264+
See the CycloneDX specification: https://cyclonedx.org/docs/1.6/xml/#type_copyrightsType
12651265
"""
12661266

12671267
def __init__(

cyclonedx/model/bom.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636
SchemaVersion1Dot5,
3737
SchemaVersion1Dot6,
3838
)
39-
from ..serialization import LicenseRepositoryHelper, UrnUuidHelper
39+
from ..serialization import UrnUuidHelper
4040
from . import _BOM_LINK_PREFIX, ExternalReference, Property
4141
from .bom_ref import BomRef
4242
from .component import Component
4343
from .contact import OrganizationalContact, OrganizationalEntity
4444
from .definition import Definitions
4545
from .dependency import Dependable, Dependency
46-
from .license import License, LicenseExpression, LicenseRepository
46+
from .license import License, LicenseExpression, LicenseRepository, _LicenseRepositorySerializationHelper
4747
from .lifecycle import Lifecycle, LifecycleRepository, _LifecycleRepositoryHelper
4848
from .service import Service
4949
from .tool import Tool, ToolRepository, _ToolRepositoryHelper
@@ -59,7 +59,7 @@ class BomMetaData:
5959
This is our internal representation of the metadata complex type within the CycloneDX standard.
6060
6161
.. note::
62-
See the CycloneDX Schema for Bom metadata: https://cyclonedx.org/docs/1.5/#type_metadata
62+
See the CycloneDX Schema for Bom metadata: https://cyclonedx.org/docs/1.6/#type_metadata
6363
"""
6464

6565
def __init__(
@@ -254,7 +254,7 @@ def supplier(self, supplier: Optional[OrganizationalEntity]) -> None:
254254
@serializable.view(SchemaVersion1Dot4)
255255
@serializable.view(SchemaVersion1Dot5)
256256
@serializable.view(SchemaVersion1Dot6)
257-
@serializable.type_mapping(LicenseRepositoryHelper)
257+
@serializable.type_mapping(_LicenseRepositorySerializationHelper)
258258
@serializable.xml_sequence(9)
259259
def licenses(self) -> LicenseRepository:
260260
"""
@@ -394,7 +394,7 @@ def metadata(self) -> BomMetaData:
394394
Metadata object instance for this Bom.
395395
396396
.. note::
397-
See the CycloneDX Schema for Bom metadata: https://cyclonedx.org/docs/1.3/#type_metadata
397+
See the CycloneDX Schema for Bom metadata: https://cyclonedx.org/docs/1.6/#type_metadata
398398
"""
399399
return self._metadata
400400

cyclonedx/model/component.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
SchemaVersion1Dot5,
4545
SchemaVersion1Dot6,
4646
)
47-
from ..serialization import BomRefHelper, LicenseRepositoryHelper, PackageUrl as PackageUrlSH
47+
from ..serialization import PackageUrl as PackageUrlSH
4848
from . import (
4949
AttachedText,
5050
Copyright,
@@ -61,7 +61,7 @@
6161
from .crypto import CryptoProperties
6262
from .dependency import Dependable
6363
from .issue import IssueType
64-
from .license import License, LicenseRepository
64+
from .license import License, LicenseRepository, _LicenseRepositorySerializationHelper
6565
from .release_note import ReleaseNotes
6666

6767

@@ -71,7 +71,7 @@ class Commit:
7171
Our internal representation of the `commitType` complex type.
7272
7373
.. note::
74-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.4/xml/#type_commitType
74+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/xml/#type_commitType
7575
"""
7676

7777
def __init__(
@@ -200,7 +200,7 @@ class ComponentEvidence:
200200
Provides the ability to document evidence collected through various forms of extraction or analysis.
201201
202202
.. note::
203-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.4/xml/#type_componentEvidenceType
203+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/xml/#type_componentEvidenceType
204204
"""
205205

206206
def __init__(
@@ -250,7 +250,7 @@ def __init__(
250250
# ... # TODO since CDX1.5
251251

252252
@property
253-
@serializable.type_mapping(LicenseRepositoryHelper)
253+
@serializable.type_mapping(_LicenseRepositorySerializationHelper)
254254
@serializable.xml_sequence(4)
255255
def licenses(self) -> LicenseRepository:
256256
"""
@@ -299,7 +299,7 @@ class ComponentScope(str, Enum):
299299
Enum object that defines the permissable 'scopes' for a Component according to the CycloneDX schema.
300300
301301
.. note::
302-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.3/#type_scope
302+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/#type_scope
303303
"""
304304
# see `_ComponentScopeSerializationHelper.__CASES` for view/case map
305305
REQUIRED = 'required'
@@ -355,7 +355,7 @@ class ComponentType(str, Enum):
355355
Enum object that defines the permissible 'types' for a Component according to the CycloneDX schema.
356356
357357
.. note::
358-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.3/#type_classification
358+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/#type_classification
359359
"""
360360
# see `_ComponentTypeSerializationHelper.__CASES` for view/case map
361361
APPLICATION = 'application'
@@ -434,7 +434,7 @@ class Diff:
434434
Our internal representation of the `diffType` complex type.
435435
436436
.. note::
437-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.4/xml/#type_diffType
437+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/xml/#type_diffType
438438
"""
439439

440440
def __init__(
@@ -505,7 +505,7 @@ class PatchClassification(str, Enum):
505505
Enum object that defines the permissible `patchClassification`s.
506506
507507
.. note::
508-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.4/xml/#type_patchClassification
508+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/xml/#type_patchClassification
509509
"""
510510
BACKPORT = 'backport'
511511
CHERRY_PICK = 'cherry-pick'
@@ -519,7 +519,7 @@ class Patch:
519519
Our internal representation of the `patchType` complex type.
520520
521521
.. note::
522-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.4/xml/#type_patchType
522+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/xml/#type_patchType
523523
"""
524524

525525
def __init__(
@@ -612,7 +612,7 @@ class Pedigree:
612612
may not be known.
613613
614614
.. note::
615-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.4/xml/#type_pedigreeType
615+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/xml/#type_pedigreeType
616616
"""
617617

618618
def __init__(
@@ -769,7 +769,7 @@ class Swid:
769769
Our internal representation of the `swidType` complex type.
770770
771771
.. note::
772-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.4/xml/#type_swidType
772+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/xml/#type_swidType
773773
"""
774774

775775
def __init__(
@@ -1029,7 +1029,7 @@ class Component(Dependable):
10291029
This is our internal representation of a Component within a Bom.
10301030
10311031
.. note::
1032-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.3/#type_component
1032+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/#type_component
10331033
"""
10341034

10351035
@staticmethod
@@ -1171,7 +1171,7 @@ def mime_type(self, mime_type: Optional[str]) -> None:
11711171

11721172
@property
11731173
@serializable.json_name('bom-ref')
1174-
@serializable.type_mapping(BomRefHelper)
1174+
@serializable.type_mapping(BomRef)
11751175
@serializable.view(SchemaVersion1Dot1)
11761176
@serializable.view(SchemaVersion1Dot2)
11771177
@serializable.view(SchemaVersion1Dot3)
@@ -1407,7 +1407,7 @@ def hashes(self, hashes: Iterable[HashType]) -> None:
14071407
@serializable.view(SchemaVersion1Dot4)
14081408
@serializable.view(SchemaVersion1Dot5)
14091409
@serializable.view(SchemaVersion1Dot6)
1410-
@serializable.type_mapping(LicenseRepositoryHelper)
1410+
@serializable.type_mapping(_LicenseRepositorySerializationHelper)
14111411
@serializable.xml_sequence(12)
14121412
def licenses(self) -> LicenseRepository:
14131413
"""

cyclonedx/model/contact.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from .._internal.compare import ComparableTuple as _ComparableTuple
2626
from ..exception.model import NoPropertiesProvidedException
2727
from ..schema.schema import SchemaVersion1Dot6
28-
from ..serialization import BomRefHelper
2928
from . import XsUri
3029
from .bom_ref import BomRef
3130

@@ -60,7 +59,7 @@ def __init__(
6059

6160
@property
6261
@serializable.json_name('bom-ref')
63-
@serializable.type_mapping(BomRefHelper)
62+
@serializable.type_mapping(BomRef)
6463
@serializable.xml_attribute()
6564
@serializable.xml_name('bom-ref')
6665
def bom_ref(self) -> Optional[BomRef]:
@@ -194,7 +193,7 @@ class OrganizationalContact:
194193
within a CycloneDX BOM document.
195194
196195
.. note::
197-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.4/xml/#type_organizationalContact
196+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/xml/#type_organizationalContact
198197
"""
199198

200199
def __init__(
@@ -287,7 +286,7 @@ class OrganizationalEntity:
287286
within a CycloneDX BOM document.
288287
289288
.. note::
290-
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.4/xml/#type_organizationalEntity
289+
See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.6/xml/#type_organizationalEntity
291290
"""
292291

293292
def __init__(

cyclonedx/model/crypto.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
from .._internal.compare import ComparableTuple as _ComparableTuple
3636
from ..exception.model import InvalidNistQuantumSecurityLevelException, InvalidRelatedCryptoMaterialSizeException
3737
from ..schema.schema import SchemaVersion1Dot6
38-
from ..serialization import BomRefHelper
3938
from .bom_ref import BomRef
4039

4140

@@ -606,7 +605,7 @@ def not_valid_after(self, not_valid_after: Optional[datetime]) -> None:
606605
self._not_valid_after = not_valid_after
607606

608607
@property
609-
@serializable.type_mapping(BomRefHelper)
608+
@serializable.type_mapping(BomRef)
610609
@serializable.xml_sequence(50)
611610
def signature_algorithm_ref(self) -> Optional[BomRef]:
612611
"""
@@ -622,7 +621,7 @@ def signature_algorithm_ref(self, signature_algorithm_ref: Optional[BomRef]) ->
622621
self._signature_algorithm_ref = signature_algorithm_ref
623622

624623
@property
625-
@serializable.type_mapping(BomRefHelper)
624+
@serializable.type_mapping(BomRef)
626625
@serializable.xml_sequence(60)
627626
def subject_public_key_ref(self) -> Optional[BomRef]:
628627
"""
@@ -775,7 +774,7 @@ def mechanism(self, mechanism: Optional[str]) -> None:
775774
self._mechanism = mechanism
776775

777776
@property
778-
@serializable.type_mapping(BomRefHelper)
777+
@serializable.type_mapping(BomRef)
779778
@serializable.xml_sequence(20)
780779
def algorithm_ref(self) -> Optional[BomRef]:
781780
"""
@@ -888,7 +887,7 @@ def state(self, state: Optional[RelatedCryptoMaterialState]) -> None:
888887
self._state = state
889888

890889
@property
891-
@serializable.type_mapping(BomRefHelper)
890+
@serializable.type_mapping(BomRef)
892891
@serializable.xml_sequence(40)
893892
def algorithm_ref(self) -> Optional[BomRef]:
894893
"""

cyclonedx/model/definition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ def __repr__(self) -> str:
448448

449449
@property
450450
@serializable.json_name('bom-ref')
451-
@serializable.type_mapping(BomRefHelper)
451+
@serializable.type_mapping(BomRef)
452452
@serializable.xml_attribute()
453453
@serializable.xml_name('bom-ref')
454454
def bom_ref(self) -> BomRef:

0 commit comments

Comments
 (0)