|
30 | 30 | NoPropertiesProvidedException,
|
31 | 31 | UnknownHashTypeException,
|
32 | 32 | )
|
33 |
| -from ..schema.schema import SchemaVersion1Dot3, SchemaVersion1Dot4 |
| 33 | +from ..schema.schema import SchemaVersion1Dot3, SchemaVersion1Dot4, SchemaVersion1Dot5 |
34 | 34 |
|
35 | 35 | """
|
36 | 36 | Uniform set of models to represent objects within a CycloneDX software bill-of-materials.
|
@@ -113,6 +113,9 @@ class DataClassification:
|
113 | 113 | """
|
114 | 114 | This is our internal representation of the `dataClassificationType` complex type within the CycloneDX standard.
|
115 | 115 |
|
| 116 | + DataClassification might be deprecated since CycloneDX 1.5, but it is not deprecated in this library. |
| 117 | + In fact, this library will try to provide a compatibility layer if needed. |
| 118 | +
|
116 | 119 | .. note::
|
117 | 120 | See the CycloneDX Schema for dataClassificationType:
|
118 | 121 | https://cyclonedx.org/docs/1.4/xml/#type_dataClassificationType
|
@@ -275,17 +278,17 @@ class HashAlgorithm(str, Enum):
|
275 | 278 | See the CycloneDX Schema: https://cyclonedx.org/docs/1.3/#type_hashAlg
|
276 | 279 | """
|
277 | 280 |
|
278 |
| - BLAKE2B_256 = 'BLAKE2b-256' |
279 |
| - BLAKE2B_384 = 'BLAKE2b-384' |
280 |
| - BLAKE2B_512 = 'BLAKE2b-512' |
281 |
| - BLAKE3 = 'BLAKE3' |
| 281 | + BLAKE2B_256 = 'BLAKE2b-256' # Only supported in >= 1.2 |
| 282 | + BLAKE2B_384 = 'BLAKE2b-384' # Only supported in >= 1.2 |
| 283 | + BLAKE2B_512 = 'BLAKE2b-512' # Only supported in >= 1.2 |
| 284 | + BLAKE3 = 'BLAKE3' # Only supported in >= 1.2 |
282 | 285 | MD5 = 'MD5'
|
283 | 286 | SHA_1 = 'SHA-1'
|
284 | 287 | SHA_256 = 'SHA-256'
|
285 | 288 | SHA_384 = 'SHA-384'
|
286 | 289 | SHA_512 = 'SHA-512'
|
287 | 290 | SHA3_256 = 'SHA3-256'
|
288 |
| - SHA3_384 = 'SHA3-384' |
| 291 | + SHA3_384 = 'SHA3-384' # Only supported in >= 1.2 |
289 | 292 | SHA3_512 = 'SHA3-512'
|
290 | 293 |
|
291 | 294 |
|
@@ -395,22 +398,45 @@ class ExternalReferenceType(str, Enum):
|
395 | 398 | See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.3/#type_externalReferenceType
|
396 | 399 | """
|
397 | 400 |
|
| 401 | + ADVERSARY_MODEL = 'adversary-model' # Only supported in >= 1.5 |
398 | 402 | ADVISORIES = 'advisories'
|
| 403 | + ATTESTATION = 'attestation' # Only supported in >= 1.5 |
399 | 404 | BOM = 'bom'
|
400 | 405 | BUILD_META = 'build-meta'
|
401 | 406 | BUILD_SYSTEM = 'build-system'
|
| 407 | + CERTIFICATION_REPORT = 'certification-report' # Only supported in >= 1.5 |
402 | 408 | CHAT = 'chat'
|
| 409 | + CODIFIED_INFRASTRUCTURE = 'codified-infrastructure' # Only supported in >= 1.5 |
| 410 | + COMPONENT_ANALYSIS_REPORT = 'component-analysis-report' # Only supported in >= 1.5 |
| 411 | + CONFIGURATION = 'configuration' # Only supported in >= 1.5 |
403 | 412 | DISTRIBUTION = 'distribution'
|
| 413 | + DISTRIBUTION_INTAKE = 'distribution-intake' # Only supported in >= 1.5 |
404 | 414 | DOCUMENTATION = 'documentation'
|
| 415 | + DYNAMIC_ANALYSIS_REPORT = 'dynamic-analysis-report' # Only supported in >= 1.5 |
| 416 | + EVIDENCE = 'evidence' # Only supported in >= 1.5 |
| 417 | + EXPLOITABILITY_STATEMENT = 'exploitability-statement' # Only supported in >= 1.5 |
| 418 | + FORMULATION = 'formulation' # Only supported in >= 1.5 |
405 | 419 | ISSUE_TRACKER = 'issue-tracker'
|
406 | 420 | LICENSE = 'license'
|
| 421 | + LOG = 'log' # Only supported in >= 1.5 |
407 | 422 | MAILING_LIST = 'mailing-list'
|
| 423 | + MATURITY_REPORT = 'maturity-report' # Only supported in >= 1.5 |
| 424 | + MODEL_CARD = 'model-card' # Only supported in >= 1.5 |
408 | 425 | OTHER = 'other'
|
| 426 | + PENTEST_REPORT = 'pentest-report' # Only supported in >= 1.5 |
| 427 | + POAM = 'poam' # Only supported in >= 1.5 |
| 428 | + QUALITY_METRICS = 'quality-metrics' # Only supported in >= 1.5 |
409 | 429 | RELEASE_NOTES = 'release-notes' # Only supported in >= 1.4
|
| 430 | + RISK_ASSESSMENT = 'risk-assessment' # Only supported in >= 1.5 |
| 431 | + RUNTIME_ANALYSIS_REPORT = 'runtime-analysis-report' # Only supported in >= 1.5 |
| 432 | + SECURITY_CONTACT = 'security-contact' # Only supported in >= 1.5 |
| 433 | + STATIC_ANALYSIS_REPORT = 'static-analysis-report' # Only supported in >= 1.5 |
410 | 434 | SOCIAL = 'social'
|
411 | 435 | SCM = 'vcs'
|
412 | 436 | SUPPORT = 'support'
|
| 437 | + THREAT_MODEL = 'threat-model' # Only supported in >= 1.5 |
413 | 438 | VCS = 'vcs'
|
| 439 | + VULNERABILITY_ASSERTION = 'vulnerability-assertion' # Only supported in >= 1.5 |
414 | 440 | WEBSITE = 'website'
|
415 | 441 |
|
416 | 442 |
|
@@ -541,6 +567,7 @@ def type(self, type: ExternalReferenceType) -> None:
|
541 | 567 | @property
|
542 | 568 | @serializable.view(SchemaVersion1Dot3)
|
543 | 569 | @serializable.view(SchemaVersion1Dot4)
|
| 570 | + @serializable.view(SchemaVersion1Dot5) |
544 | 571 | @serializable.xml_array(serializable.XmlArraySerializationType.NESTED, 'hash')
|
545 | 572 | def hashes(self) -> 'SortedSet[HashType]':
|
546 | 573 | """
|
@@ -974,7 +1001,10 @@ class Tool:
|
974 | 1001 | """
|
975 | 1002 | This is our internal representation of the `toolType` complex type within the CycloneDX standard.
|
976 | 1003 |
|
977 |
| - Tool(s) are the things used in the creation of the BOM. |
| 1004 | + Tool(s) are the things used in the creation of the CycloneDX document. |
| 1005 | +
|
| 1006 | + Tool might be deprecated since CycloneDX 1.5, but it is not deprecated i this library. |
| 1007 | + In fact, this library will try to provide a compatibility layer if needed. |
978 | 1008 |
|
979 | 1009 | .. note::
|
980 | 1010 | See the CycloneDX Schema for toolType: https://cyclonedx.org/docs/1.3/#type_toolType
|
@@ -1052,6 +1082,7 @@ def hashes(self, hashes: Iterable[HashType]) -> None:
|
1052 | 1082 |
|
1053 | 1083 | @property
|
1054 | 1084 | @serializable.view(SchemaVersion1Dot4)
|
| 1085 | + @serializable.view(SchemaVersion1Dot5) |
1055 | 1086 | @serializable.xml_array(serializable.XmlArraySerializationType.NESTED, 'reference')
|
1056 | 1087 | @serializable.xml_sequence(5)
|
1057 | 1088 | def external_references(self) -> 'SortedSet[ExternalReference]':
|
|
0 commit comments