Skip to content

Commit 339dec6

Browse files
authored
Merge branch '1.7-dev' into add-streebog-hashalg
2 parents fec8c4c + 36dc8f6 commit 339dec6

File tree

280 files changed

+14465
-574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

280 files changed

+14465
-574
lines changed

.github/pull_request_template.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
Thank you for taking the time to develop and contribute a core enhancement or fix for a defect!
3+
4+
We kindly request that you create pull requests only for things that have been discussed in a ticket first; exceptions may be made for spelling or grammar fixes.
5+
Read more about the process here: https://cyclonedx.org/participate/standardization-process/#working-model
6+
7+
Please have the related ticket/issue ID ready.
8+
If there is none, feel free to create a new ticket: https://github.com/CycloneDX/specification/issues/new/choose
9+
10+
-->
11+
12+
<!--
13+
14+
Please provide a brief description of what this pull request intends to do and which ticket it fixes/closes.
15+
Example:
16+
> As discussed in ticket #485, this PR adds Streebog to the hash algorithm enum.
17+
>
18+
> fixes #485
19+
20+
In case this is for a spelling or grammar improvement, please provide a brief description.
21+
Example:
22+
> Fixe typo: color(AE) -> colour(BE)
23+
24+
-->

.github/workflows/build_docs.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,21 @@ jobs:
5959
name: JSON-Schema-documentation
6060
path: docgen/json/docs
6161
if-no-files-found: error
62+
docs_proto:
63+
runs-on: ubuntu-latest
64+
defaults:
65+
run:
66+
working-directory: docgen/proto
67+
steps:
68+
- name: Checkout
69+
# see https://github.com/actions/checkout
70+
uses: actions/checkout@v4
71+
- name: Generate Schema documentation
72+
run: ./gen.sh
73+
- name: Archive Schema documentation
74+
# https://github.com/actions/upload-artifact
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: PROTO-Schema-documentation
78+
path: docgen/proto/docs
79+
if-no-files-found: error

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,24 @@ free, open source, and proprietary tools and solutions that support the CycloneD
4747
The following media types are officially registered with IANA:
4848

4949
| Media Type | Format | Assignment |
50-
| ------- | --------- | --------- |
51-
| application/vnd.cyclonedx+xml | XML | [IANA](https://www.iana.org/assignments/media-types/application/vnd.cyclonedx+xml) |
52-
| application/vnd.cyclonedx+json | JSON | [IANA](https://www.iana.org/assignments/media-types/application/vnd.cyclonedx+json) |
50+
|------------|--------|------------|
51+
| `application/vnd.cyclonedx+xml` | XML | [IANA](https://www.iana.org/assignments/media-types/application/vnd.cyclonedx+xml) |
52+
| `application/vnd.cyclonedx+json` | JSON | [IANA](https://www.iana.org/assignments/media-types/application/vnd.cyclonedx+json) |
53+
| `application/x.vnd.cyclonedx+protobuf` | Protocol Buffer | |
5354

5455
Specific versions of CycloneDX can be specified by using the version parameter. For example: `application/vnd.cyclonedx+xml; version=1.6`.
5556

56-
The officially supported media type for Protocol Buffer format is `application/x.vnd.cyclonedx+protobuf`.
5757

58+
## Recognized file patterns
59+
60+
The following file names are conventionally used for storing CycloneDX BOM files:
61+
* `bom.json` for JSON encoded CycloneDX BOM files.
62+
* `bom.xml` for XML encoded CycloneDX BOM files.
63+
64+
Alternatively, files that match the glob pattern below are also recognized:
65+
* `*.cdx.json` for JSON encoded CycloneDX BOM files.
66+
* `*.cdx.xml` for XML encoded CycloneDX BOM files.
67+
5868

5969
## Release History
6070

docgen/json/gen.sh

Lines changed: 84 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,61 @@
11
#!/bin/bash
22
set -eu
33

4+
declare -a CDX_VERSIONS=(
5+
'1.7'
6+
'1.6'
7+
'1.5'
8+
'1.4'
9+
'1.3'
10+
'1.2'
11+
)
12+
13+
# region help
14+
DESC="Generate HTML Schema navigator for CycloneDX JSON"
15+
USAGE="
16+
Usage: $0 [CDX_VERSION...]
17+
18+
Supported values for CDX_VERSION: ${CDX_VERSIONS[*]}
19+
"
20+
# endregion help
21+
22+
423
THIS_PATH="$(realpath "$(dirname "$0")")"
524
SCHEMA_PATH="$(realpath "$THIS_PATH/../../schema")"
625
DOCS_PATH="$THIS_PATH/docs"
726
TEMPLATES_PATH="$THIS_PATH/templates"
827

9-
rm -f -R "$DOCS_PATH"
10-
mkdir -p "$DOCS_PATH/"{1.2,1.3,1.4,1.5,1.6,1.7}
1128

12-
# Check to see if generate-schema-doc is executable and is in the path. If not, install JSON Schema for Humans.
13-
if ! [ -x "$(command -v generate-schema-doc)" ]
14-
then
15-
# dependencies managed externally, so dependebot/renovate can pick it up
16-
pip3 install -r "$THIS_PATH/requirements.txt"
17-
fi
29+
# --
30+
31+
prepare () {
32+
# Check to see if generate-schema-doc is executable and is in the path.
33+
# If not, install JSON Schema for Humans.
34+
if ! [ -x "$(command -v generate-schema-doc)" ]
35+
then
36+
# dependencies managed externally, so dependebot/renovate can pick it up
37+
python -m pip install -r "$THIS_PATH/requirements.txt"
38+
fi
39+
}
40+
1841

1942
generate () {
20-
version="$1"
21-
title="CycloneDX v${version} JSON Reference"
43+
local version="$1"
44+
local title="CycloneDX v${version} JSON Reference"
2245
echo "Generating: $title"
2346

24-
SCHEMA_FILE="$SCHEMA_PATH/bom-${version}.schema.json"
25-
STRICT_SCHEMA_FILE="$SCHEMA_PATH/bom-${version}-strict.schema.json"
47+
local SCHEMA_FILE="$SCHEMA_PATH/bom-${version}.schema.json"
48+
local STRICT_SCHEMA_FILE="$SCHEMA_PATH/bom-${version}-strict.schema.json"
2649
if [ -f "$STRICT_SCHEMA_FILE" ]
2750
then
2851
SCHEMA_FILE="$STRICT_SCHEMA_FILE"
2952
fi
30-
echo "$SCHEMA_FILE"
53+
echo "SCHEMA_FILE: $SCHEMA_FILE"
54+
55+
local OUT_FILE="$DOCS_PATH/$version/json/index.html"
56+
local OUT_DIR="$(dirname "$OUT_FILE")"
57+
rm -rf "$OUT_DIR"
58+
mkdir -p "$OUT_DIR"
3159

3260
generate-schema-doc \
3361
--config no_link_to_reused_ref \
@@ -38,16 +66,49 @@ generate () {
3866
--config custom_template_path="$TEMPLATES_PATH/cyclonedx/base.html" \
3967
--minify \
4068
"$SCHEMA_FILE" \
41-
"$DOCS_PATH/$version/index.html"
69+
"$OUT_FILE"
4270

43-
sed -i -e "s/\${quotedTitle}/\"$title\"/g" "$DOCS_PATH/$version/index.html"
44-
sed -i -e "s/\${title}/$title/g" "$DOCS_PATH/$version/index.html"
45-
sed -i -e "s/\${version}/$version/g" "$DOCS_PATH/$version/index.html"
71+
sed -i -e "s/\${quotedTitle}/\"$title\"/g" "$OUT_FILE"
72+
sed -i -e "s/\${title}/$title/g" "$OUT_FILE"
73+
sed -i -e "s/\${version}/$version/g" "$OUT_FILE"
4674
}
4775

48-
generate 1.2
49-
generate 1.3
50-
generate 1.4
51-
generate 1.5
52-
generate 1.6
53-
generate 1.7
76+
77+
# Main logic to handle the argument using a switch case
78+
case "$#" in
79+
1)
80+
case "$1" in
81+
'-h'|'--help')
82+
echo "$DESC"
83+
echo "$USAGE"
84+
exit 0
85+
;;
86+
*) # One argument provided: Call generate with the specific version
87+
for version in "${CDX_VERSIONS[@]}"
88+
do
89+
if [[ "$1" == "$version" ]]
90+
then
91+
prepare
92+
generate "$1"
93+
exit 0
94+
fi
95+
done
96+
echo "Error: unknown CDX_VERSION: $1"
97+
echo "$USAGE"
98+
exit 1
99+
;;
100+
esac
101+
;;
102+
0) # No arguments provided: Loop over all
103+
for version in "${CDX_VERSIONS[@]}"
104+
do
105+
prepare
106+
generate "$version"
107+
done
108+
exit 0
109+
;;
110+
*) # More than one argument provided: Show usage help
111+
echo "Usage: $USAGE"
112+
exit 2
113+
;;
114+
esac

docgen/json/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
json-schema-for-humans==0.47
1+
json-schema-for-humans==1.3.4

