CycloneDX / CycloneDX/cyclonedx-core-java

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

Aperta
#565 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
120
Fork
90
Merge medio
12h 43m
PR unite (30g)
18

Descrizione

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/bar@1.0.0?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/bar@1.0.0?type=jar",
"bom-ref": "pkg:maven/com.foo/bar@1.0.0?type=jar",
"type": "library",
"group": "com.foo",
"version": "1.0.0"
},
{
"name": "foo",
"purl": "pkg:maven/com.bar/foo@1.0.0?type=jar",
"bom-ref": "pkg:maven/com.bar/foo@1.0.0?type=jar",
"type": "library",
"group": "com.bar",
"version": "1.0.0"
}
],
"dependencies": [
{
"ref": "pkg:maven/com.foo/bar@1.0.0?type=jar",
"provides": [
"pkg:maven/com.bar/foo@1.0.0?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!

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with org.cyclonedx.model.Dependency and the JsonParser.parse(File) entry point, then compare the model mapping with the CycloneDX 1.6 dependencies specification. Verify that parsing the provided JSON preserves the provides array on the returned org.cyclonedx.model.Bom.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
backend-api-design
Tipo di issue
Funzionalità
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.