@cloudhal/release-verify 0.0.0-stage → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +81 -2
  3. package/dist/src/attestation.d.ts +42 -0
  4. package/dist/src/attestation.js +180 -0
  5. package/dist/src/crypto.d.ts +15 -0
  6. package/dist/src/crypto.js +87 -0
  7. package/dist/src/documents.d.ts +23 -0
  8. package/dist/src/documents.js +167 -0
  9. package/dist/src/errors.d.ts +13 -0
  10. package/dist/src/errors.js +48 -0
  11. package/dist/src/generated/release-keys.d.ts +67 -0
  12. package/dist/src/generated/release-keys.js +72 -0
  13. package/dist/src/generated/release-manifest.d.ts +211 -0
  14. package/dist/src/generated/release-manifest.js +237 -0
  15. package/dist/src/generated/release-statement.d.ts +61 -0
  16. package/dist/src/generated/release-statement.js +66 -0
  17. package/dist/src/generated/release-yank-list.d.ts +73 -0
  18. package/dist/src/generated/release-yank-list.js +78 -0
  19. package/dist/src/generated/validators.d.ts +22 -0
  20. package/dist/src/generated/validators.js +5656 -0
  21. package/dist/src/index.d.ts +22 -0
  22. package/dist/src/index.js +48 -0
  23. package/dist/src/keys.d.ts +28 -0
  24. package/dist/src/keys.js +84 -0
  25. package/dist/src/limits.d.ts +24 -0
  26. package/dist/src/limits.js +30 -0
  27. package/dist/src/paths.d.ts +14 -0
  28. package/dist/src/paths.js +59 -0
  29. package/dist/src/scopes.d.ts +10 -0
  30. package/dist/src/scopes.js +22 -0
  31. package/dist/src/tar.d.ts +31 -0
  32. package/dist/src/tar.js +398 -0
  33. package/dist/src/trust.d.ts +67 -0
  34. package/dist/src/trust.js +248 -0
  35. package/dist/src/urls.d.ts +8 -0
  36. package/dist/src/urls.js +37 -0
  37. package/dist/src/verify.d.ts +68 -0
  38. package/dist/src/verify.js +171 -0
  39. package/dist/src/yank-memory.d.ts +22 -0
  40. package/dist/src/yank-memory.js +106 -0
  41. package/package.json +51 -3
@@ -0,0 +1,237 @@
1
+ /* eslint-disable */
2
+ /* biome-ignore-all lint: generated */
3
+ /**
4
+ * GENERATED FILE — DO NOT EDIT.
5
+ * Source: packages/core-contracts/schemas/release-{manifest,statement,keys,yank-list}.schema.json
6
+ * (run `pnpm gen`; packages/release-verify/scripts/gen-validators.ts)
7
+ */
8
+ /* biome-ignore-all lint: generated */
9
+ /**
10
+ * GENERATED FILE — DO NOT EDIT.
11
+ * Source: packages/core-contracts/schemas/*.schema.json (run `pnpm gen`)
12
+ */
13
+
14
+ /**
15
+ * Version of this contract. Readers reject unknown versions; migrations move documents forward one version at a time.
16
+ *
17
+ * This interface was referenced by `ReleaseManifest`'s JSON-Schema
18
+ * via the `definition` "SchemaVersion".
19
+ */
20
+
21
+ /**
22
+ * This interface was referenced by `ReleaseManifest`'s JSON-Schema
23
+ * via the `definition` "CloudhalVersion".
24
+ */
25
+
26
+ /**
27
+ * RFC 3339 / ISO 8601 instant in UTC.
28
+ *
29
+ * This interface was referenced by `ReleaseManifest`'s JSON-Schema
30
+ * via the `definition` "Timestamp".
31
+ */
32
+
33
+ /**
34
+ * This interface was referenced by `ReleaseManifest`'s JSON-Schema
35
+ * via the `definition` "MigrationName".
36
+ */
37
+
38
+ /**
39
+ * This interface was referenced by `ReleaseManifest`'s JSON-Schema
40
+ * via the `definition` "BindingName".
41
+ */
42
+
43
+ /**
44
+ * This interface was referenced by `ReleaseManifest`'s JSON-Schema
45
+ * via the `definition` "Sha256Hex".
46
+ */
47
+
48
+ /**
49
+ * This interface was referenced by `ReleaseManifest`'s JSON-Schema
50
+ * via the `definition` "SecretName".
51
+ */
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+ /**
61
+ * This interface was referenced by `ReleaseManifest`'s JSON-Schema
62
+ * via the `definition` "ScopeId".
63
+ */
64
+
65
+ /**
66
+ * This interface was referenced by `ReleaseManifest`'s JSON-Schema
67
+ * via the `definition` "Capability".
68
+ */
69
+
70
+ /**
71
+ * This interface was referenced by `ReleaseManifest`'s JSON-Schema
72
+ * via the `definition` "SiteId".
73
+ */
74
+
75
+
76
+ /**
77
+ * cloudhal.release-manifest@1 (RFC-0046): the manifest of one Cloudhal release bundle, published as the release asset manifest.json next to the gzip tarball cloudhal-release-<version>.tar.gz. A project release is signed through release-statement.json, which pins this file's SHA-256 and size (signing.signature = release-statement.sig); the legacy form manifest.sig, a raw 64-byte Ed25519 signature over these exact bytes, is for development keys only. It describes every built Worker module and static asset by size and SHA-256, the binding templates, feature levels, migration range and rollback facts a remote deployer needs to install, update or refuse a version without running a build. Portable on purpose: it references common only for SchemaVersion and Timestamp; every other definition is local.
78
+ */
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+ /**
167
+ * This interface was referenced by `ReleaseManifest`'s JSON-Schema
168
+ * via the `definition` "WorkerArtifact".
169
+ */
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+ /**
211
+ * This interface was referenced by `ReleaseManifest`'s JSON-Schema
212
+ * via the `definition` "BindingTemplate".
213
+ */
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
@@ -0,0 +1,61 @@
1
+ /**
2
+ * GENERATED FILE — DO NOT EDIT.
3
+ * Source: packages/core-contracts/schemas/release-{manifest,statement,keys,yank-list}.schema.json
4
+ * (run `pnpm gen`; packages/release-verify/scripts/gen-validators.ts)
5
+ */
6
+ /**
7
+ * GENERATED FILE — DO NOT EDIT.
8
+ * Source: packages/core-contracts/schemas/*.schema.json (run `pnpm gen`)
9
+ */
10
+ /**
11
+ * Version of this contract. Readers reject unknown versions; migrations move documents forward one version at a time.
12
+ *
13
+ * This interface was referenced by `ReleaseStatement`'s JSON-Schema
14
+ * via the `definition` "SchemaVersion".
15
+ */
16
+ export type SchemaVersion = 1;
17
+ /**
18
+ * This interface was referenced by `ReleaseStatement`'s JSON-Schema
19
+ * via the `definition` "CloudhalVersion".
20
+ */
21
+ export type CloudhalVersion = string;
22
+ /**
23
+ * RFC 3339 / ISO 8601 instant in UTC.
24
+ *
25
+ * This interface was referenced by `ReleaseStatement`'s JSON-Schema
26
+ * via the `definition` "Timestamp".
27
+ */
28
+ export type Timestamp = string;
29
+ /**
30
+ * This interface was referenced by `ReleaseStatement`'s JSON-Schema
31
+ * via the `definition` "Sha256Hex".
32
+ */
33
+ export type Sha256Hex = string;
34
+ /**
35
+ * cloudhal.release-statement@1 (RFC-0046): the small canonical document a Cloudhal release signs, published as the release asset release-statement.json next to release-statement.sig (a raw 64-byte Ed25519 signature over the exact bytes, at most 4096 of them). It names the version, channel, commit and key id and pins the SHA-256 and size of manifest.json and of the tarball, so a remote deployer verifies one small file and then checks every other asset by digest. Canonical bytes: keys sorted recursively, 2-space indent, a trailing newline; a consumer verifies the bytes it downloaded and never re-serialises them. Portable on purpose: it references common only for SchemaVersion and Timestamp.
36
+ */
37
+ export interface ReleaseStatement {
38
+ schemaVersion: SchemaVersion;
39
+ format: "cloudhal.release-statement@1";
40
+ version: CloudhalVersion;
41
+ channel: "stable" | "next";
42
+ securityRelease: boolean;
43
+ commit: string;
44
+ createdAt: Timestamp;
45
+ signing: {
46
+ keyId: string;
47
+ algorithm: "Ed25519";
48
+ signature: "release-statement.sig";
49
+ };
50
+ manifest: StatementAsset;
51
+ tarball: StatementAsset;
52
+ }
53
+ /**
54
+ * This interface was referenced by `ReleaseStatement`'s JSON-Schema
55
+ * via the `definition` "StatementAsset".
56
+ */
57
+ export interface StatementAsset {
58
+ name: string;
59
+ sha256: Sha256Hex;
60
+ bytes: number;
61
+ }
@@ -0,0 +1,66 @@
1
+ /* eslint-disable */
2
+ /* biome-ignore-all lint: generated */
3
+ /**
4
+ * GENERATED FILE — DO NOT EDIT.
5
+ * Source: packages/core-contracts/schemas/release-{manifest,statement,keys,yank-list}.schema.json
6
+ * (run `pnpm gen`; packages/release-verify/scripts/gen-validators.ts)
7
+ */
8
+ /* biome-ignore-all lint: generated */
9
+ /**
10
+ * GENERATED FILE — DO NOT EDIT.
11
+ * Source: packages/core-contracts/schemas/*.schema.json (run `pnpm gen`)
12
+ */
13
+
14
+ /**
15
+ * Version of this contract. Readers reject unknown versions; migrations move documents forward one version at a time.
16
+ *
17
+ * This interface was referenced by `ReleaseStatement`'s JSON-Schema
18
+ * via the `definition` "SchemaVersion".
19
+ */
20
+
21
+ /**
22
+ * This interface was referenced by `ReleaseStatement`'s JSON-Schema
23
+ * via the `definition` "CloudhalVersion".
24
+ */
25
+
26
+ /**
27
+ * RFC 3339 / ISO 8601 instant in UTC.
28
+ *
29
+ * This interface was referenced by `ReleaseStatement`'s JSON-Schema
30
+ * via the `definition` "Timestamp".
31
+ */
32
+
33
+ /**
34
+ * This interface was referenced by `ReleaseStatement`'s JSON-Schema
35
+ * via the `definition` "Sha256Hex".
36
+ */
37
+
38
+
39
+ /**
40
+ * cloudhal.release-statement@1 (RFC-0046): the small canonical document a Cloudhal release signs, published as the release asset release-statement.json next to release-statement.sig (a raw 64-byte Ed25519 signature over the exact bytes, at most 4096 of them). It names the version, channel, commit and key id and pins the SHA-256 and size of manifest.json and of the tarball, so a remote deployer verifies one small file and then checks every other asset by digest. Canonical bytes: keys sorted recursively, 2-space indent, a trailing newline; a consumer verifies the bytes it downloaded and never re-serialises them. Portable on purpose: it references common only for SchemaVersion and Timestamp.
41
+ */
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+ /**
59
+ * This interface was referenced by `ReleaseStatement`'s JSON-Schema
60
+ * via the `definition` "StatementAsset".
61
+ */
62
+
63
+
64
+
65
+
66
+
@@ -0,0 +1,73 @@
1
+ /**
2
+ * GENERATED FILE — DO NOT EDIT.
3
+ * Source: packages/core-contracts/schemas/release-{manifest,statement,keys,yank-list}.schema.json
4
+ * (run `pnpm gen`; packages/release-verify/scripts/gen-validators.ts)
5
+ */
6
+ /**
7
+ * GENERATED FILE — DO NOT EDIT.
8
+ * Source: packages/core-contracts/schemas/*.schema.json (run `pnpm gen`)
9
+ */
10
+ /**
11
+ * Version of this contract. Readers reject unknown versions; migrations move documents forward one version at a time.
12
+ *
13
+ * This interface was referenced by `ReleaseYankList`'s JSON-Schema
14
+ * via the `definition` "SchemaVersion".
15
+ */
16
+ export type SchemaVersion = 1;
17
+ /**
18
+ * RFC 3339 / ISO 8601 instant in UTC.
19
+ *
20
+ * This interface was referenced by `ReleaseYankList`'s JSON-Schema
21
+ * via the `definition` "Timestamp".
22
+ */
23
+ export type Timestamp = string;
24
+ /**
25
+ * This interface was referenced by `ReleaseYankList`'s JSON-Schema
26
+ * via the `definition` "CloudhalVersion".
27
+ */
28
+ export type CloudhalVersion = string;
29
+ /**
30
+ * This interface was referenced by `ReleaseYankList`'s JSON-Schema
31
+ * via the `definition` "KeyId".
32
+ */
33
+ export type KeyId = string;
34
+ /**
35
+ * cloudhal.release-yank-list@1 (RFC-0046 §9): the yank list, published as yanked.json at https://cloudhal.dev/.well-known/cloudhal/yanked.json next to yanked.json.sig (a raw 64-byte Ed25519 signature by a yank-role key from keys.json over the exact bytes). It only reduces trust: versions no consumer may install, and release key ids every consumer must refuse. Re-signed weekly; it expires 30 days after issuedAt, and a stale list blocks new installs only.
36
+ */
37
+ export interface ReleaseYankList {
38
+ schemaVersion: SchemaVersion;
39
+ format: "cloudhal.release-yank-list@1";
40
+ /**
41
+ * Increases by one at every signing. A consumer that keeps state refuses a serial lower than the last one it saw (a rollback to an older, validly signed list).
42
+ */
43
+ serial: number;
44
+ issuedAt: Timestamp;
45
+ /**
46
+ * RFC 3339 / ISO 8601 instant in UTC.
47
+ */
48
+ expires: string;
49
+ signing: {
50
+ /**
51
+ * The yank-role key that signed this list.
52
+ */
53
+ keyId: string;
54
+ algorithm: "Ed25519";
55
+ signature: "yanked.json.sig";
56
+ };
57
+ /**
58
+ * @maxItems 1000
59
+ */
60
+ versions: {
61
+ version: CloudhalVersion;
62
+ yankedAt: Timestamp;
63
+ reason: string;
64
+ }[];
65
+ /**
66
+ * @maxItems 64
67
+ */
68
+ revokedKeys: {
69
+ keyId: KeyId;
70
+ revokedAt: Timestamp;
71
+ reason: string;
72
+ }[];
73
+ }
@@ -0,0 +1,78 @@
1
+ /* eslint-disable */
2
+ /* biome-ignore-all lint: generated */
3
+ /**
4
+ * GENERATED FILE — DO NOT EDIT.
5
+ * Source: packages/core-contracts/schemas/release-{manifest,statement,keys,yank-list}.schema.json
6
+ * (run `pnpm gen`; packages/release-verify/scripts/gen-validators.ts)
7
+ */
8
+ /* biome-ignore-all lint: generated */
9
+ /**
10
+ * GENERATED FILE — DO NOT EDIT.
11
+ * Source: packages/core-contracts/schemas/*.schema.json (run `pnpm gen`)
12
+ */
13
+
14
+ /**
15
+ * Version of this contract. Readers reject unknown versions; migrations move documents forward one version at a time.
16
+ *
17
+ * This interface was referenced by `ReleaseYankList`'s JSON-Schema
18
+ * via the `definition` "SchemaVersion".
19
+ */
20
+
21
+ /**
22
+ * RFC 3339 / ISO 8601 instant in UTC.
23
+ *
24
+ * This interface was referenced by `ReleaseYankList`'s JSON-Schema
25
+ * via the `definition` "Timestamp".
26
+ */
27
+
28
+ /**
29
+ * This interface was referenced by `ReleaseYankList`'s JSON-Schema
30
+ * via the `definition` "CloudhalVersion".
31
+ */
32
+
33
+ /**
34
+ * This interface was referenced by `ReleaseYankList`'s JSON-Schema
35
+ * via the `definition` "KeyId".
36
+ */
37
+
38
+
39
+ /**
40
+ * cloudhal.release-yank-list@1 (RFC-0046 §9): the yank list, published as yanked.json at https://cloudhal.dev/.well-known/cloudhal/yanked.json next to yanked.json.sig (a raw 64-byte Ed25519 signature by a yank-role key from keys.json over the exact bytes). It only reduces trust: versions no consumer may install, and release key ids every consumer must refuse. Re-signed weekly; it expires 30 days after issuedAt, and a stale list blocks new installs only.
41
+ */
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
@@ -0,0 +1,22 @@
1
+ /* eslint-disable */
2
+ /* biome-ignore-all lint: generated */
3
+ /**
4
+ * GENERATED FILE — DO NOT EDIT.
5
+ * Source: packages/core-contracts/schemas/release-{manifest,statement,keys,yank-list}.schema.json
6
+ * (run `pnpm gen`; packages/release-verify/scripts/gen-validators.ts)
7
+ */
8
+
9
+ import type { ReleaseKeys } from "./release-keys.js";
10
+ import type { ReleaseManifest } from "./release-manifest.js";
11
+ import type { ReleaseStatement } from "./release-statement.js";
12
+ import type { ReleaseYankList } from "./release-yank-list.js";
13
+
14
+ export interface StandaloneValidator<T> {
15
+ (data: unknown): data is T;
16
+ errors?: { instancePath: string; message?: string }[] | null;
17
+ }
18
+
19
+ export declare const validateReleaseManifest: StandaloneValidator<ReleaseManifest>;
20
+ export declare const validateReleaseStatement: StandaloneValidator<ReleaseStatement>;
21
+ export declare const validateReleaseKeys: StandaloneValidator<ReleaseKeys>;
22
+ export declare const validateReleaseYankList: StandaloneValidator<ReleaseYankList>;