@cloudhal/core-contracts 0.9.0 → 0.10.0
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.
- package/dist/scripts/schema-list.d.ts +1 -1
- package/dist/scripts/schema-list.js +4 -0
- package/dist/src/generated/index.d.ts +2 -0
- package/dist/src/generated/index.js +2 -0
- package/dist/src/generated/release-keys.d.ts +62 -0
- package/dist/src/generated/release-keys.js +66 -0
- package/dist/src/generated/release-yank-list.d.ts +68 -0
- package/dist/src/generated/release-yank-list.js +72 -0
- package/dist/src/generated/schemas.d.ts +420 -0
- package/dist/src/generated/schemas.js +276 -0
- package/dist/src/generated/validators.d.ts +3 -1
- package/dist/src/generated/validators.js +1332 -0
- package/dist/src/validate.d.ts +3 -1
- package/dist/src/validate.js +6 -0
- package/package.json +1 -1
- package/schemas/release-keys.schema.json +86 -0
- package/schemas/release-yank-list.schema.json +113 -0
package/dist/src/validate.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ErrorObject } from "ajv";
|
|
2
2
|
import type { RootSchemaName } from "../scripts/schema-list.js";
|
|
3
|
-
import type { AnalyticsBeacon, AnalyticsEvent, Asset, Automation, Comment, CommentSubmission, ContentEntry, Glossary, Menu, Page, Project, Redirect, Release, ReleaseManifest, ReleaseStatement, ScheduleRun, Section, Site, SkillManifest, Snapshot, Taxonomy, Term } from "./generated/index.js";
|
|
3
|
+
import type { AnalyticsBeacon, AnalyticsEvent, Asset, Automation, Comment, CommentSubmission, ContentEntry, Glossary, Menu, Page, Project, Redirect, Release, ReleaseKeys, ReleaseManifest, ReleaseStatement, ReleaseYankList, ScheduleRun, Section, Site, SkillManifest, Snapshot, Taxonomy, Term } from "./generated/index.js";
|
|
4
4
|
/** Map from contract name to its TypeScript type. */
|
|
5
5
|
export interface ContractTypes {
|
|
6
6
|
project: Project;
|
|
@@ -25,6 +25,8 @@ export interface ContractTypes {
|
|
|
25
25
|
glossary: Glossary;
|
|
26
26
|
"release-manifest": ReleaseManifest;
|
|
27
27
|
"release-statement": ReleaseStatement;
|
|
28
|
+
"release-keys": ReleaseKeys;
|
|
29
|
+
"release-yank-list": ReleaseYankList;
|
|
28
30
|
}
|
|
29
31
|
export declare class ContractValidationError extends Error {
|
|
30
32
|
readonly name = "ContractValidationError";
|
package/dist/src/validate.js
CHANGED
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
|
|
17
18
|
|
|
18
19
|
|
|
20
|
+
|
|
19
21
|
|
|
20
22
|
|
|
21
23
|
|
|
@@ -50,6 +52,8 @@ import * as v from "./generated/validators.js";
|
|
|
50
52
|
|
|
51
53
|
|
|
52
54
|
|
|
55
|
+
|
|
56
|
+
|
|
53
57
|
|
|
54
58
|
|
|
55
59
|
const validators = {
|
|
@@ -75,6 +79,8 @@ const validators
|
|
|
75
79
|
glossary: v.validateGlossary,
|
|
76
80
|
"release-manifest": v.validateReleaseManifest,
|
|
77
81
|
"release-statement": v.validateReleaseStatement,
|
|
82
|
+
"release-keys": v.validateReleaseKeys,
|
|
83
|
+
"release-yank-list": v.validateReleaseYankList,
|
|
78
84
|
};
|
|
79
85
|
|
|
80
86
|
export class ContractValidationError extends Error {
|
package/package.json
CHANGED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://cloudhal.dev/schemas/v1/release-keys.schema.json",
|
|
4
|
+
"title": "ReleaseKeys",
|
|
5
|
+
"description": "cloudhal.release-keys@1 (RFC-0046 §9): the root-signed list of Cloudhal's release and yank keys, published as keys.json at https://cloudhal.dev/.well-known/cloudhal/keys.json next to keys.json.sig (a raw 64-byte Ed25519 signature by the offline root over the exact bytes). A consumer uses it only to reduce trust in the keys it pins: revoke, mark retiring, narrow a validity window; it never adds a key. Canonical bytes as for the release statement.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schemaVersion", "format", "issuedAt", "expires", "signing", "keys"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schemaVersion": {
|
|
11
|
+
"$ref": "common.schema.json#/$defs/SchemaVersion"
|
|
12
|
+
},
|
|
13
|
+
"format": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"enum": ["cloudhal.release-keys@1"]
|
|
16
|
+
},
|
|
17
|
+
"issuedAt": {
|
|
18
|
+
"$ref": "common.schema.json#/$defs/Timestamp"
|
|
19
|
+
},
|
|
20
|
+
"expires": {
|
|
21
|
+
"description": "At most 13 months after issuedAt; a consumer refuses an expired list.",
|
|
22
|
+
"$ref": "common.schema.json#/$defs/Timestamp"
|
|
23
|
+
},
|
|
24
|
+
"signing": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"required": ["keyId", "algorithm", "signature"],
|
|
28
|
+
"properties": {
|
|
29
|
+
"keyId": {
|
|
30
|
+
"description": "The root key that signed this list.",
|
|
31
|
+
"$ref": "#/$defs/KeyId"
|
|
32
|
+
},
|
|
33
|
+
"algorithm": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"enum": ["Ed25519"]
|
|
36
|
+
},
|
|
37
|
+
"signature": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"enum": ["keys.json.sig"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"keys": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"maxItems": 64,
|
|
46
|
+
"items": {
|
|
47
|
+
"$ref": "#/$defs/ListedKey"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"$defs": {
|
|
52
|
+
"KeyId": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"pattern": "^[a-z0-9][a-z0-9-]{2,63}$"
|
|
55
|
+
},
|
|
56
|
+
"ListedKey": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"additionalProperties": false,
|
|
59
|
+
"required": ["keyId", "publicKey", "role", "notBefore", "notAfter", "status"],
|
|
60
|
+
"properties": {
|
|
61
|
+
"keyId": {
|
|
62
|
+
"$ref": "#/$defs/KeyId"
|
|
63
|
+
},
|
|
64
|
+
"publicKey": {
|
|
65
|
+
"description": "The raw 32-byte Ed25519 public key, base64.",
|
|
66
|
+
"type": "string",
|
|
67
|
+
"pattern": "^[A-Za-z0-9+/]{43}=$"
|
|
68
|
+
},
|
|
69
|
+
"role": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"enum": ["release", "yank"]
|
|
72
|
+
},
|
|
73
|
+
"notBefore": {
|
|
74
|
+
"$ref": "common.schema.json#/$defs/Timestamp"
|
|
75
|
+
},
|
|
76
|
+
"notAfter": {
|
|
77
|
+
"$ref": "common.schema.json#/$defs/Timestamp"
|
|
78
|
+
},
|
|
79
|
+
"status": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"enum": ["active", "retiring", "revoked"]
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://cloudhal.dev/schemas/v1/release-yank-list.schema.json",
|
|
4
|
+
"title": "ReleaseYankList",
|
|
5
|
+
"description": "cloudhal.release-yank-list@1 (RFC-0046 \u00a79): 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.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"schemaVersion",
|
|
10
|
+
"format",
|
|
11
|
+
"serial",
|
|
12
|
+
"issuedAt",
|
|
13
|
+
"expires",
|
|
14
|
+
"signing",
|
|
15
|
+
"versions",
|
|
16
|
+
"revokedKeys"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"schemaVersion": {
|
|
20
|
+
"$ref": "common.schema.json#/$defs/SchemaVersion"
|
|
21
|
+
},
|
|
22
|
+
"format": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"enum": ["cloudhal.release-yank-list@1"]
|
|
25
|
+
},
|
|
26
|
+
"serial": {
|
|
27
|
+
"description": "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).",
|
|
28
|
+
"type": "integer",
|
|
29
|
+
"minimum": 1,
|
|
30
|
+
"maximum": 9007199254740991
|
|
31
|
+
},
|
|
32
|
+
"issuedAt": {
|
|
33
|
+
"$ref": "common.schema.json#/$defs/Timestamp"
|
|
34
|
+
},
|
|
35
|
+
"expires": {
|
|
36
|
+
"description": "Exactly 30 days after issuedAt.",
|
|
37
|
+
"$ref": "common.schema.json#/$defs/Timestamp"
|
|
38
|
+
},
|
|
39
|
+
"signing": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"additionalProperties": false,
|
|
42
|
+
"required": ["keyId", "algorithm", "signature"],
|
|
43
|
+
"properties": {
|
|
44
|
+
"keyId": {
|
|
45
|
+
"description": "The yank-role key that signed this list.",
|
|
46
|
+
"$ref": "#/$defs/KeyId"
|
|
47
|
+
},
|
|
48
|
+
"algorithm": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"enum": ["Ed25519"]
|
|
51
|
+
},
|
|
52
|
+
"signature": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"enum": ["yanked.json.sig"]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"versions": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"maxItems": 1000,
|
|
61
|
+
"items": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"required": ["version", "yankedAt", "reason"],
|
|
65
|
+
"properties": {
|
|
66
|
+
"version": {
|
|
67
|
+
"$ref": "#/$defs/CloudhalVersion"
|
|
68
|
+
},
|
|
69
|
+
"yankedAt": {
|
|
70
|
+
"$ref": "common.schema.json#/$defs/Timestamp"
|
|
71
|
+
},
|
|
72
|
+
"reason": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"minLength": 1,
|
|
75
|
+
"maxLength": 500
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"revokedKeys": {
|
|
81
|
+
"type": "array",
|
|
82
|
+
"maxItems": 64,
|
|
83
|
+
"items": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"required": ["keyId", "revokedAt", "reason"],
|
|
87
|
+
"properties": {
|
|
88
|
+
"keyId": {
|
|
89
|
+
"$ref": "#/$defs/KeyId"
|
|
90
|
+
},
|
|
91
|
+
"revokedAt": {
|
|
92
|
+
"$ref": "common.schema.json#/$defs/Timestamp"
|
|
93
|
+
},
|
|
94
|
+
"reason": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"minLength": 1,
|
|
97
|
+
"maxLength": 500
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"$defs": {
|
|
104
|
+
"KeyId": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"pattern": "^[a-z0-9][a-z0-9-]{2,63}$"
|
|
107
|
+
},
|
|
108
|
+
"CloudhalVersion": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]+)?$"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|