-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add CycloneDX document validators to public API (#433)
Signed-off-by: Jan Kowalleck <[email protected]>
- Loading branch information
1 parent
e55437b
commit 5f404e6
Showing
499 changed files
with
15,182 additions
and
5,259 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,5 @@ src_paths = | |
cyclonedx | ||
tests | ||
typings | ||
examples | ||
tools |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
# fix settings for files that are copied over, to keep them as is | ||
[*.SNAPSHOT.xsd] | ||
indent_size = 4 | ||
indent_style = space | ||
trim_trailing_whitespace = false | ||
[*.SNAPSHOT.schema.json] | ||
indent_size = 2 | ||
indent_style = space | ||
trim_trailing_whitespace = false |
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,6 @@ | ||
# snapshots are vendored for offline use | ||
*.SNAPSHOT.* linguist-vendored | ||
|
||
# specs are vendored for offline use | ||
*.xsd linguist-vendored | ||
*.schema.json linguist-vendored |
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,30 @@ | ||
# Resources: Schema files | ||
|
||
some schema for offline use as download via [script](../../../tools/schema-downloader.py). | ||
original sources: <https://github.com/CycloneDX/specification/tree/master/schema> | ||
|
||
Currently using version | ||
[fd4d383658196992364e5d62568a48c431ace515](https://github.com/CycloneDX/specification/commit/fd4d383658196992364e5d62568a48c431ace515) | ||
|
||
| file | note | | ||
|------|------| | ||
| [`bom-1.0.SNAPSHOT.xsd`](bom-1.0.SNAPSHOT.xsd) | applied changes: 1 | | ||
| [`bom-1.1.SNAPSHOT.xsd`](bom-1.1.SNAPSHOT.xsd) | applied changes: 1 | | ||
| [`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.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.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) | | | ||
| [`spdx.SNAPSHOT.schema.json`](spdx.SNAPSHOT.schema.json) | | | ||
| [`jsf-0.82.SNAPSHOT.schema.json`](jsf-0.82.SNAPSHOT.schema.json) | | | ||
|
||
changes: | ||
1. `https?://cyclonedx.org/schema/spdx` was replaced with `spdx.SNAPSHOT.xsd` | ||
2. `spdx.schema.json` was replaced with `spdx.SNAPSHOT.schema.json` | ||
3. `jsf-0.82.schema.json` was replaced with `jsf-0.82.SNAPSHOT.schema.json` | ||
4. `properties.$schema.enum` was fixed to match `$id` | ||
5. `required.version` removed, as it is actually optional with default value |
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,60 @@ | ||
# encoding: utf-8 | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from os.path import dirname, join | ||
from typing import Dict, Optional | ||
|
||
from .. import SchemaVersion | ||
|
||
""" | ||
Content in here is internal, not for public use. | ||
Breaking changes without notice may happen. | ||
""" | ||
|
||
__DIR = dirname(__file__) | ||
|
||
BOM_XML: Dict[SchemaVersion, Optional[str]] = { | ||
SchemaVersion.V1_4: join(__DIR, 'bom-1.4.SNAPSHOT.xsd'), | ||
SchemaVersion.V1_3: join(__DIR, 'bom-1.3.SNAPSHOT.xsd'), | ||
SchemaVersion.V1_2: join(__DIR, 'bom-1.2.SNAPSHOT.xsd'), | ||
SchemaVersion.V1_1: join(__DIR, 'bom-1.1.SNAPSHOT.xsd'), | ||
SchemaVersion.V1_0: join(__DIR, 'bom-1.0.SNAPSHOT.xsd'), | ||
} | ||
|
||
BOM_JSON: Dict[SchemaVersion, Optional[str]] = { | ||
SchemaVersion.V1_4: join(__DIR, 'bom-1.4.SNAPSHOT.schema.json'), | ||
SchemaVersion.V1_3: join(__DIR, 'bom-1.3.SNAPSHOT.schema.json'), | ||
SchemaVersion.V1_2: join(__DIR, 'bom-1.2.SNAPSHOT.schema.json'), | ||
# <= v1.1 is not defined in JSON | ||
SchemaVersion.V1_1: None, | ||
SchemaVersion.V1_0: None, | ||
} | ||
|
||
BOM_JSON_STRICT: Dict[SchemaVersion, Optional[str]] = { | ||
# >= v1.4 is already strict - no special file here | ||
SchemaVersion.V1_4: join(__DIR, 'bom-1.4.SNAPSHOT.schema.json'), | ||
# <= 1.3 need special files | ||
SchemaVersion.V1_3: join(__DIR, 'bom-1.3-strict.SNAPSHOT.schema.json'), | ||
SchemaVersion.V1_2: join(__DIR, 'bom-1.2-strict.SNAPSHOT.schema.json'), | ||
# <= v1.1 is not defined in JSON | ||
SchemaVersion.V1_1: None, | ||
SchemaVersion.V1_0: None, | ||
} | ||
|
||
SPDX_JSON = join(__DIR, 'spdx.SNAPSHOT.schema.json') | ||
SPDX_XML = join(__DIR, 'spdx.SNAPSHOT.xsd') | ||
|
||
JSF = join(__DIR, 'jsf-0.82.SNAPSHOT.schema.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
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
Oops, something went wrong.