@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
|
@@ -9466,6 +9466,280 @@ export const ReleaseStatementSchema = {
|
|
|
9466
9466
|
}
|
|
9467
9467
|
} ;
|
|
9468
9468
|
|
|
9469
|
+
export const ReleaseKeysSchema = {
|
|
9470
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
9471
|
+
"$id": "https://cloudhal.dev/schemas/v1/release-keys.schema.json",
|
|
9472
|
+
"title": "ReleaseKeys",
|
|
9473
|
+
"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.",
|
|
9474
|
+
"type": "object",
|
|
9475
|
+
"additionalProperties": false,
|
|
9476
|
+
"required": [
|
|
9477
|
+
"schemaVersion",
|
|
9478
|
+
"format",
|
|
9479
|
+
"issuedAt",
|
|
9480
|
+
"expires",
|
|
9481
|
+
"signing",
|
|
9482
|
+
"keys"
|
|
9483
|
+
],
|
|
9484
|
+
"properties": {
|
|
9485
|
+
"schemaVersion": {
|
|
9486
|
+
"$ref": "#/$defs/SchemaVersion"
|
|
9487
|
+
},
|
|
9488
|
+
"format": {
|
|
9489
|
+
"type": "string",
|
|
9490
|
+
"enum": [
|
|
9491
|
+
"cloudhal.release-keys@1"
|
|
9492
|
+
]
|
|
9493
|
+
},
|
|
9494
|
+
"issuedAt": {
|
|
9495
|
+
"$ref": "#/$defs/Timestamp"
|
|
9496
|
+
},
|
|
9497
|
+
"expires": {
|
|
9498
|
+
"description": "At most 13 months after issuedAt; a consumer refuses an expired list.",
|
|
9499
|
+
"$ref": "#/$defs/Timestamp"
|
|
9500
|
+
},
|
|
9501
|
+
"signing": {
|
|
9502
|
+
"type": "object",
|
|
9503
|
+
"additionalProperties": false,
|
|
9504
|
+
"required": [
|
|
9505
|
+
"keyId",
|
|
9506
|
+
"algorithm",
|
|
9507
|
+
"signature"
|
|
9508
|
+
],
|
|
9509
|
+
"properties": {
|
|
9510
|
+
"keyId": {
|
|
9511
|
+
"description": "The root key that signed this list.",
|
|
9512
|
+
"$ref": "#/$defs/KeyId"
|
|
9513
|
+
},
|
|
9514
|
+
"algorithm": {
|
|
9515
|
+
"type": "string",
|
|
9516
|
+
"enum": [
|
|
9517
|
+
"Ed25519"
|
|
9518
|
+
]
|
|
9519
|
+
},
|
|
9520
|
+
"signature": {
|
|
9521
|
+
"type": "string",
|
|
9522
|
+
"enum": [
|
|
9523
|
+
"keys.json.sig"
|
|
9524
|
+
]
|
|
9525
|
+
}
|
|
9526
|
+
}
|
|
9527
|
+
},
|
|
9528
|
+
"keys": {
|
|
9529
|
+
"type": "array",
|
|
9530
|
+
"maxItems": 64,
|
|
9531
|
+
"items": {
|
|
9532
|
+
"$ref": "#/$defs/ListedKey"
|
|
9533
|
+
}
|
|
9534
|
+
}
|
|
9535
|
+
},
|
|
9536
|
+
"$defs": {
|
|
9537
|
+
"KeyId": {
|
|
9538
|
+
"type": "string",
|
|
9539
|
+
"pattern": "^[a-z0-9][a-z0-9-]{2,63}$"
|
|
9540
|
+
},
|
|
9541
|
+
"ListedKey": {
|
|
9542
|
+
"type": "object",
|
|
9543
|
+
"additionalProperties": false,
|
|
9544
|
+
"required": [
|
|
9545
|
+
"keyId",
|
|
9546
|
+
"publicKey",
|
|
9547
|
+
"role",
|
|
9548
|
+
"notBefore",
|
|
9549
|
+
"notAfter",
|
|
9550
|
+
"status"
|
|
9551
|
+
],
|
|
9552
|
+
"properties": {
|
|
9553
|
+
"keyId": {
|
|
9554
|
+
"$ref": "#/$defs/KeyId"
|
|
9555
|
+
},
|
|
9556
|
+
"publicKey": {
|
|
9557
|
+
"description": "The raw 32-byte Ed25519 public key, base64.",
|
|
9558
|
+
"type": "string",
|
|
9559
|
+
"pattern": "^[A-Za-z0-9+/]{43}=$"
|
|
9560
|
+
},
|
|
9561
|
+
"role": {
|
|
9562
|
+
"type": "string",
|
|
9563
|
+
"enum": [
|
|
9564
|
+
"release",
|
|
9565
|
+
"yank"
|
|
9566
|
+
]
|
|
9567
|
+
},
|
|
9568
|
+
"notBefore": {
|
|
9569
|
+
"$ref": "#/$defs/Timestamp"
|
|
9570
|
+
},
|
|
9571
|
+
"notAfter": {
|
|
9572
|
+
"$ref": "#/$defs/Timestamp"
|
|
9573
|
+
},
|
|
9574
|
+
"status": {
|
|
9575
|
+
"type": "string",
|
|
9576
|
+
"enum": [
|
|
9577
|
+
"active",
|
|
9578
|
+
"retiring",
|
|
9579
|
+
"revoked"
|
|
9580
|
+
]
|
|
9581
|
+
}
|
|
9582
|
+
}
|
|
9583
|
+
},
|
|
9584
|
+
"SchemaVersion": {
|
|
9585
|
+
"type": "integer",
|
|
9586
|
+
"description": "Version of this contract. Readers reject unknown versions; migrations move documents forward one version at a time.",
|
|
9587
|
+
"enum": [
|
|
9588
|
+
1
|
|
9589
|
+
]
|
|
9590
|
+
},
|
|
9591
|
+
"Timestamp": {
|
|
9592
|
+
"type": "string",
|
|
9593
|
+
"description": "RFC 3339 / ISO 8601 instant in UTC.",
|
|
9594
|
+
"format": "date-time"
|
|
9595
|
+
}
|
|
9596
|
+
}
|
|
9597
|
+
} ;
|
|
9598
|
+
|
|
9599
|
+
export const ReleaseYankListSchema = {
|
|
9600
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
9601
|
+
"$id": "https://cloudhal.dev/schemas/v1/release-yank-list.schema.json",
|
|
9602
|
+
"title": "ReleaseYankList",
|
|
9603
|
+
"description": "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.",
|
|
9604
|
+
"type": "object",
|
|
9605
|
+
"additionalProperties": false,
|
|
9606
|
+
"required": [
|
|
9607
|
+
"schemaVersion",
|
|
9608
|
+
"format",
|
|
9609
|
+
"serial",
|
|
9610
|
+
"issuedAt",
|
|
9611
|
+
"expires",
|
|
9612
|
+
"signing",
|
|
9613
|
+
"versions",
|
|
9614
|
+
"revokedKeys"
|
|
9615
|
+
],
|
|
9616
|
+
"properties": {
|
|
9617
|
+
"schemaVersion": {
|
|
9618
|
+
"$ref": "#/$defs/SchemaVersion"
|
|
9619
|
+
},
|
|
9620
|
+
"format": {
|
|
9621
|
+
"type": "string",
|
|
9622
|
+
"enum": [
|
|
9623
|
+
"cloudhal.release-yank-list@1"
|
|
9624
|
+
]
|
|
9625
|
+
},
|
|
9626
|
+
"serial": {
|
|
9627
|
+
"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).",
|
|
9628
|
+
"type": "integer",
|
|
9629
|
+
"minimum": 1,
|
|
9630
|
+
"maximum": 9007199254740991
|
|
9631
|
+
},
|
|
9632
|
+
"issuedAt": {
|
|
9633
|
+
"$ref": "#/$defs/Timestamp"
|
|
9634
|
+
},
|
|
9635
|
+
"expires": {
|
|
9636
|
+
"description": "Exactly 30 days after issuedAt.",
|
|
9637
|
+
"$ref": "#/$defs/Timestamp"
|
|
9638
|
+
},
|
|
9639
|
+
"signing": {
|
|
9640
|
+
"type": "object",
|
|
9641
|
+
"additionalProperties": false,
|
|
9642
|
+
"required": [
|
|
9643
|
+
"keyId",
|
|
9644
|
+
"algorithm",
|
|
9645
|
+
"signature"
|
|
9646
|
+
],
|
|
9647
|
+
"properties": {
|
|
9648
|
+
"keyId": {
|
|
9649
|
+
"description": "The yank-role key that signed this list.",
|
|
9650
|
+
"$ref": "#/$defs/KeyId"
|
|
9651
|
+
},
|
|
9652
|
+
"algorithm": {
|
|
9653
|
+
"type": "string",
|
|
9654
|
+
"enum": [
|
|
9655
|
+
"Ed25519"
|
|
9656
|
+
]
|
|
9657
|
+
},
|
|
9658
|
+
"signature": {
|
|
9659
|
+
"type": "string",
|
|
9660
|
+
"enum": [
|
|
9661
|
+
"yanked.json.sig"
|
|
9662
|
+
]
|
|
9663
|
+
}
|
|
9664
|
+
}
|
|
9665
|
+
},
|
|
9666
|
+
"versions": {
|
|
9667
|
+
"type": "array",
|
|
9668
|
+
"maxItems": 1000,
|
|
9669
|
+
"items": {
|
|
9670
|
+
"type": "object",
|
|
9671
|
+
"additionalProperties": false,
|
|
9672
|
+
"required": [
|
|
9673
|
+
"version",
|
|
9674
|
+
"yankedAt",
|
|
9675
|
+
"reason"
|
|
9676
|
+
],
|
|
9677
|
+
"properties": {
|
|
9678
|
+
"version": {
|
|
9679
|
+
"$ref": "#/$defs/CloudhalVersion"
|
|
9680
|
+
},
|
|
9681
|
+
"yankedAt": {
|
|
9682
|
+
"$ref": "#/$defs/Timestamp"
|
|
9683
|
+
},
|
|
9684
|
+
"reason": {
|
|
9685
|
+
"type": "string",
|
|
9686
|
+
"minLength": 1,
|
|
9687
|
+
"maxLength": 500
|
|
9688
|
+
}
|
|
9689
|
+
}
|
|
9690
|
+
}
|
|
9691
|
+
},
|
|
9692
|
+
"revokedKeys": {
|
|
9693
|
+
"type": "array",
|
|
9694
|
+
"maxItems": 64,
|
|
9695
|
+
"items": {
|
|
9696
|
+
"type": "object",
|
|
9697
|
+
"additionalProperties": false,
|
|
9698
|
+
"required": [
|
|
9699
|
+
"keyId",
|
|
9700
|
+
"revokedAt",
|
|
9701
|
+
"reason"
|
|
9702
|
+
],
|
|
9703
|
+
"properties": {
|
|
9704
|
+
"keyId": {
|
|
9705
|
+
"$ref": "#/$defs/KeyId"
|
|
9706
|
+
},
|
|
9707
|
+
"revokedAt": {
|
|
9708
|
+
"$ref": "#/$defs/Timestamp"
|
|
9709
|
+
},
|
|
9710
|
+
"reason": {
|
|
9711
|
+
"type": "string",
|
|
9712
|
+
"minLength": 1,
|
|
9713
|
+
"maxLength": 500
|
|
9714
|
+
}
|
|
9715
|
+
}
|
|
9716
|
+
}
|
|
9717
|
+
}
|
|
9718
|
+
},
|
|
9719
|
+
"$defs": {
|
|
9720
|
+
"CloudhalVersion": {
|
|
9721
|
+
"type": "string",
|
|
9722
|
+
"pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]+)?$"
|
|
9723
|
+
},
|
|
9724
|
+
"KeyId": {
|
|
9725
|
+
"type": "string",
|
|
9726
|
+
"pattern": "^[a-z0-9][a-z0-9-]{2,63}$"
|
|
9727
|
+
},
|
|
9728
|
+
"SchemaVersion": {
|
|
9729
|
+
"type": "integer",
|
|
9730
|
+
"description": "Version of this contract. Readers reject unknown versions; migrations move documents forward one version at a time.",
|
|
9731
|
+
"enum": [
|
|
9732
|
+
1
|
|
9733
|
+
]
|
|
9734
|
+
},
|
|
9735
|
+
"Timestamp": {
|
|
9736
|
+
"type": "string",
|
|
9737
|
+
"description": "RFC 3339 / ISO 8601 instant in UTC.",
|
|
9738
|
+
"format": "date-time"
|
|
9739
|
+
}
|
|
9740
|
+
}
|
|
9741
|
+
} ;
|
|
9742
|
+
|
|
9469
9743
|
export const schemas = {
|
|
9470
9744
|
"project": ProjectSchema,
|
|
9471
9745
|
"site": SiteSchema,
|
|
@@ -9489,4 +9763,6 @@ export const schemas = {
|
|
|
9489
9763
|
"glossary": GlossarySchema,
|
|
9490
9764
|
"release-manifest": ReleaseManifestSchema,
|
|
9491
9765
|
"release-statement": ReleaseStatementSchema,
|
|
9766
|
+
"release-keys": ReleaseKeysSchema,
|
|
9767
|
+
"release-yank-list": ReleaseYankListSchema,
|
|
9492
9768
|
} ;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import type { ErrorObject } from "ajv";
|
|
9
|
-
import type { Project, Site, Page, Section, ContentEntry, Snapshot, SkillManifest, Taxonomy, Term, Redirect, Asset, Menu, AnalyticsEvent, AnalyticsBeacon, Comment, CommentSubmission, Release, Automation, ScheduleRun, Glossary, ReleaseManifest, ReleaseStatement } from "./index.js";
|
|
9
|
+
import type { Project, Site, Page, Section, ContentEntry, Snapshot, SkillManifest, Taxonomy, Term, Redirect, Asset, Menu, AnalyticsEvent, AnalyticsBeacon, Comment, CommentSubmission, Release, Automation, ScheduleRun, Glossary, ReleaseManifest, ReleaseStatement, ReleaseKeys, ReleaseYankList } from "./index.js";
|
|
10
10
|
|
|
11
11
|
export interface StandaloneValidator<T> {
|
|
12
12
|
(data: unknown): data is T;
|
|
@@ -35,3 +35,5 @@ export declare const validateScheduleRun: StandaloneValidator<ScheduleRun>;
|
|
|
35
35
|
export declare const validateGlossary: StandaloneValidator<Glossary>;
|
|
36
36
|
export declare const validateReleaseManifest: StandaloneValidator<ReleaseManifest>;
|
|
37
37
|
export declare const validateReleaseStatement: StandaloneValidator<ReleaseStatement>;
|
|
38
|
+
export declare const validateReleaseKeys: StandaloneValidator<ReleaseKeys>;
|
|
39
|
+
export declare const validateReleaseYankList: StandaloneValidator<ReleaseYankList>;
|