Skip to content

Commit 0204f8c

Browse files
committed
Add the artifact signed event
Add a new predicate for artifacts, the reflect the signature of the artifact being generated. Different artifacts have different strategies for storing signatures, so the signature is a very generic string attribute which is only available in the artifact.signed event. Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
1 parent 1011f0e commit 0204f8c

3 files changed

Lines changed: 139 additions & 1 deletion

File tree

continuous-integration.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This specification defines three subjects in this stage: `builds`, `artifacts` a
1919
| Subject | Description | Predicates |
2020
|---------|-------------|------------|
2121
| [`build`](#build) | A software build | [`queued`](#build-queued), [`started`](#build-started), [`finished`](#build-finished)|
22-
| [`artifact`](#artifact) | An artifact produced by a build | [`packaged`](#artifact-packaged), [`published`](#artifact-published)|
22+
| [`artifact`](#artifact) | An artifact produced by a build | [`packaged`](#artifact-packaged), [`published`](#artifact-published), [`signed`](#artifact-signed)|
2323

2424
> `testCase`/`testSuite` events have moved to their own top-level bucket [Testing Events](testing-events.md)
2525
@@ -46,6 +46,7 @@ An `artifact` is usually produced as output of a build process. Events need to b
4646
| source | `URI-Reference` | See [source](spec.md#source-subject) | `staging/tekton`, `tekton-dev-123`|
4747
| type | `String` | See [type](spec.md#type-subject) | `artifact` |
4848
| change | `object` | The change (tag, commit, revision) of the repository which was used to build the artifact" | `{"id": "527d4a1aca5e8d0df24813df5ad65d049fc8d312", "source": "my-git.example/an-org/a-repo"}`, `{"id": "feature1234", "source": "my-git.example/an-org/a-repo"}` |
49+
| signature | `string` | The signature of the artifact | `MEYCIQCBT8U5ypDXWCjlNKfzTV4KH516/SK13NZSh8znnSMNkQIhAJ3XiQlc9PM1KyjITcZXHotdMB+J3NGua5T/yshmiPmp` |
4950

5051
## Events
5152

@@ -120,3 +121,19 @@ The event represents an artifact that has been published and it can be advertise
120121
| id | `Purl` | See [id](spec.md#id-subject) | `pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427?repository_url=mycr.io/myapp`, `pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c` ||
121122
| source | `URI-Reference` | See [source](spec.md#source-subject) | | |
122123
| type | `String` | See [type](spec.md#type-subject) | `artifact` | |
124+
125+
### `artifact signed`
126+
127+
The event represents an artifact that has been signed. The signature is included in the events itself.
128+
An artifact may be signed after it has been packaged or sometimes after it has published, depending on the tooling being used and the type of artifact.
129+
130+
- Event Type: __`dev.cdevents.artifact.signed.0.1.0-draft`__
131+
- Predicate: signed
132+
- Subject: [`artifact`](#artifact)
133+
134+
| Field | Type | Description | Examples | Required |
135+
|-------|------|-------------|----------|----------------------------|
136+
| id | `Purl` | See [id](spec.md#id-subject) | `pkg:oci/myapp@sha256%3A0b31b1c02ff458ad9b7b81cbdf8f028bd54699fa151f221d1e8de6817db93427?repository_url=mycr.io/myapp`, `pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c` ||
137+
| source | `URI-Reference` | See [source](spec.md#source-subject) | | |
138+
| type | `String` | See [type](spec.md#type-subject) | `artifact` | |
139+
| signature | `string` | The signature of the artifact | `MEYCIQCBT8U5ypDXWCjlNKfzTV4KH516/SK13NZSh8znnSMNkQIhAJ3XiQlc9PM1KyjITcZXHotdMB+J3NGua5T/yshmiPmp` ||

examples/artifact_signed.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"context": {
3+
"version": "0.3.0-draft",
4+
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
5+
"source": "/event/source/123",
6+
"type": "dev.cdevents.artifact.signed.0.1.0-draft",
7+
"timestamp": "2023-03-20T14:27:05.315384Z"
8+
},
9+
"subject": {
10+
"id": "pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c",
11+
"source": "/event/source/123",
12+
"type": "artifact",
13+
"content": {
14+
"signature": "MEYCIQCBT8U5ypDXWCjlNKfzTV4KH516/SK13NZSh8znnSMNkQIhAJ3XiQlc9PM1KyjITcZXHotdMB+J3NGua5T/yshmiPmp"
15+
}
16+
}
17+
}

schemas/artifactsigned.json

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://cdevents.dev/0.3.0-draft/schema/artifact-signed-event",
4+
"properties": {
5+
"context": {
6+
"properties": {
7+
"version": {
8+
"type": "string",
9+
"minLength": 1
10+
},
11+
"id": {
12+
"type": "string",
13+
"minLength": 1
14+
},
15+
"source": {
16+
"type": "string",
17+
"minLength": 1,
18+
"format": "uri-reference"
19+
},
20+
"type": {
21+
"type": "string",
22+
"enum": [
23+
"dev.cdevents.artifact.signed.0.1.0-draft"
24+
],
25+
"default": "dev.cdevents.artifact.signed.0.1.0-draft"
26+
},
27+
"timestamp": {
28+
"type": "string",
29+
"format": "date-time"
30+
}
31+
},
32+
"additionalProperties": false,
33+
"type": "object",
34+
"required": [
35+
"version",
36+
"id",
37+
"source",
38+
"type",
39+
"timestamp"
40+
]
41+
},
42+
"subject": {
43+
"properties": {
44+
"id": {
45+
"type": "string",
46+
"minLength": 1
47+
},
48+
"source": {
49+
"type": "string",
50+
"minLength": 1,
51+
"format": "uri-reference"
52+
},
53+
"type": {
54+
"type": "string",
55+
"minLength": 1,
56+
"enum": [
57+
"artifact"
58+
],
59+
"default": "artifact"
60+
},
61+
"content": {
62+
"properties": {
63+
"signature": {
64+
"type": "string",
65+
"minLength": 1
66+
}
67+
},
68+
"additionalProperties": false,
69+
"type": "object",
70+
"required": [
71+
"signature"
72+
]
73+
}
74+
},
75+
"additionalProperties": false,
76+
"type": "object",
77+
"required": [
78+
"id",
79+
"type",
80+
"content"
81+
]
82+
},
83+
"customData": {
84+
"oneOf": [
85+
{
86+
"type": "object"
87+
},
88+
{
89+
"type": "string",
90+
"contentEncoding": "base64"
91+
}
92+
]
93+
},
94+
"customDataContentType": {
95+
"type": "string"
96+
}
97+
},
98+
"additionalProperties": false,
99+
"type": "object",
100+
"required": [
101+
"context",
102+
"subject"
103+
]
104+
}

0 commit comments

Comments
 (0)