Skip to content

Support for CycloneDX schema version 1.4 #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 59 commits into from
Jan 13, 2022
Merged

Conversation

madpah
Copy link
Collaborator

@madpah madpah commented Dec 22, 2021

Work is in progress.

- Updated spdx.xsd to latest in 1.4-draft
- Corrected 1.0 output as `bom.component.modified` is REQUIRED is 1.0

Signed-off-by: Paul Horton <[email protected]>
- New `XsUri` object to enable some validation for strings that are expected to conform to xs:anyURI type
- Bunch of tests covering new models
- New exceptions that will be thrown if invalid data is passed into model classes

Signed-off-by: Paul Horton <[email protected]>
Signed-off-by: Paul Horton <[email protected]>
…th fixes as required

- Added support for optional `component.version` in 1.4 (for XML)

Signed-off-by: Paul Horton <[email protected]>
Signed-off-by: Paul Horton <[email protected]>
@madpah
Copy link
Collaborator Author

madpah commented Jan 7, 2022

This PR is now considered stable and will be merged to create release 1.0.0 next week (week commencing 10th Jan 2022), subject to CycloneDX Specification 1.4 being released on https://cyclonedx.org.

Copy link
Member

@jkowalleck jkowalleck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

part of review done.

main issues i see:

  • purl handling is pretty error prone. if there waas an actual need to generate a PURL from the model, then there should be a factory flass that generates a purl from the model.
    putting a oneliner in the component-model is not enough.
    there a lot of details when it comes to generate a purl - the PURL-spec is huge and has lots of details the model does not even have properties for. this is why the model has these nasty __purl_... properties.
    i would argue that the purl implementation here is in a proper state.

EDIT / PS :
got all sorted out. nothing to do anymore.

@madpah
Copy link
Collaborator Author

madpah commented Jan 9, 2022

part of review done.

main issues i see:

  • purl handling is pretty error prone. if there waas an actual need to generate a PURL from the model, then there should be a factory flass that generates a purl from the model.
    putting a oneliner in the component-model is not enough.
    there a lot of details when it comes to generate a purl - the PURL-spec is huge and has lots of details the model does not even have properties for. this is why the model has these nasty __purl_... properties.
    i would argue that the purl implementation here is in a proper state.

Agree that purl is now message and should be simplified.

However, I recall now why I went back to where it's at: PackageURL is a NamedTuple and JSON serialisation therefore automatically serialises this class to an array - it cannot be overridden as tuple types are coded in the base JSON Serialiser to become Arrays.

Thoughts?

BREAKING CHANGE: Concrete parsers relocated to `cyclonedx-python`.

* Exception was incorrectly in parser and should have been in model

Signed-off-by: Paul Horton <[email protected]>

* resolved issues in Unit Tests

Signed-off-by: Paul Horton <[email protected]>
Signed-off-by: Paul Horton <[email protected]>
* DOCS: anaconda-release

Signed-off-by: Jan Kowalleck <[email protected]>

* Corrected links

Co-authored-by: Paul Horton <[email protected]>
@madpah madpah merged commit 7fb6da9 into main Jan 13, 2022
madpah added a commit that referenced this pull request Jan 13, 2022
@madpah madpah deleted the feat/schema-version-1.4 branch January 13, 2022 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request schema 1.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants