Question about how cdxgen resolves licenses #2159
evgovch-tf
started this conversation in
General
Replies: 1 comment
-
Sounds like a good improvement. Could you kindly share a PR to also include the resolved license ids? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
According to CycloneDX 1.5 and 1.6 JSON format, "licenses" field must be ONE (exclusive 'or') of the two:
A list of SPDX and/or named licenses:
or
ONE SPDX license expression:
I saw, cdxgen tries to comply to this format as follows.
- [step 3.a] If there are any SPDX license expressions resolved: combine them to one compound license expression ("license_exp1 OR license_exp2 OR..."). All resolved license IDs/names are discarded.
- [step 3.b] If there are no SPDX license expressions resolved, make a list of "license" elements as described in CycloneDX format.
I'm curious why cdxgen discards license IDs/names when license expression is detected. This question is inspired by the following example.
docutils 0.19 has the following license info on PyPI (pypi.org/pypi/docutils/0.19/json):
"License :: OSI Approved :: BSD License","License :: OSI Approved :: GNU General Public License (GPL)","License :: OSI Approved :: Python Software Foundation License","License :: Public Domain"
and
"license":"public domain, Python, 2-Clause BSD, GPL 3 (see COPYING.txt)"
[step 1] cdxgen detects these license candidates and generates the list

[step 2] cdxgen resolves this list of license candidates to the list of license IDs/names and license expressions
[step 3.a] There are license expressions. So, cdxgen combines them into the following result in the generated SBOM. License IDs 0BSD, GPL-1.0-only and PSF-2.0 are not used.
Beta Was this translation helpful? Give feedback.
All reactions