Skip to content

[WIP] schema 1.5 #833

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

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.

## unreleased

* Added
* Support [_CycloneDX_ Specification-1.5](https://github.com/CycloneDX/specification/releases/tag/1.5)

## 2.1.0 -- 2023-06-10

* Changed
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ written in _TypeScript_ and compiled for the target.
* Builders for the following use cases:
* Specific to _Node.js_: create deep data models `Tool` or `Component` from PackageJson-like data structures
* Implementation of the [_CycloneDX_ Specification][CycloneDX-spec] for the following versions:
* `1.5`
* `1.4`
* `1.3`
* `1.2`
Expand Down
6 changes: 4 additions & 2 deletions res/schema/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Resources: Schema files

some schema for offline use as download via [script](../../tools/schema-downloader/download.js).
original sources: <https://github.com/CycloneDX/specification/tree/master/schema>
original sources: <https://github.com/CycloneDX/specification/blob/v1.5-dev>

Currently using version
[ef71717ae0ecb564c0b4c9536d6e9e57e35f2e69](https://github.com/CycloneDX/specification/tree/ef71717ae0ecb564c0b4c9536d6e9e57e35f2e69/schema)
[4159deec24ce6380b580a1a79a4bc2a107ec32aa](https://github.com/CycloneDX/specification/commit/4159deec24ce6380b580a1a79a4bc2a107ec32aa)

| file | note |
|------|------|
Expand All @@ -13,9 +13,11 @@ Currently using version
| [`bom-1.2.SNAPSHOT.xsd`](bom-1.2.SNAPSHOT.xsd) | applied changes: 1 |
| [`bom-1.3.SNAPSHOT.xsd`](bom-1.3.SNAPSHOT.xsd) | applied changes: 1 |
| [`bom-1.4.SNAPSHOT.xsd`](bom-1.4.SNAPSHOT.xsd) | applied changes: 1 |
| [`bom-1.5.SNAPSHOT.xsd`](bom-1.5.SNAPSHOT.xsd) | applied changes: 1 |
| [`bom-1.2.SNAPSHOT.schema.json`](bom-1.2.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
| [`bom-1.3.SNAPSHOT.schema.json`](bom-1.3.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
| [`bom-1.4.SNAPSHOT.schema.json`](bom-1.4.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
| [`bom-1.5.SNAPSHOT.schema.json`](bom-1.5.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
| [`bom-1.2-strict.SNAPSHOT.schema.json`](bom-1.2-strict.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
| [`bom-1.3-strict.SNAPSHOT.schema.json`](bom-1.3-strict.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
| [`spdx.SNAPSHOT.xsd`](spdx.SNAPSHOT.xsd) | |
Expand Down
9 changes: 8 additions & 1 deletion res/schema/bom-1.1.SNAPSHOT.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ limitations under the License.
</xs:documentation>
</xs:annotation>

<xs:simpleType name="refType">
<xs:annotation>
<xs:documentation>Identifier-DataType for interlinked elements.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string" />
</xs:simpleType>

<xs:complexType name="componentsType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="component" type="bom:component"/>
Expand Down Expand Up @@ -201,7 +208,7 @@ limitations under the License.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="bom-ref" type="xs:string">
<xs:attribute name="bom-ref" type="bom:refType">
<xs:annotation>
<xs:documentation>
An optional identifier which can be used to reference the component elsewhere in the BOM.
Expand Down
13 changes: 8 additions & 5 deletions res/schema/bom-1.2-strict.SNAPSHOT.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
}
},
"definitions": {
"refType": {
"$comment": "Identifier-DataType for interlinked elements.",
"type": "string"
},
"metadata": {
"type": "object",
"title": "BOM Metadata Object",
Expand Down Expand Up @@ -260,7 +264,7 @@
"pattern": "^[-+a-z0-9.]+/[-+a-z0-9.]+$"
},
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the component elsewhere in the BOM. Every bom-ref should be unique.",
"default": "",
Expand Down Expand Up @@ -858,16 +862,15 @@
"additionalProperties": false,
"properties": {
"ref": {
"type": "string",
"format": "string",
"$ref": "#/definitions/refType",
"title": "Reference",
"description": "References a component by the components bom-ref attribute"
},
"dependsOn": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
"$ref": "#/definitions/refType"
},
"title": "Depends On",
"description": "The bom-ref identifiers of the components that are dependencies of this dependency object."
Expand All @@ -883,7 +886,7 @@
"additionalProperties": false,
"properties": {
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the service elsewhere in the BOM. Every bom-ref should be unique.",
"default": "",
Expand Down
12 changes: 8 additions & 4 deletions res/schema/bom-1.2.SNAPSHOT.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
}
},
"definitions": {
"refType": {
"$comment": "Identifier-DataType for interlinked elements.",
"type": "string"
},
"metadata": {
"type": "object",
"title": "BOM Metadata Object",
Expand Down Expand Up @@ -248,7 +252,7 @@
"pattern": "^[-+a-z0-9.]+/[-+a-z0-9.]+$"
},
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the component elsewhere in the BOM. Every bom-ref should be unique.",
"default": "",
Expand Down Expand Up @@ -832,7 +836,7 @@
],
"properties": {
"ref": {
"type": "string",
"$ref": "#/definitions/refType",
"format": "string",
"title": "Reference",
"description": "References a component by the components bom-ref attribute"
Expand All @@ -841,7 +845,7 @@
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
"$ref": "#/definitions/refType"
},
"title": "Depends On",
"description": "The bom-ref identifiers of the components that are dependencies of this dependency object."
Expand All @@ -856,7 +860,7 @@
],
"properties": {
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the service elsewhere in the BOM. Every bom-ref should be unique.",
"default": "",
Expand Down
13 changes: 10 additions & 3 deletions res/schema/bom-1.2.SNAPSHOT.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ limitations under the License.
</xs:documentation>
</xs:annotation>

<xs:simpleType name="refType">
<xs:annotation>
<xs:documentation>Identifier-DataType for interlinked elements.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string" />
</xs:simpleType>

<xs:complexType name="metadata">
<xs:sequence minOccurs="0" maxOccurs="1">
<xs:element name="timestamp" type="xs:dateTime" minOccurs="0">
Expand Down Expand Up @@ -395,7 +402,7 @@ limitations under the License.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="bom-ref" type="xs:string">
<xs:attribute name="bom-ref" type="bom:refType">
<xs:annotation>
<xs:documentation>
An optional identifier which can be used to reference the component elsewhere in the BOM.
Expand Down Expand Up @@ -1144,7 +1151,7 @@ limitations under the License.
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="dependency" type="bom:dependencyType"/>
</xs:sequence>
<xs:attribute name="ref" type="xs:string" use="required">
<xs:attribute name="ref" type="bom:refType" use="required">
<xs:annotation>
<xs:documentation>References a component or service by the its bom-ref attribute</xs:documentation>
</xs:annotation>
Expand Down Expand Up @@ -1302,7 +1309,7 @@ limitations under the License.
</xs:annotation>
</xs:any>
</xs:sequence>
<xs:attribute name="bom-ref" type="xs:string">
<xs:attribute name="bom-ref" type="bom:refType">
<xs:annotation>
<xs:documentation>
An optional identifier which can be used to reference the service elsewhere in the BOM.
Expand Down
12 changes: 8 additions & 4 deletions res/schema/bom-1.3-strict.SNAPSHOT.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@
}
},
"definitions": {
"refType": {
"$comment": "Identifier-DataType for interlinked elements.",
"type": "string"
},
"metadata": {
"type": "object",
"title": "BOM Metadata Object",
Expand Down Expand Up @@ -266,7 +270,7 @@
"pattern": "^[-+a-z0-9.]+/[-+a-z0-9.]+$"
},
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the component elsewhere in the BOM. Every bom-ref should be unique."
},
Expand Down Expand Up @@ -851,15 +855,15 @@
"additionalProperties": false,
"properties": {
"ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "Reference",
"description": "References a component by the components bom-ref attribute"
},
"dependsOn": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
"$ref": "#/definitions/refType"
},
"title": "Depends On",
"description": "The bom-ref identifiers of the components that are dependencies of this dependency object."
Expand All @@ -875,7 +879,7 @@
"additionalProperties": false,
"properties": {
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the service elsewhere in the BOM. Every bom-ref should be unique."
},
Expand Down
12 changes: 8 additions & 4 deletions res/schema/bom-1.3.SNAPSHOT.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
}
},
"definitions": {
"refType": {
"$comment": "Identifier-DataType for interlinked elements.",
"type": "string"
},
"metadata": {
"type": "object",
"title": "BOM Metadata Object",
Expand Down Expand Up @@ -254,7 +258,7 @@
"pattern": "^[-+a-z0-9.]+/[-+a-z0-9.]+$"
},
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the component elsewhere in the BOM. Every bom-ref should be unique."
},
Expand Down Expand Up @@ -825,15 +829,15 @@
],
"properties": {
"ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "Reference",
"description": "References a component by the components bom-ref attribute"
},
"dependsOn": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
"$ref": "#/definitions/refType"
},
"title": "Depends On",
"description": "The bom-ref identifiers of the components that are dependencies of this dependency object."
Expand All @@ -848,7 +852,7 @@
],
"properties": {
"bom-ref": {
"type": "string",
"$ref": "#/definitions/refType",
"title": "BOM Reference",
"description": "An optional identifier which can be used to reference the service elsewhere in the BOM. Every bom-ref should be unique."
},
Expand Down
19 changes: 14 additions & 5 deletions res/schema/bom-1.3.SNAPSHOT.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ limitations under the License.
</xs:documentation>
</xs:annotation>

<xs:simpleType name="refType">
<xs:annotation>
<xs:documentation>Identifier-DataType for interlinked elements.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string" />
</xs:simpleType>

<xs:complexType name="metadata">
<xs:sequence minOccurs="0" maxOccurs="1">
<xs:element name="timestamp" type="xs:dateTime" minOccurs="0">
Expand Down Expand Up @@ -400,7 +407,7 @@ limitations under the License.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="bom-ref" type="xs:string">
<xs:attribute name="bom-ref" type="bom:refType">
<xs:annotation>
<xs:documentation>
An optional identifier which can be used to reference the component elsewhere in the BOM.
Expand Down Expand Up @@ -555,7 +562,9 @@ limitations under the License.
<xs:documentation>A hardware device such as a processor, or chip-set. A hardware device
containing firmware should include a component for the physical hardware itself, and another
component of type 'firmware' or 'operating-system' (whichever is relevant), describing
information about the software running on the device.</xs:documentation>
information about the software running on the device.
See also the list of known device properties: https://github.com/CycloneDX/cyclonedx-property-taxonomy/blob/main/cdx/device.md
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="firmware">
Expand Down Expand Up @@ -1156,7 +1165,7 @@ limitations under the License.
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="dependency" type="bom:dependencyType"/>
</xs:sequence>
<xs:attribute name="ref" type="xs:string" use="required">
<xs:attribute name="ref" type="bom:refType" use="required">
<xs:annotation>
<xs:documentation>References a component or service by the its bom-ref attribute</xs:documentation>
</xs:annotation>
Expand Down Expand Up @@ -1309,7 +1318,7 @@ limitations under the License.
</xs:annotation>
</xs:any>
</xs:sequence>
<xs:attribute name="bom-ref" type="xs:string">
<xs:attribute name="bom-ref" type="bom:refType">
<xs:annotation>
<xs:documentation>
An optional identifier which can be used to reference the service elsewhere in the BOM.
Expand Down Expand Up @@ -1502,7 +1511,7 @@ limitations under the License.
</xs:simpleType>

<xs:complexType name="bomReferenceType">
<xs:attribute name="ref" type="xs:string" use="required">
<xs:attribute name="ref" type="bom:refType" use="required">
<xs:annotation>
<xs:documentation>References a component or service by the its bom-ref attribute</xs:documentation>
</xs:annotation>
Expand Down
4 changes: 2 additions & 2 deletions res/schema/bom-1.4.SNAPSHOT.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
"file"
],
"title": "Component Type",
"description": "Specifies the type of component. For software components, classify as application if no more specific appropriate classification is available or cannot be determined for the component. Types include:\n\n* __application__ = A software application. Refer to [https://en.wikipedia.org/wiki/Application_software](https://en.wikipedia.org/wiki/Application_software) for information about applications.\n* __framework__ = A software framework. Refer to [https://en.wikipedia.org/wiki/Software_framework](https://en.wikipedia.org/wiki/Software_framework) for information on how frameworks vary slightly from libraries.\n* __library__ = A software library. Refer to [https://en.wikipedia.org/wiki/Library_(computing)](https://en.wikipedia.org/wiki/Library_(computing))\n for information about libraries. All third-party and open source reusable components will likely be a library. If the library also has key features of a framework, then it should be classified as a framework. If not, or is unknown, then specifying library is RECOMMENDED.\n* __container__ = A packaging and/or runtime format, not specific to any particular technology, which isolates software inside the container from software outside of a container through virtualization technology. Refer to [https://en.wikipedia.org/wiki/OS-level_virtualization](https://en.wikipedia.org/wiki/OS-level_virtualization)\n* __operating-system__ = A software operating system without regard to deployment model (i.e. installed on physical hardware, virtual machine, image, etc) Refer to [https://en.wikipedia.org/wiki/Operating_system](https://en.wikipedia.org/wiki/Operating_system)\n* __device__ = A hardware device such as a processor, or chip-set. A hardware device containing firmware SHOULD include a component for the physical hardware itself, and another component of type 'firmware' or 'operating-system' (whichever is relevant), describing information about the software running on the device.\n* __firmware__ = A special type of software that provides low-level control over a devices hardware. Refer to [https://en.wikipedia.org/wiki/Firmware](https://en.wikipedia.org/wiki/Firmware)\n* __file__ = A computer file. Refer to [https://en.wikipedia.org/wiki/Computer_file](https://en.wikipedia.org/wiki/Computer_file) for information about files.",
"description": "Specifies the type of component. For software components, classify as application if no more specific appropriate classification is available or cannot be determined for the component. Types include:\n\n* __application__ = A software application. Refer to [https://en.wikipedia.org/wiki/Application_software](https://en.wikipedia.org/wiki/Application_software) for information about applications.\n* __framework__ = A software framework. Refer to [https://en.wikipedia.org/wiki/Software_framework](https://en.wikipedia.org/wiki/Software_framework) for information on how frameworks vary slightly from libraries.\n* __library__ = A software library. Refer to [https://en.wikipedia.org/wiki/Library_(computing)](https://en.wikipedia.org/wiki/Library_(computing))\n for information about libraries. All third-party and open source reusable components will likely be a library. If the library also has key features of a framework, then it should be classified as a framework. If not, or is unknown, then specifying library is RECOMMENDED.\n* __container__ = A packaging and/or runtime format, not specific to any particular technology, which isolates software inside the container from software outside of a container through virtualization technology. Refer to [https://en.wikipedia.org/wiki/OS-level_virtualization](https://en.wikipedia.org/wiki/OS-level_virtualization)\n* __operating-system__ = A software operating system without regard to deployment model (i.e. installed on physical hardware, virtual machine, image, etc) Refer to [https://en.wikipedia.org/wiki/Operating_system](https://en.wikipedia.org/wiki/Operating_system)\n* __device__ = A hardware device such as a processor, or chip-set. A hardware device containing firmware SHOULD include a component for the physical hardware itself, and another component of type 'firmware' or 'operating-system' (whichever is relevant), describing information about the software running on the device.\n See also the list of [known device properties](https://github.com/CycloneDX/cyclonedx-property-taxonomy/blob/main/cdx/device.md).\n* __firmware__ = A special type of software that provides low-level control over a devices hardware. Refer to [https://en.wikipedia.org/wiki/Firmware](https://en.wikipedia.org/wiki/Firmware)\n* __file__ = A computer file. Refer to [https://en.wikipedia.org/wiki/Computer_file](https://en.wikipedia.org/wiki/Computer_file) for information about files.",
"examples": ["library"]
},
"mime-type": {
Expand Down Expand Up @@ -1640,7 +1640,7 @@
},
"range": {
"description": "A version range specified in Package URL Version Range syntax (vers) which is defined at https://github.com/package-url/purl-spec/VERSION-RANGE-SPEC.rst",
"$ref": "#/definitions/version"
"$ref": "#/definitions/range"
},
"status": {
"description": "The vulnerability status for the version or range of versions.",
Expand Down
Loading