-
-
Notifications
You must be signed in to change notification settings - Fork 49
License validity check incompatible with CycloneDX 1.4 #747
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
Comments
Are you sure about that? <xs:complexType name="licenseChoiceType">
<xs:choice>
<xs:element name="license" type="bom:licenseType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="expression" type="xs:normalizedString" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>A valid SPDX license expression.
Refer to https://spdx.org/specifications for syntax requirements</xs:documentation>
</xs:annotation>
</xs:element>
</xs:choice>
</xs:complexType> Licenses is either a list of 0..n
What's the matter? I don't see any issue here. Anyway, this ticket is not the place to discuss the specification. please keep it to CycloneDX/specification#349 (comment) |
Hi Jan, OK, I agree that this place is not a discussion about the spec, but I want to answer to your question. Please let me show this with the JSON Schema. Here you see that the array definition has "moved".
So this means that with the definition of 1.4 it is totally fine a list with both license expressions with items that are either a "license" or "expression". |
please understand that CycloneDX is not a schema, it is a specification. This very python library intends to work with the specification. So, anyway, I read that you understood that your original request is solved - the implemented license validity check is compatible with CycloneDX 1.4. (please be aware of license-related upcoming changes in the spec, which will cause new interesting challenges in this very library.) |
OK, I just focus on the current implementation. We are both using the license-expression library from aboutcode-org (formerly nexB), but in a different way. The file The If the expression string is an SPDX simple expression string that can be found in the internal JSON file, that one is accepted as valid SPDX expression, e.g.
There is no way to initialize the cyclonedx library with a custom JSON datafile for license-expression. With this option in this it would be possible to manage If the given expression passed to |
I see. |
@Joerki , could you open another new ticket for that, so that we could discuss implications, expectations, (none-)use-cases and (out-of-)scopes, and testability? |
Hi guys,
In
cyclonedx/model/bom.py
, classBom
, methodvalidate
starting from there is a check that is NOT compatible with CycloneDX 1.4.It is applicable only for CycloneDX 1.5 and 1.6.
Up to 1.4 we have a list of all licenses, each item may have a license id/name or SPDX expression.
Starting with 1.5 we have a list of license id/name element OR a SINGLE SPDX expression.
A significant difference.
This is a true problem since with the definition of CycloneDX 1.5 there is a significant design fault in CycloneDX from my point of view, which makes it more or less impossiible to create components that both have simple/single and compound SPDX expressions (I recommend to read the SPDX annex chapters of their spec).
The only chance to not get messed up with 1.5 and above is to stick with 1.4.
But unfortunately, the check - which does not consider the CycloneDX version - makes it impossible to use this library. :(
The text was updated successfully, but these errors were encountered: