You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- new access method for helm repositories
- component descriptor normalization according to RFC8785 (JCS)
- version mapping for mapping OCM versions to OCI tags.
**What this PR does / why we need it**:
**Which issue(s) this PR fixes**:
Fixes #
**Special notes for your reviewer**:
**Release note**:
<!-- Write your release note:
1. Enter your release note in the below block.
2. If no release note is required, just write "NONE" within the block.
Format of block header: <category> <target_group>
Possible values:
- category: breaking|feature|bugfix|doc|other
- target_group: user|operator|developer|dependency
-->
```feature user
```
Copy file name to clipboardExpand all lines: doc/appendix/A/OCIRegistry/README.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,22 @@ access specification.
89
89
90
90
</div>
91
91
92
+
93
+
## Version Mapping
94
+
95
+
The Open Component Model supports version names according to [semantic versioning](https://semver.org/).
96
+
The tags used to represent versions in the [OCI specification](https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pulling-manifests) do not allow to directly use semantic version names as tags, becase the plus (`+`) character is not supported. Therefore, the open component model version names have to be mapped
97
+
to OCI-compliant tag names.
98
+
99
+
The followinmg mapping for version is used, here:
100
+
- the optional plus `+` character used to attach build information in semantic versions is mapped to the sequence (`.build-`)
101
+
102
+
Mapping tags back to versions uses the following mappings:
103
+
- the last character sequence (`.build-`) is mapped to a plus (`+`) character.
104
+
105
+
This way the formal parts of a pre-release of semantic version (separated by dots) are kept
106
+
unchanged. The build/metadata suffix of a semantic version is just added as optional last pre-release part, where the prefix `build-` is used to indicate its meaning as metadata suffix.
107
+
92
108
## Blob Mappings
93
109
94
110
Local blobs with an OCI artifact media type will implicitly be mapped to a regular
| OCI Artifact |[`ociArtifact`](ociArtefact.md)| A generic OCI artifact following the [open containers image specification](https://github.com/opencontainers/image-spec/blob/main/spec.md)|
8
-
| OCI Image |[`ociImage`](ociImage.md)| An OCI image or image list |
9
-
| Helm Chart |[`helmChart`](helmChart.md)| A Helm Chart stored as OCI artifact or as tar blob (`mediaType` tar) |
10
-
| Blob |[`blob`](blob.md)| Any anonymous untyped blob data |
11
-
| Filesystem |[`fileSystem`](fileSystem.md)| Some filesystem content (tar, tgz)|
12
-
| GitOps |[`gitOpsTemplate`](gitOpsTemplate.md)| Filesystem content (tar, tgz) used as GitOps Template, e.g. to set up a git repo used for continuous deployment (for example flux) |
| OCI Artifact |[`ociArtifact`](ociArtifact.md)| A generic OCI artifact following the [open containers image specification](https://github.com/opencontainers/image-spec/blob/main/spec.md)|
8
+
| OCI Image |[`ociImage`](ociImage.md)| An OCI image or image list|
9
+
| Helm Chart |[`helmChart`](helmChart.md)| A Helm Chart stored as OCI artifact or as tar blob (`mediaType` tar)|
10
+
| Blob |[`blob`](blob.md)| Any anonymous untyped blob data|
11
+
| Filesystem Content |[`filesystem``directoryTree`](fileSystem.md)| Some filesystem content (typically provided by a *tar* or *tgz* archive). The blob's mime type specifies the concrete format. |
12
+
| GitOps |[`gitOpsTemplate`](gitOpsTemplate.md)| Filesystem content (tar, tgz) used as GitOps Template, e.g. to set up a git repo used for continuous deployment (for example flux)|
13
13
14
14
For centrally defined artifact types, there might be special support in the
15
15
standard OCM library and tool set. For example, there is a dedicated downloader
@@ -39,7 +39,7 @@ must deliver such a blob, also.
39
39
This basically means, whenever a new resource type is supported,
40
40
corresponding blob formats must be defined for this type. Type-agnostic access types, like [`localBlob`](../B/localBlob.md) or [`ociBlob`](../B/ociBlob.md)
41
41
just deal with those blobs, they never need to know anything about their internal
42
-
format. But specific access methods, e.g. the [`ociArtecat`](../B/ociArtifact.md)
42
+
format. But specific access methods, e.g. the [`ociArtifact`](../B/ociArtifact.md)
43
43
method may provide dedicated blob formats.
44
44
45
45
These blob formats may depend on the combination of artifact type and access type.
Copy file name to clipboardExpand all lines: doc/glossary.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Glossary
2
2
3
-
[A](#a) B [C](#c) [D](#d) [E](#e) F G H [I](#i) J K [L](#l) [M](#m) [N](#n) [O](#o) [P](#p) Q [R](#r) [S](#s) [T](#t) U V W X Y Z
3
+
[A](#a) B [C](#c) [D](#d) [E](#e) F G [H](#h) [I](#i) J K [L](#l) [M](#m) [N](#n) [O](#o) [P](#p) Q [R](#r) [S](#s) [T](#t) U V W X Y Z
4
4
5
5
## A
6
6
@@ -106,6 +106,14 @@ behaviour of such elements.
106
106
additional parts of the identity of an [element](#elemid) of a [component version](#compvers)
107
107
described as dedicated attributes in a [component descriptor](#compdesc).
Copy file name to clipboardExpand all lines: doc/specification/formats/componentdescriptor_normalization.md
+87-62Lines changed: 87 additions & 62 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,92 @@ normalizations.
22
22
-`jsonNormalisationV2`: This is the new format. which is independent of the
23
23
chosen representation format of the component descriptor.
24
24
25
-
## Generic Normalization format
25
+
The normalization process is divided into two steps:
26
+
27
+
-*extraction of the signature relevant information from the component descriptor*
28
+
29
+
The result is basically a JSON object, which decsribed the relevant information.
30
+
31
+
-*normalization of the resulting JSON object*
32
+
33
+
Here, the object is serialized to a unique and reproducable byte sequence, which is finally used to determine the digest.
34
+
35
+
There are two such normalization methods:
36
+
-`jsonNormalisationV1` uses an [OCM specific representation](#generic-normalization-format) of the JSON object.
37
+
-`jsonNormalisationV2` uses a standard scheme according to [RFC8785 (JCS)](https://www.rfc-editor.org/rfc/rfc8785).
38
+
39
+
40
+
## `jsonNormalisationV1` vs `jsonNormalisationV2`
41
+
42
+
The `JsonNormalisationV1` serialization format is based on the serialization
43
+
format of the component descriptor. It uses an appropriate JSON object containing the relevant fields as contained in the component descriptors's serialization. The format version fields are included. Therefore, the normalized form is depending on the chosen serialization format. Changing this format version would result in different digests. The resulting JSON object is serialized with the [OCM specific scheme](#generic-normalization-format)
44
+
45
+
`JsonNormalisationV2` strictly uses only the relevant component descriptor
46
+
information according to the field specification shown below. It is independent of the serialization format used to store the component decsriptor in some storage backend. Therefore, the calculated digest is finally independent of the serialization format chosen for storing the component descriptor in a storage backend.
47
+
48
+
Additionally, it uses the JCS scheme for uniquely serializing the resulting
49
+
JSON object.
50
+
51
+
## Relevant information in Component Descriptors
52
+
53
+
A component descriptor contains static information and
54
+
information, which may change over time (for example, the access methods
55
+
specifications might be changed during a transport step). A digest should be
56
+
stable even after a transport and therefore should only hash static
57
+
information. Therefore, a component descriptor is transformed to format
58
+
containing only immutable fields, which are finally relevant for the signing
59
+
process to assure the data integrity.
60
+
61
+
Relevant fields and their mapping to the normalized data structure for `JsonNormalisationV2`:
62
+
- Component Name: mapped to `component.name`
63
+
- Component Version: mapped to `component.version`
64
+
- Component Labels: mapped to `component.labels` (see [Labels](#labels)])
65
+
- Component Provider: mapped to `component.provider`
66
+
- Resources: mapped to `component.resources`, always empty list enforced, without the source references (see [Labels](#labels)] and [Access Methods](#access-methods)])
67
+
- Sources: mapped to `component.sources`, always empty list enforced, (see [Labels](#labels)] and [Access Methods](#access-methods)])
68
+
- References: mapped to `component.references`, always empty list enforced, (see [Labels](#labels)])
69
+
70
+
### Access Methods
71
+
72
+
Access method specifications are completely ignored.
73
+
A resource/source is ignored, if the access method type is `none`.
74
+
75
+
## Labels
76
+
77
+
Labels are removed before signing but can be marked with a special boolean
78
+
property `signing`. This property indicates that the label should be
79
+
signing-relevant and therefore part of the digest. As a consequence such
80
+
labels cannot be changed anymore during the lifecycle of a component version
81
+
any may only describe static information.
82
+
The structure of signing-relevant labels is preserved from the component
83
+
descriptor version `v2`.
84
+
85
+
Example:
86
+
87
+
```yaml
88
+
labels:
89
+
- name: label1
90
+
value: foo
91
+
- name: label2
92
+
value: bar
93
+
signing: true
94
+
```
95
+
96
+
`label1` will be excluded from the digest, `label2` will be included.
97
+
The label value is taken as it is, preserving a potentially deeply nested structure.
98
+
99
+
## Exclude Resources from Normalization/Signing
100
+
101
+
If a resource should not be part of the normalization and later signing, the resource needs a special digest in the following format:
102
+
103
+
```yaml
104
+
digest:
105
+
hashAlgorithm: NO-DIGEST
106
+
normalisationAlgorithm: EXCLUDE-FROM-SIGNATURE
107
+
value: NO-DIGEST
108
+
```
109
+
110
+
## Generic Normalization Format
26
111
27
112
The generic format is based on a data structure consisting of dictionaries, lists and
28
113
simple values (like strings and integers).
@@ -220,64 +305,4 @@ are all normalized to:
220
305
221
306
```json
222
307
[]
223
-
```
224
-
225
-
## Relevant information in Component Descriptors.
226
-
227
-
A component descriptor contains signature relevant information and
228
-
information, which may change. For example, the access methods specifications
229
-
might be changed during atransport step.
230
-
231
-
Relevant fields and their mapping to the normalized data structure for `JsonNormalisationV2`:
232
-
- Component Name: mapped to `component.name`
233
-
- Component Version: mapped to `component.version`
234
-
- Component Labels: mapped to `component.labels` (see [Labels](#labels)])
235
-
- Component Provider: mapped to `component.provider`
236
-
- Resources: mapped to `component.resources`, always empty list enforced, without the source references (see [Labels](#labels)] and [Access Methods](#access-methods)])
237
-
- Sources: mapped to `component.sources`, always empty list enforced, (see [Labels](#labels)] and [Access Methods](#access-methods)])
238
-
- References: mapped to `component.references`, always empty list enforced, (see [Labels](#labels)])
239
-
240
-
### Access Methods
241
-
242
-
Access method specifications are completely ignored.
243
-
A resource/source is ignored, if the access method type is `none`.
244
-
245
-
## Labels
246
-
247
-
Labels are removed before signing but can be marked with a special boolean
248
-
property `signing` not to be removed and thus be part of the signature.
249
-
The structure of signing-relevant labels is preserved from the component
250
-
descriptor version `v2`.
251
-
252
-
Example:
253
-
254
-
```yaml
255
-
labels:
256
-
- name: label1
257
-
value: foo
258
-
- name: label2
259
-
value: bar
260
-
signing: true
261
-
```
262
-
263
-
`label1` will be excluded from the signature, `label2` will be included.
264
-
The label values is takes as it is, preserving a potentially deep structure.
265
-
266
-
## Exclude Resource from Normalisation/Signing
267
-
268
-
If a resource should not be part of the normalisation and later signing, the resource needs a special digest in the following format:
269
-
270
-
```yaml
271
-
digest:
272
-
hashAlgorithm: NO-DIGEST
273
-
normalisationAlgorithm: EXCLUDE-FROM-SIGNATURE
274
-
value: NO-DIGEST
275
-
```
276
-
277
-
# `jsonNormalisationV1` vs `jsonNormalisationV2`
278
-
279
-
The `JsonNormalisationV1` serialization format is based on the serialization
280
-
format of the component descriptor. The format version fields are included
281
-
282
-
`JsonNormalisationV2`strictly uses only the relevant component descriptor
283
-
information according to the field specification shown above.
Copy file name to clipboardExpand all lines: doc/specification/formats/normalization.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ content of described artifacts must be incorporated.
5
5
6
6
The metadata of a component version is described by a [component-descriptor](../../specification/elements/README.md#component-descriptor). It contains volatile information, also, e.g. the artifact access specification, which might change during [transports](../../introduction/transports.md).
7
7
Therefore, to calculate a digest, the component descriptor has to be transformed
8
-
to an immutable technical reprsentation containing only signature relevant information. THis process is called [*component descriptor normalization*](componentdescriptor_normalization.md).
8
+
to an immutable technical representation containing only static signature relevant information. This process is called [*component descriptor normalization*](componentdescriptor_normalization.md).
9
9
10
10
To cover the content of the artifacts described by a component version, a digest
11
11
for the artifact content has to be calculated, also, and incorporated into the
0 commit comments