Skip to content
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

org.cyclonedx.model.Dependency is missing "provides" mapping according to CycloneDX 1.6 spec #565

Open
vibe13 opened this issue Dec 5, 2024 · 0 comments

Comments

@vibe13
Copy link

vibe13 commented Dec 5, 2024

Hi,
looking at the CycloneDX 1.6 spec (https://cyclonedx.org/docs/1.6/json/#dependencies_items_provides), the Dependency object should be able to include a provides Array of Strings (bom-refs).
The current implementation of org.cyclonedx.model.Dependency is missing such mapping, therefore if I parse a SBOM file like:

{
  "version": 1,
  "specVersion": "1.6",
  "serialNumber": "urn:uuid:fbe21a61-ba0f-3008-bc9f-fd4f0ac1aac3",
  "metadata": {
    "component": {
      "name": "bar",
      "purl": "pkg:maven/com.foo/[email protected]?type=jar",
      "type": "library",
      "group": "com.foo",
      "version": "1.0.0"
    },
    "timestamp": "2024-12-05T09:40:16Z"
  },
  "bomFormat": "CycloneDX",
  "components": [
    {
      "name": "bar",
      "purl": "pkg:maven/com.foo/[email protected]?type=jar",
      "bom-ref": "pkg:maven/com.foo/[email protected]?type=jar",
      "type": "library",
      "group": "com.foo",
      "version": "1.0.0"
    },
    {
      "name": "foo",
      "purl": "pkg:maven/com.bar/[email protected]?type=jar",
      "bom-ref": "pkg:maven/com.bar/[email protected]?type=jar",
      "type": "library",
      "group": "com.bar",
      "version": "1.0.0"
    }
  ],
  "dependencies": [
    {
      "ref": "pkg:maven/com.foo/[email protected]?type=jar",
      "provides": [
        "pkg:maven/com.bar/[email protected]?type=jar"
      ]
    }
  ]
}

using the org.cyclonedx.parsers.JsonParser.parse(File) method, the org.cyclonedx.model.Bom is returned without any issue, but it's missing the provides array.

Would it be possible to update the org.cyclonedx.model.Dependency mapping according to 1.6 spec?

Thanks!

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

No branches or pull requests

1 participant