@cloudhal/core-contracts 0.8.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/gen-ts.js +12 -4
- package/dist/scripts/schema-list.d.ts +9 -1
- package/dist/scripts/schema-list.js +18 -0
- package/dist/src/generated/index.d.ts +4 -0
- package/dist/src/generated/index.js +4 -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-manifest.d.ts +206 -0
- package/dist/src/generated/release-manifest.js +231 -0
- package/dist/src/generated/release-statement.d.ts +56 -0
- package/dist/src/generated/release-statement.js +60 -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 +2617 -937
- package/dist/src/generated/schemas.js +1108 -0
- package/dist/src/generated/validators.d.ts +5 -1
- package/dist/src/generated/validators.js +5640 -0
- package/dist/src/validate.d.ts +5 -1
- package/dist/src/validate.js +12 -0
- package/package.json +1 -1
- package/schemas/release-keys.schema.json +86 -0
- package/schemas/release-manifest.schema.json +571 -0
- package/schemas/release-statement.schema.json +100 -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, 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;
|
|
@@ -23,6 +23,10 @@ export interface ContractTypes {
|
|
|
23
23
|
automation: Automation;
|
|
24
24
|
"schedule-run": ScheduleRun;
|
|
25
25
|
glossary: Glossary;
|
|
26
|
+
"release-manifest": ReleaseManifest;
|
|
27
|
+
"release-statement": ReleaseStatement;
|
|
28
|
+
"release-keys": ReleaseKeys;
|
|
29
|
+
"release-yank-list": ReleaseYankList;
|
|
26
30
|
}
|
|
27
31
|
export declare class ContractValidationError extends Error {
|
|
28
32
|
readonly name = "ContractValidationError";
|
package/dist/src/validate.js
CHANGED
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
17
21
|
|
|
18
22
|
|
|
19
23
|
|
|
@@ -46,6 +50,10 @@ import * as v from "./generated/validators.js";
|
|
|
46
50
|
|
|
47
51
|
|
|
48
52
|
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
49
57
|
|
|
50
58
|
|
|
51
59
|
const validators = {
|
|
@@ -69,6 +77,10 @@ const validators
|
|
|
69
77
|
automation: v.validateAutomation,
|
|
70
78
|
"schedule-run": v.validateScheduleRun,
|
|
71
79
|
glossary: v.validateGlossary,
|
|
80
|
+
"release-manifest": v.validateReleaseManifest,
|
|
81
|
+
"release-statement": v.validateReleaseStatement,
|
|
82
|
+
"release-keys": v.validateReleaseKeys,
|
|
83
|
+
"release-yank-list": v.validateReleaseYankList,
|
|
72
84
|
};
|
|
73
85
|
|
|
74
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
|
+
}
|