Conversation
|
Hey @mr-zepol , |
|
I have provided a pr for this change. |
|
@nscuro is this something that only you can merge, or is that just the default assignment? It would be nice to unblock DependencyTrack/dependency-track#5818 |
|
I would also love to see this merged soon - CDX 1.7 in DependencyTrack is a pretty sharp need for me. If there's anything I can do to support or help, I'd be happy to pitch in. |
CycloneDX 1.7 coverage auditAudited against: CycloneDX 1.7 (ECMA-424 2nd Edition, December 2025), JSON Schema and XSD published by CycloneDX/specification using the CycloneDX Skill for Claude Code (Opus 4.7 used). The PR description acknowledges that test failures will be addressed in follow-up PRs because some serializers still need to be wired up. This audit therefore focuses on (1) whether the bundled schemas match the published 1.7 spec, (2) whether the Java model classes faithfully model the 1.7 schema, and (3) gaps that will block conformant 1.7 round-tripping regardless of serializer work. TL;DRThe bundled JSON Schema, XSD, and protobuf are essentially identical to the upstream CycloneDX 1.7 spec (only three pre-existing doc-only differences). The Java model has good coverage of the headline 1.7 features (citations, patents, distribution constraints, version range, isExternal, license restructuring), but contains several conformance bugs that will produce non-validating output or fail to deserialize the PR's own test fixtures. Most are addressable with focused, mechanical edits before merging the next PR in this series. Severity legend. P0 = blocks 1.7 conformance; P1 = correctness bug visible to users; P2 = polish or maintenance.
Findings in detail1. (P0)
|
| Feature | Schema bundled | Java model | Notes |
|---|---|---|---|
Top-level citations |
yes | partial | Missing signature property (finding 6) |
metadata.distributionConstraints + tlpClassification |
yes | yes | Complete; matches schema and XSD |
definitions.patents (mixed patent + patentFamily) |
yes | broken | Split into two fields (finding 2) |
component.patentAssertions / service.patentAssertions |
yes | partial | Asserter cannot be a string ref (finding 3) |
component.versionRange |
yes | yes | @VersionFilter(Version.VERSION_17) correctly applied |
component.isExternal |
yes | yes | Mapped as XML attribute, matching XSD |
1.7 licenseChoice array structure |
yes | broken | Old oneOf model retained (finding 5) |
Cryptography Registry (algorithmFamily, ellipticCurve) |
partial | no | Subschema not bundled (finding 1); fields not on model (finding 4) |
relatedCryptographicAssets on crypto property objects |
yes | no | Missing on all four crypto property classes (finding 4) |
cipherSuite.tlsGroups / tlsSignatureSchemes |
yes | yes | Implemented |
External reference types patent, patent-family, patent-assertion, citation |
yes | yes | model_card regression (finding 7) |
Streebog-256 / Streebog-512 hash algorithms |
yes (via schema) | n/a | The Hash enum is enforced by schema; no Java enum change needed |
| Formulation scope extension | yes | yes (no model change required) | Existing Formula/Workflow/Task types are still valid |
BOM Format/Version wiring (Version.VERSION_17, NS_BOM_17) |
n/a | yes | Version.fromVersionString("1.7") returns VERSION_17; getJsonSchema/getXmlSchema route to the new resources |
Recommended pre-merge actions
- (P0) Bundle
cryptography-defs.schema.jsonand register it inCycloneDxSchema.offlineMappings. - (P0) Re-shape
Definitionto a single polymorphicpatentscollection, with a deserializer that disambiguatespatentfrompatentFamily. - (P0) Add a third (
refLinkType) branch to the asserter modelling forPatentAssertion(either by wideningOrganizationalChoiceor introducing a new asserter type). - (P0) Add the missing 1.7 cryptography fields (
algorithmFamily,ellipticCurve,relatedCryptographicAssets) toAlgorithmProperties,CertificateProperties,RelatedCryptoMaterialProperties,ProtocolProperties; deprecatecurveandcipherSuites. - (P0) Re-shape
LicenseChoiceas a flat array of mixed license/expression items; deprecate the 1.6-style mutually-exclusive setters. - (P1) Add
signaturetoCitationand updateequals/hashCode/@JsonPropertyOrder. - (P1) Fix the
MODEL_CARD@JsonPropertyvalue tomodel-card. - (P1) Fix
ExpressionDetail.licenseIdentifierto serialise as the XML attributelicense-identifier; remove the wrapper aroundexpressionDetailsso it serialises as repeating<details>siblings. - (P2) Resync
bom-1.7.schema.json,bom-1.7.xsd, andbom-1.7.protowith the upstream spec to pick up the three doc-only fixes. - (P2) Delete the unused
Classifications.java. - (P2) Round out
@JsonPropertyOrderand the relevantequals/hashCodemethods for new 1.7 fields.
Verification notes
- The PR's bundled
bom-1.7.xsdvalidates the JSON-paired XML test fixtures cleanly underxmllintonce an XML catalog provides thehttp://cyclonedx.org/schema/spdximport; representative fixtures checked:valid-bom-1.7.xml,valid-citations-1.7.xml,valid-patent-1.7.xml,valid-cryptography-full-1.7.xml. - The PR's bundled
bom-1.7.schema.jsonvalidates the JSON test fixtures under Pythonjsonschema(Draft-07) oncecryptography-defs.schema.json,spdx.schema.json, andjsf-0.82.schema.jsonare supplied to theRefResolver. Representative fixtures checked:valid-bom-1.7.json,valid-citations-1.7.json,valid-patent-1.7.json,valid-cryptography-full-1.7.json,valid-cryptography-certificate-1.7.json,valid-license-expression-with-text-1.7.json,valid-license-declared-concluded-mix-1.7.json,valid-component-external-with-versionRange.json,valid-metadata-distribution-1.7.json,valid-saasbom-1.7.json— all pass. - The corresponding
invalid-*.jsonfixtures are correctly rejected for the expected reasons (citations xor pointers/expressions and theattributedTo/processrequirement, version vs versionRange exclusivity, andadditionalPropertiesonmetadata).
So the schemas themselves are conformant. The defects are all on the Java-model side of the line.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 690 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
* Support for license Details * Fix tests
* Fix License issue serialization * Add Ike2 Proper Support * Add headers
Add polymorphic patent support and make serialization version-aware. Introduces PatentItem model plus PatentItemDeserializer, PatentsDeserializer and PatentAssertionDeserializer/Serializer to handle mixed Patent/PatentFamily entries and XML/JSON differences; updates Definition to use the polymorphic list and provides helpers for legacy access. Refactors many serializers (EnvironmentVars, InputType, ExternalReference, Hash, IkeV2Transform, etc.) and CustomSerializerModifier to honor @VersionFilter and a Version parameter, filters enum/field serialization by target BOM version, and normalizes date formatting. Also enhances OrganizationalChoice deserialization, adds properties handling to ExternalReferencesDeserializer, and small model tweaks (Component, Composition, Service, LicenseItem, PriorityApplication, FormulationCommon, Level) to align with newer schema versions.
* Use 'model-card' for MODEL_CARD external reference Update ExternalReference.MODEL_CARD to use kebab-case: change @JsonProperty and enum value from "model_card" to "model-card". This aligns the serialized name with the expected CycloneDX 1.5 naming while retaining the VersionFilter(Version.VERSION_15) annotation. * Adjust Citation & Component; delete Classifications Fix serialization and equality logic in model classes: change Citation @JsonPropertyOrder to use "bom-ref" to match the XML attribute, remove the now-unused Classifications class, and update Component.equals()/hashCode() to include newly added fields (isExternal, versionRange, patentAssertions, tags) so equality and hashing account for them.
Introduce support for related cryptographic assets across crypto models and add a cryptography definitions schema. Changes include: - Add new RelatedCryptographicAsset model with type and ref, equals/hashCode. - Extend AlgorithmProperties, CertificateProperties, ProtocolProperties, and RelatedCryptoMaterialProperties to include List<RelatedCryptographicAsset> relatedCryptographicAssets with XML wrapper annotations, getters/setters, and include in equals/hashCode. - Annotate new fields with @VersionFilter(Version.VERSION_17) and add necessary imports. - Add cryptography-defs.schema.json resource containing algorithm family and elliptic curve metadata. - Register the new schema in CycloneDxSchema offlineMappings so it can be resolved at runtime. These changes enable expressing relationships between crypto objects and external cryptographic assets and provide a formal schema for algorithm/curve definitions.
Add comprehensive CycloneDX 1.7 cryptography unit tests for both JSON and XML generators (updates to BomJsonGeneratorTest and BomXmlGeneratorTest). Update schema verification to recognize -1.7 fixtures in JsonSchemaVerificationTest and XmlSchemaVerificationTest. Adjust AlgorithmProperties@JsonPropertyOrder to change the ordering of parameterSetIdentifier, curve, and ellipticCurve to match the 1.7 schema expectations.
This PR adds the new model classes, schema definition and test files for initial support for CDX 1.7 spec, this is to merge to one feature branch until implementation is done.
NOTE: Test are failing because some serializers need to be updated, this will done in different PRs