docgen/json/templates/cyclonedx/base.html

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
<meta charset="UTF-8"/>
99
<meta name="twitter:card" content="summary_large_image"/>
1010
<meta name="twitter:site" content="@CycloneDX_Spec"/>
11-
<meta name="twitter:title" content="${quotedTitle}"/>
12-
<meta name="twitter:image" content="https://cyclonedx.org/theme/assets/images/CycloneDX-Twitter-Card.png"/>
13-
<meta name="twitter:description" content="${quotedTitle}"/>
14-
<meta name="description" content="${quotedTitle}"/>
15-
<meta property="og:description" content="${quotedTitle}"/>
16-
<meta property="og:title" content="${quotedTitle}"/>
11+
<meta name="twitter:title" content="${title}"/>
12+
<meta name="twitter:image" content="https://cyclonedx.org/images/CycloneDX-Social-Card.png"/>
13+
<meta name="twitter:description" content="${title}"/>
14+
<meta name="description" content="${title}"/>
15+
<meta property="og:description" content="${title}"/>
16+
<meta property="og:title" content="${title}"/>
1717
<meta property="og:locale" content="en_US"/>
1818
<meta property="og:type" content="website" />
19-
<meta property="og:image" content="https://cyclonedx.org/theme/assets/images/CycloneDX-Twitter-Card.png" />
20-
<link rel="icon" href="https://cyclonedx.org/cyclonedx-icon.png" type="image/png"/>
19+
<meta property="og:image" content="https://cyclonedx.org/images/CycloneDX-Social-Card.png" />
20+
<link href="/favicon.ico" rel="shortcut icon" type="image/ico" />
2121
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/css/bootstrap.min.css" integrity="sha512-rt/SrQ4UNIaGfDyEXZtNcyWvQeOq0QLygHluFQcSjaGB04IxWhal71tKuzP6K8eYXYB6vJV4pHkXcmFGGQ1/0w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
2222
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha512-SfTiTlX6kk+qitfevl/7LibUOeJWlt9rbyDn92a1DqWOw9vWG2MFoays0sgObmWazO5BQPiFucnnEAjpAB+/Sw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
2323
<link rel="stylesheet" type="text/css" href="schema_doc.css">
@@ -29,7 +29,7 @@
2929
<body class="blue" data-spy="scroll" data-target=".js-scrollspy" onload="anchorOnLoad();" id="root">
3030

3131
<nav class="navbar fixed-top navbar-expand-sm navbar-inverse">
32-
<a href="https://cyclonedx.org" class="navbar-brand site-header__logo"><img src="https://cyclonedx.org/theme/assets/images/layout/logo-white.svg" width="150"></img></a>
32+
<a href="/" class="navbar-brand site-header__logo"><img src="https://cyclonedx.org/images/logo-all-white.svg" height="48" width="276"></img></a>
3333
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarScroll" aria-controls="navbarScroll" aria-expanded="false" aria-label="Toggle navigation">
3434
<span class="navbar-toggler-icon"></span>
3535
</button>
@@ -40,29 +40,35 @@
4040
v${version} (JSON)
4141
</a>
4242
<ul class="dropdown-menu" aria-labelledby="navbarScrollingDropdown">
43-
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.7/json/">v1.7 (JSON)</a></li>
44-
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.6/json/">v1.6 (JSON)</a></li>
45-
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.5/json/">v1.5 (JSON)</a></li>
46-
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.4/json/">v1.4 (JSON)</a></li>
47-
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.3/json/">v1.3 (JSON)</a></li>
48-
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.2/json/">v1.2 (JSON)</a></li>
43+
<li><a class="dropdown-item" href="/docs/1.7/json/">v1.7 (JSON)</a></li>
44+
<li><a class="dropdown-item" href="/docs/1.6/json/">v1.6 (JSON)</a></li>
45+
<li><a class="dropdown-item" href="/docs/1.5/json/">v1.5 (JSON)</a></li>
46+
<li><a class="dropdown-item" href="/docs/1.4/json/">v1.4 (JSON)</a></li>
47+
<li><a class="dropdown-item" href="/docs/1.3/json/">v1.3 (JSON)</a></li>
48+
<li><a class="dropdown-item" href="/docs/1.2/json/">v1.2 (JSON)</a></li>
4949
<li><hr class="dropdown-divider"/></li>
50-
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.7/xml/">v1.7 (XML)</a></li>
51-
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.6/xml/">v1.6 (XML)</a></li>
52-
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.5/xml/">v1.5 (XML)</a></li>
53-
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.4/xml/">v1.4 (XML)</a></li>
54-
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.3/xml/">v1.3 (XML)</a></li>
55-
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.2/xml/">v1.2 (XML)</a></li>
56-
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.1/xml/">v1.1 (XML)</a></li>
57-
<li><a class="dropdown-item" href="https://cyclonedx.org/docs/1.0/xml/">v1.0 (XML)</a></li>
50+
<li><a class="dropdown-item" href="/docs/1.7/xml/">v1.7 (XML)</a></li>
51+
<li><a class="dropdown-item" href="/docs/1.6/xml/">v1.6 (XML)</a></li>
52+
<li><a class="dropdown-item" href="/docs/1.5/xml/">v1.5 (XML)</a></li>
53+
<li><a class="dropdown-item" href="/docs/1.4/xml/">v1.4 (XML)</a></li>
54+
<li><a class="dropdown-item" href="/docs/1.3/xml/">v1.3 (XML)</a></li>
55+
<li><a class="dropdown-item" href="/docs/1.2/xml/">v1.2 (XML)</a></li>
56+
<li><a class="dropdown-item" href="/docs/1.1/xml/">v1.1 (XML)</a></li>
57+
<li><a class="dropdown-item" href="/docs/1.0/xml/">v1.0 (XML)</a></li>
58+
<li><hr class="dropdown-divider"/></li>
59+
<li><a class="dropdown-item" href="/docs/1.7/proto/">v1.7 (Protobuf)</a></li>
60+
<li><a class="dropdown-item" href="/docs/1.6/proto/">v1.6 (Protobuf)</a></li>
61+
<li><a class="dropdown-item" href="/docs/1.5/proto/">v1.5 (Protobuf)</a></li>
62+
<li><a class="dropdown-item" href="/docs/1.4/proto/">v1.4 (Protobuf)</a></li>
63+
<li><a class="dropdown-item" href="/docs/1.3/proto/">v1.3 (Protobuf)</a></li>
5864
</ul>
5965
</li>
6066
</ul>
6167
</div>
6268
</nav>
6369

