Skip to content

Commit 9c13e04

Browse files
authored
incorporate spec changes (#56)
- 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 ```
1 parent 9fc863b commit 9c13e04

File tree

9 files changed

+167
-75
lines changed

9 files changed

+167
-75
lines changed

doc/appendix/A/OCIRegistry/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@ access specification.
8989

9090
</div>
9191

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+
92108
## Blob Mappings
93109

94110
Local blobs with an OCI artifact media type will implicitly be mapped to a regular

doc/appendix/B/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ required to identity the blob and its location.
1212
The following access method types are centrally defined:
1313

1414
- [localBlob](localBlob.md) an artifact stored along with the component version
15-
- [ociArtifact](ociArtefact.md) an artifact in a repository of an OCI registry
15+
- [ociArtifact](ociArtifact.md) an artifact in a repository of an OCI registry
1616
- [ociBlob](ociBlob.md) a blob in a repository of an OCI registry
17-
- [gitHub](gitHub.md) a GitHub commit
17+
- [helm](helm.md) a Helm chart stored in a Helm Repository
18+
- [gitHub](gitHub.md) a commit in a GitHub-based Git repository
1819
- [s3](s3.md) a blob stored in an AWS S3 bucket

doc/appendix/B/helm.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
# Access Method `helm` - Helm Repository Access
3+
4+
5+
### Synopsis
6+
```
7+
type: helm/v1
8+
```
9+
10+
Provided blobs use the following media type: attribute `application/vnd.cncf.helm.chart.content.v1.tar+gzip`
11+
12+
### Description
13+
This method implements the access of a Helm chart stored in a Helm chart repository.
14+
15+
Supported specification version is `v1`
16+
17+
### Specification Versions
18+
19+
#### Version `v1`
20+
21+
The type specific specification fields are:
22+
23+
- **`helmRepository`** *string*
24+
25+
Helm repository URL.
26+
27+
- **`helmChart`** *string*
28+
29+
The name of the Helm chart and its version separated by a colon.
30+
31+
- **`caCert`** *string*
32+
33+
An optional TLS root certificate.
34+
35+
- **`keyring`** *string*
36+
37+
An optional keyring used to verify the chart.
38+
39+
### Related
40+
41+
Helm charts can be stored as OCI artifacts in OCI registries, also. The access to those
42+
helm charts is described by the access method [`ociArtifact](ociArtifact.md).
File renamed without changes.

doc/appendix/E/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
The following [artifact types](../../specification/formats/types.md#artifact-types) are centrally defined:
44

5-
| TYPE | VALUE | DESCRIPTION |
6-
| ------------- | ------------------------------- | ----------------------------- |
7-
| 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) |
5+
| TYPE | VALUE | DESCRIPTION |
6+
|--------------------|-----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
7+
| 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) |
1313

1414
For centrally defined artifact types, there might be special support in the
1515
standard OCM library and tool set. For example, there is a dedicated downloader
@@ -39,7 +39,7 @@ must deliver such a blob, also.
3939
This basically means, whenever a new resource type is supported,
4040
corresponding blob formats must be defined for this type. Type-agnostic access types, like [`localBlob`](../B/localBlob.md) or [`ociBlob`](../B/ociBlob.md)
4141
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)
4343
method may provide dedicated blob formats.
4444

4545
These blob formats may depend on the combination of artifact type and access type.
File renamed without changes.

doc/glossary.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Glossary
22

3-
[A](#a) &nbsp; B &nbsp; [C](#c) &nbsp; [D](#d) &nbsp; [E](#e) &nbsp; F &nbsp; G &nbsp; H &nbsp; [I](#i) &nbsp; J &nbsp; K &nbsp; [L](#l) &nbsp; [M](#m) &nbsp; [N](#n) &nbsp; [O](#o) &nbsp; [P](#p) &nbsp; Q &nbsp; [R](#r) &nbsp; [S](#s) &nbsp; [T](#t) &nbsp; U &nbsp; V &nbsp; W &nbsp; X &nbsp; Y &nbsp; Z
3+
[A](#a) &nbsp; B &nbsp; [C](#c) &nbsp; [D](#d) &nbsp; [E](#e) &nbsp; F &nbsp; G &nbsp; [H](#h) &nbsp; [I](#i) &nbsp; J &nbsp; K &nbsp; [L](#l) &nbsp; [M](#m) &nbsp; [N](#n) &nbsp; [O](#o) &nbsp; [P](#p) &nbsp; Q &nbsp; [R](#r) &nbsp; [S](#s) &nbsp; [T](#t) &nbsp; U &nbsp; V &nbsp; W &nbsp; X &nbsp; Y &nbsp; Z
44

55
## A
66

@@ -106,6 +106,14 @@ behaviour of such elements.
106106
additional parts of the identity of an [element](#elemid) of a [component version](#compvers)
107107
described as dedicated attributes in a [component descriptor](#compdesc).
108108

109+
## H
110+
111+
#### [Helm Chart](appendix/B/helm.md)<a id="helmchart"/>
112+
A set of files describing the deplyoment of a Kubernetes application using
113+
the [Helm](https://helm.sh/) deployment mechanism.
114+
115+
see [element identity](#elemid), [component identity](#compid), [component version identity](#compversid)
116+
109117
## I
110118

111119
#### Identity<a id="identity"/>

doc/specification/formats/componentdescriptor_normalization.md

Lines changed: 87 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,92 @@ normalizations.
2222
- `jsonNormalisationV2`: This is the new format. which is independent of the
2323
chosen representation format of the component descriptor.
2424

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
26111

27112
The generic format is based on a data structure consisting of dictionaries, lists and
28113
simple values (like strings and integers).
@@ -220,64 +305,4 @@ are all normalized to:
220305

221306
```json
222307
[]
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.
308+
```

doc/specification/formats/normalization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ content of described artifacts must be incorporated.
55

66
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).
77
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).
99

1010
To cover the content of the artifacts described by a component version, a digest
1111
for the artifact content has to be calculated, also, and incorporated into the

0 commit comments

Comments
 (0)