-
-
Notifications
You must be signed in to change notification settings - Fork 68
feat: support multi license mix #582
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9f5b308
feat: licenses allow mix of multiple SPDX expressions AND/OR multiple…
jkowalleck 4abbe2f
tests
jkowalleck 3f3873e
Merge branch '1.7-dev' into feat/licenses-multi-mix-all
jkowalleck f5aa93e
Merge branch '1.7-dev' into feat/licenses-multi-mix-all
jkowalleck bc3dda0
Merge branch '1.7-dev' into feat/licenses-multi-mix-all
jkowalleck 5462e66
tests: add latest features to test cases
jkowalleck 32b73df
tests: add latest features to test cases
jkowalleck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
tools/src/test/resources/1.6/invalid-license-declared-concluded-mix-1.6.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json", | ||
"bomFormat": "CycloneDX", | ||
"specVersion": "1.6", | ||
"serialNumber": "urn:uuid:df628836-6b9b-41c9-a724-b44743c54d42", | ||
"version": 1, | ||
"metadata": { | ||
"lifecycles": [{"phase": "design"}] | ||
}, | ||
"components": [ | ||
{ | ||
"type": "library", | ||
"group": "com.example", | ||
"name": "situation-A", | ||
"version": "1", | ||
"description": "Multiple licenses: declared ids/names, and a concluded expression", | ||
"licenses": [ | ||
{ | ||
"license": { | ||
"id": "MIT", | ||
"acknowledgement": "declared" | ||
} | ||
}, | ||
{ | ||
"license": { | ||
"id": "PostgreSQL", | ||
"acknowledgement": "declared" | ||
} | ||
}, | ||
{ | ||
"license": { | ||
"name": "Apache Software License", | ||
"acknowledgement": "declared" | ||
} | ||
}, | ||
{ | ||
"expression": "(MIT OR PostgreSQL OR Apache-2.0)", | ||
"acknowledgement": "concluded" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "library", | ||
"group": "com.example", | ||
"name": "situation-B", | ||
"version": "1", | ||
"description": "Multiple license expressions: one declared, one concluded", | ||
"licenses": [ | ||
{ | ||
"expression": "MIT OR (GPL-3.0 OR GPL-2.0)", | ||
"acknowledgement": "declared" | ||
}, | ||
{ | ||
"expression": "(GPL-3.0-only AND LGPL-2.0-only)", | ||
"acknowledgement": "concluded" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "library", | ||
"group": "com.example", | ||
"name": "situation-C", | ||
"version": "1", | ||
"description": "Multiple license: one declared expression, one concluded id", | ||
"licenses": [ | ||
{ | ||
"expression": "GPL-3.0-or-later OR GPL-2.0", | ||
"acknowledgement": "declared" | ||
}, | ||
{ | ||
"license": { | ||
"id": "GPL-3.0-only", | ||
"acknowledgement": "concluded" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
46 changes: 46 additions & 0 deletions
46
tools/src/test/resources/1.6/invalid-license-declared-concluded-mix-1.6.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0"?> | ||
<bom xmlns="http://cyclonedx.org/schema/bom/1.6" | ||
serialNumber="urn:uuid:df628836-6b9b-41c9-a724-b44743c54d42" | ||
> | ||
<!-- | ||
All license posture in here is for show-case ony. | ||
This is not a real law-case! | ||
--> | ||
<metadata> | ||
<lifecycles><lifecycle><phase>design</phase></lifecycle></lifecycles> | ||
</metadata> | ||
<components> | ||
<component type="library"> | ||
<group>com.example</group> | ||
<name>situation-A</name> | ||
<version>1</version> | ||
<description>Multiple licenses: declared ids/names, and a concluded expression</description> | ||
<licenses> | ||
<license acknowledgement="declared"><id>MIT</id></license> | ||
<license acknowledgement="declared"><id>PostgreSQL</id></license> | ||
<license acknowledgement="declared"><name>Apache Software License</name></license> | ||
<expression acknowledgement="concluded">(MIT OR PostgreSQL OR Apache-2.0)</expression> | ||
</licenses> | ||
</component> | ||
<component type="library"> | ||
<group>com.example</group> | ||
<name>situation-B</name> | ||
<version>1</version> | ||
<description>Multiple license expressions: one declared, one concluded</description> | ||
<licenses> | ||
<expression acknowledgement="declared">MIT OR (GPL-3.0 OR GPL-2.0)</expression> | ||
<expression acknowledgement="concluded">(GPL-3.0-only AND LGPL-2.0-only)</expression> | ||
</licenses> | ||
</component> | ||
<component type="library"> | ||
<group>com.example</group> | ||
<name>situation-C</name> | ||
<version>1</version> | ||
<description>Multiple license: one declared expression, one concluded id</description> | ||
<licenses> | ||
<expression acknowledgement="declared">GPL-3.0-or-later OR GPL-2.0</expression> | ||
<license acknowledgement="concluded"><id>GPL-3.0-only</id></license> | ||
</licenses> | ||
</component> | ||
</components> | ||
</bom> |
45 changes: 45 additions & 0 deletions
45
tools/src/test/resources/1.7/valid-license-choice-1.7.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json", | ||
"bomFormat": "CycloneDX", | ||
"specVersion": "1.7", | ||
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79", | ||
"version": 1, | ||
"components": [ | ||
{ | ||
"type": "application", | ||
"publisher": "Acme Inc", | ||
"group": "com.acme", | ||
"name": "tomcat-catalina", | ||
"version": "9.0.14", | ||
"description": "Modified version of Apache Catalina", | ||
"scope": "required", | ||
"licenses": [ | ||
{ | ||
"license": { | ||
"id": "Apache-2.0" | ||
} | ||
}, | ||
{ | ||
"expression": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0" | ||
}, | ||
{ | ||
"license": { | ||
"name": "My Own License", | ||
"text": { | ||
"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." | ||
} | ||
} | ||
}, | ||
{ | ||
"expression": "LicenseRef-MIT-Style-2", | ||
"expressionDetails": [ | ||
{ | ||
"licenseIdentifier": "LicenseRef-MIT-Style-2", | ||
"url": "https://example.com/license" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
43 changes: 43 additions & 0 deletions
43
tools/src/test/resources/1.7/valid-license-choice-1.7.textproto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# proto-file: schema/bom-1.7.proto | ||
# proto-message: Bom | ||
|
||
# All license posture in here is for show-case ony. | ||
# This is not a real law-case! | ||
|
||
spec_version: "1.7" | ||
serial_number: "urn:uuid:b1ef52c6-7cd8-43d5-9e42-5e69044bbe9e" | ||
version: 1 | ||
components { | ||
type: CLASSIFICATION_APPLICATION | ||
publisher: "Acme Inc" | ||
group: "com.acme" | ||
name: "tomcat-catalina" | ||
version: "9.0.14" | ||
description: "Modified version of Apache Catalina" | ||
scope: SCOPE_REQUIRED | ||
licenses { | ||
license { | ||
id: "Apache-2.0" | ||
} | ||
} | ||
licenses { | ||
expression: "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0" | ||
} | ||
licenses { | ||
license { | ||
name: "My Own License" | ||
text { | ||
value: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." | ||
} | ||
} | ||
} | ||
licenses { | ||
expression_detailed { | ||
expression: "LicenseRef-MIT-Style-2" | ||
details { | ||
license_identifier: "LicenseRef-MIT-Style-2" | ||
url: "https://example.com/license" | ||
} | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
<?xml version="1.0"?> | ||
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7"> | ||
<bom xmlns="http://cyclonedx.org/schema/bom/1.7" | ||
serialNumber="urn:uuid:b1ef52c6-7cd8-43d5-9e42-5e69044bbe9e" | ||
version="1" | ||
> | ||
<components> | ||
<component type="application"> | ||
<publisher>Acme Inc</publisher> | ||
|
@@ -8,17 +11,20 @@ | |
<version>9.0.14</version> | ||
<description>Modified version of Apache Catalina</description> | ||
<scope>required</scope> | ||
<hashes> | ||
<hash alg="MD5">3942447fac867ae5cdb3229b658f4d48</hash> | ||
<hash alg="SHA-1">e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a</hash> | ||
<hash alg="SHA-256">f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b</hash> | ||
<hash alg="SHA-512">e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282</hash> | ||
</hashes> | ||
<licenses> | ||
<license> | ||
<id>Apache-2.0</id> | ||
</license> | ||
<expression>EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0</expression> | ||
<license> | ||
<name>My Own License</name> | ||
<text><![CDATA[Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.]]></text> | ||
</license> | ||
<expression-detailed expression="LicenseRef-MIT-Style-2"> | ||
<details license-identifier="LicenseRef-MIT-Style-2"> | ||
<url>https://example.com/license</url> | ||
</details> | ||
</expression-detailed> | ||
</licenses> | ||
<purl>pkg:maven/com.acme/[email protected]?packaging=jar</purl> | ||
</component> | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pombredanne proposed to go with
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont see how this proposal is a user-friendly solution.
if my intake is a list of declared SPDX licenses, and i am planning to add a single SPDX Expression for the concluded license, then I would have to migrate all the existing structures from SPDX licenses to SPDX license expressions.
INTAKE
OUTPUT as proposed - causing migration
instead, i would prefer to not migrate any structures and still be able to add new data.
this is especially important when evidence collection happens - i want to be free with the types i record, i dont want ot be forces to use only one or the other.