-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: licenses allow mix of multiple SPDX expressions AND/OR multiple…
… named/spdx licenses Signed-off-by: Jan Kowalleck <[email protected]>
- Loading branch information
1 parent
544db94
commit 9f5b308
Showing
8 changed files
with
343 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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> |
79 changes: 79 additions & 0 deletions
79
tools/src/test/resources/1.7/valid-license-declared-concluded-mix-1.7.json
This file contains 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.7.schema.json", | ||
"bomFormat": "CycloneDX", | ||
"specVersion": "1.7", | ||
"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" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
73 changes: 73 additions & 0 deletions
73
tools/src/test/resources/1.7/valid-license-declared-concluded-mix-1.7.textproto
This file contains 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,73 @@ | ||
# 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" | ||
version: 1 | ||
serial_number: "urn:uuid:df628836-6b9b-41c9-a724-b44743c54d42" | ||
metadata: { | ||
lifecycles { phase: LIFECYCLE_PHASE_DESIGN } | ||
} | ||
components { | ||
type: CLASSIFICATION_LIBRARY | ||
group: "com.example" | ||
name: "situation-A" | ||
version: "1" | ||
description: "Multiple licenses: declared ids/names, and a concluded expression" | ||
licenses { | ||
license { | ||
id: "MIT" | ||
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED | ||
} | ||
} | ||
licenses { | ||
license { | ||
id: "PostgreSQL" | ||
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED | ||
} | ||
} | ||
licenses { | ||
license { | ||
name: "Apache Software License" | ||
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED | ||
} | ||
} | ||
licenses { | ||
expression: "(MIT OR PostgreSQL OR Apache-2.0)" | ||
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_CONCLUDED | ||
} | ||
} | ||
components { | ||
type: CLASSIFICATION_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: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED | ||
} | ||
licenses { | ||
expression: "(GPL-3.0-only AND LGPL-2.0-only)" | ||
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_CONCLUDED | ||
} | ||
} | ||
components { | ||
type: CLASSIFICATION_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: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED | ||
} | ||
licenses { | ||
license { | ||
id: "GPL-3.0-only" | ||
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_CONCLUDED | ||
} | ||
} | ||
} |
Oops, something went wrong.