Skip to content

Migrate SPDX-JSON relationships to SBOM model#634

Merged
wagoodman merged 14 commits intomainfrom
migrate-spdx-json-to-new-relationships
Nov 23, 2021
Merged

Migrate SPDX-JSON relationships to SBOM model#634
wagoodman merged 14 commits intomainfrom
migrate-spdx-json-to-new-relationships

Conversation

@wagoodman
Copy link
Copy Markdown
Contributor

@wagoodman wagoodman commented Nov 17, 2021

This is a follow up to #607 and #623
Closes #556

Changes made:

  • Removes the creation of relationships in the spdx22json format encoder and moves file-ownership relationship creation back to the main Catalog function.
  • Adds a new sbom.AllCoordinates that returns a slice of all coordinates referenced throughout all SBOM artifacts and relationships. This is needed to guarantee inclusion of all referenced files as nodes in the SBOM.
  • The power-user JSON document data structure has been replaced with the syftjson format model and the poweruser.Presenter has been deleted (as well as the remainder of internal/presenters 🎉 🌮 )
  • Combines file classifications, metadata, and contents fields for a location into a single entry. For this reason the fileMetadata, fileClassifications, and fileContents power-user JSON fields have been removed and replaced with a single files section. This requires bumping the JSON schema version from 1 to 2 .
  • Adds the application configuration to the output of the packages output (for syftjson format). This now matches the same behavior as power-user.

Notes:

Questions:

  • a future PR could implement syft1json and syft2json formats for backwards compatibility, though this is not planned at this time. Should we do this before bumping to schema version 2?
  • What should we do in cases where a package manager claims ownership of a file that does not exist (relative to the source.FileResolver)? Should we log and continue (what is implemented now)? Or make note of this in the SBOM?

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prefer artifact relationships over package relationships

2 participants