6470

65-
<div class="container-fluid" style="margin-top:70px; margin-bottom:3rem">
71+
<div class="container-fluid" style="margin-top:110px; margin-bottom:3rem">
6672
<h1>${title}</h1>
6773

6874
{%- if title -%}
@@ -77,6 +83,7 @@ <h1>{{ title }}</h1>
7783

7884
{{ content(schema) }}
7985

86+
<!--
8087
<footer class="site-footer__copyright fixed-bottom">
8188
<div class="container">
8289
<div class="row">
@@ -86,6 +93,7 @@ <h1>{{ title }}</h1>
8693
</div>
8794
</div>
8895
</footer>
96+
-->
8997

9098
</body>
91-
</html>
99+
</html>

docgen/json/templates/cyclonedx/content.html

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,37 @@
6060
{%- endif -%}
6161

6262
{# Enum and const #}
63-
{%- if schema.kw_enum -%}
63+
{%- if schema.kw_enum and schema.kw_meta_enum -%}
64+
<div class="enum-value" id="{{ schema.kw_enum.html_id }}">
65+
<h4>Must be one of:</h4>
66+
<table class="table table-striped table-bordered">
67+
<thead class="thead-dark">
68+
<tr>
69+
<th class="text-nowrap" scope="col">Name</th>
70+
<th scope="col">Description</th>
71+
</tr>
72+
</thead>
73+
<tbody>
74+
{%- for enum_choice in schema.kw_enum.array_items -%}
75+
<tr>
76+
<td class="text-nowrap">
77+
<strong>{{ enum_choice.literal | python_to_json }}</strong>
78+
</td>
79+
<td>
80+
{{ (schema.enum_description(enum_choice.literal) | get_description_literal) }}
81+
</td>
82+
</tr>
83+
{%- endfor -%}
84+
</tbody>
85+
</table>
86+
</div>
87+
{%- elif schema.kw_enum -%}
6488
<div class="enum-value" id="{{ schema.kw_enum.html_id }}">
6589
<h4>Must be one of:</h4>
6690
<ul class="list-group">
6791
{%- for enum_choice in schema.kw_enum.array_items -%}
6892
<li class="list-group-item enum-item">
69-
{%- if schema.kw_meta_enum -%}<strong>{%- endif -%}
7093
{{ enum_choice.literal | python_to_json }}
71-
{%- if schema.kw_meta_enum -%}</strong>
72-
: {{ (schema.enum_description(enum_choice.literal) | get_description_literal) }}
73-
{%- endif -%}
7494
</li>
7595
{%- endfor -%}
7696
</ul>

0 commit comments

Comments
 (0)