@openvtc/trust-tasks 0.21.1 → 0.21.2

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.
@@ -0,0 +1,273 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/attestation/config-report/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Asks an agent for fresh attestation evidence committing to the configuration it booted, bound to a nonce the verifier chose. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface VTAAttestationConfigReportPayload {
13
+ /**
14
+ * Thirty-two bytes the verifier generated for this request, lowercase hex. The agent binds exactly this into the evidence.
15
+ */
16
+ nonce: string;
17
+ /**
18
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
19
+ */
20
+ ext?: Ext;
21
+ }
22
+ export interface VTAAttestationConfigReportResponsePayload {
23
+ /**
24
+ * SHA-384 of the decoded configView bytes, base64 (standard). A convenience: the verifier recomputes it, and a mismatch with either the view or the evidence is a refusal.
25
+ */
26
+ configDigestSha384: string;
27
+ /**
28
+ * The canonical, secret-free view of the configuration the agent booted, base64 (standard): the exact bytes whose SHA-384 the evidence binds as its user data.
29
+ */
30
+ configView: string;
31
+ /**
32
+ * The request's nonce, echoed. A verifier checks the nonce inside the evidence, not this.
33
+ */
34
+ nonce: string;
35
+ /**
36
+ * The platform that produced the evidence. Informational and not covered by the evidence.
37
+ */
38
+ teeType: "nitro" | "sev-snp" | "simulated";
39
+ /**
40
+ * The platform's quote, base64 (a COSE_Sign1 attestation document for nitro).
41
+ */
42
+ evidence: string;
43
+ /**
44
+ * When the evidence was produced. Informational: freshness comes from the nonce.
45
+ */
46
+ generatedAt: string;
47
+ /**
48
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
49
+ */
50
+ ext?: Ext;
51
+ }
52
+
53
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
54
+ export type { Ext };
55
+
56
+ /** Trust Task type URI. */
57
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/attestation/config-report/0.1" as const;
58
+
59
+ /** Stable alias for this specification's request payload shape. */
60
+ export type Payload = VTAAttestationConfigReportPayload;
61
+
62
+ /** Trust Task response type URI (request type URI + "#response"). */
63
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/attestation/config-report/0.1#response" as const;
64
+
65
+ /** Stable alias for this specification's success-response payload shape. */
66
+ export type Response = VTAAttestationConfigReportResponsePayload;
67
+
68
+ /**
69
+ * This specification's payload schema, as a value.
70
+ *
71
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
72
+ * rather than only as a `.json` file because TypeScript types are erased
73
+ * at runtime: without a schema a consumer has nothing to validate, and
74
+ * every REQUIRED payload member is optional in practice. Cross-file
75
+ * `$ref`s are already inlined, so it needs no resolver.
76
+ */
77
+ export const PAYLOAD_SCHEMA = {
78
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
79
+ "$id": "https://trusttasks.org/spec/vta/attestation/config-report/0.1",
80
+ "title": "VTA Attestation — Config Report — payload",
81
+ "description": "Asks an agent for fresh attestation evidence committing to the configuration it booted, bound to a nonce the verifier chose. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "required": [
85
+ "nonce"
86
+ ],
87
+ "properties": {
88
+ "nonce": {
89
+ "type": "string",
90
+ "pattern": "^[0-9a-f]{64}$",
91
+ "description": "Thirty-two bytes the verifier generated for this request, lowercase hex. The agent binds exactly this into the evidence."
92
+ },
93
+ "ext": {
94
+ "$ref": "#/$defs/Ext",
95
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
96
+ }
97
+ },
98
+ "$defs": {
99
+ "Response": {
100
+ "$anchor": "response",
101
+ "title": "VTA Attestation Config Report — response payload",
102
+ "type": "object",
103
+ "additionalProperties": false,
104
+ "required": [
105
+ "configDigestSha384",
106
+ "configView",
107
+ "nonce",
108
+ "teeType",
109
+ "evidence",
110
+ "generatedAt"
111
+ ],
112
+ "properties": {
113
+ "configDigestSha384": {
114
+ "type": "string",
115
+ "pattern": "^[A-Za-z0-9+/]{64}$",
116
+ "description": "SHA-384 of the decoded configView bytes, base64 (standard). A convenience: the verifier recomputes it, and a mismatch with either the view or the evidence is a refusal."
117
+ },
118
+ "configView": {
119
+ "type": "string",
120
+ "minLength": 1,
121
+ "maxLength": 65536,
122
+ "pattern": "^[A-Za-z0-9+/]+={0,2}$",
123
+ "description": "The canonical, secret-free view of the configuration the agent booted, base64 (standard): the exact bytes whose SHA-384 the evidence binds as its user data."
124
+ },
125
+ "nonce": {
126
+ "type": "string",
127
+ "pattern": "^[0-9a-f]{64}$",
128
+ "description": "The request's nonce, echoed. A verifier checks the nonce inside the evidence, not this."
129
+ },
130
+ "teeType": {
131
+ "type": "string",
132
+ "enum": [
133
+ "nitro",
134
+ "sev-snp",
135
+ "simulated"
136
+ ],
137
+ "description": "The platform that produced the evidence. Informational and not covered by the evidence."
138
+ },
139
+ "evidence": {
140
+ "type": "string",
141
+ "minLength": 1,
142
+ "maxLength": 65536,
143
+ "pattern": "^[A-Za-z0-9+/_-]+={0,2}$",
144
+ "description": "The platform's quote, base64 (a COSE_Sign1 attestation document for nitro)."
145
+ },
146
+ "generatedAt": {
147
+ "type": "string",
148
+ "format": "date-time",
149
+ "description": "When the evidence was produced. Informational: freshness comes from the nonce."
150
+ },
151
+ "ext": {
152
+ "$ref": "#/$defs/Ext",
153
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
154
+ }
155
+ }
156
+ },
157
+ "Ext": {
158
+ "title": "Ext",
159
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
160
+ "type": "object",
161
+ "minProperties": 1,
162
+ "additionalProperties": true,
163
+ "propertyNames": {
164
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
165
+ }
166
+ }
167
+ }
168
+ } as const;
169
+
170
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
171
+ export const RESPONSE_PAYLOAD_SCHEMA = {
172
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
173
+ "$ref": "#/$defs/Response",
174
+ "$defs": {
175
+ "Response": {
176
+ "$anchor": "response",
177
+ "title": "VTA Attestation Config Report — response payload",
178
+ "type": "object",
179
+ "additionalProperties": false,
180
+ "required": [
181
+ "configDigestSha384",
182
+ "configView",
183
+ "nonce",
184
+ "teeType",
185
+ "evidence",
186
+ "generatedAt"
187
+ ],
188
+ "properties": {
189
+ "configDigestSha384": {
190
+ "type": "string",
191
+ "pattern": "^[A-Za-z0-9+/]{64}$",
192
+ "description": "SHA-384 of the decoded configView bytes, base64 (standard). A convenience: the verifier recomputes it, and a mismatch with either the view or the evidence is a refusal."
193
+ },
194
+ "configView": {
195
+ "type": "string",
196
+ "minLength": 1,
197
+ "maxLength": 65536,
198
+ "pattern": "^[A-Za-z0-9+/]+={0,2}$",
199
+ "description": "The canonical, secret-free view of the configuration the agent booted, base64 (standard): the exact bytes whose SHA-384 the evidence binds as its user data."
200
+ },
201
+ "nonce": {
202
+ "type": "string",
203
+ "pattern": "^[0-9a-f]{64}$",
204
+ "description": "The request's nonce, echoed. A verifier checks the nonce inside the evidence, not this."
205
+ },
206
+ "teeType": {
207
+ "type": "string",
208
+ "enum": [
209
+ "nitro",
210
+ "sev-snp",
211
+ "simulated"
212
+ ],
213
+ "description": "The platform that produced the evidence. Informational and not covered by the evidence."
214
+ },
215
+ "evidence": {
216
+ "type": "string",
217
+ "minLength": 1,
218
+ "maxLength": 65536,
219
+ "pattern": "^[A-Za-z0-9+/_-]+={0,2}$",
220
+ "description": "The platform's quote, base64 (a COSE_Sign1 attestation document for nitro)."
221
+ },
222
+ "generatedAt": {
223
+ "type": "string",
224
+ "format": "date-time",
225
+ "description": "When the evidence was produced. Informational: freshness comes from the nonce."
226
+ },
227
+ "ext": {
228
+ "$ref": "#/$defs/Ext",
229
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
230
+ }
231
+ }
232
+ },
233
+ "Ext": {
234
+ "title": "Ext",
235
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
236
+ "type": "object",
237
+ "minProperties": 1,
238
+ "additionalProperties": true,
239
+ "propertyNames": {
240
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
241
+ }
242
+ }
243
+ }
244
+ } as const;
245
+
246
+ /**
247
+ * SPEC.md §7.2 policy for the request variant, from this specification's
248
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
249
+ * per-specification and cannot be derived from the document alone, and
250
+ * item 2 needs the schema this carries.
251
+ */
252
+ export const SPEC = {
253
+ typeUri: TYPE_URI,
254
+ isBearer: false,
255
+ isProofRequired: false,
256
+ isRecipientRequired: true,
257
+ isIssuedAtRequired: false,
258
+ payloadSchema: PAYLOAD_SCHEMA,
259
+ } as const;
260
+
261
+ /**
262
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
263
+ * tracks the *issuer* party's requirement because a response swaps the
264
+ * parties (§7.3 item 5).
265
+ */
266
+ export const RESPONSE_SPEC = {
267
+ typeUri: RESPONSE_TYPE_URI,
268
+ isBearer: false,
269
+ isProofRequired: true,
270
+ isRecipientRequired: true,
271
+ isIssuedAtRequired: false,
272
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
273
+ } as const;
@@ -0,0 +1,253 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/attestation/report/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Asks an agent for fresh attestation evidence bound to a nonce the verifier chose. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface VTAAttestationReportPayload {
13
+ /**
14
+ * Thirty-two bytes the verifier generated for this request, lowercase hex. The agent binds exactly this into the evidence, so no earlier report can answer this request.
15
+ */
16
+ nonce: string;
17
+ /**
18
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
19
+ */
20
+ ext?: Ext;
21
+ }
22
+ export interface VTAAttestationReportResponsePayload {
23
+ /**
24
+ * The platform that produced the evidence, and so how to verify it.
25
+ */
26
+ teeType: "nitro" | "sev-snp" | "simulated";
27
+ /**
28
+ * The platform's quote, base64: a COSE_Sign1 attestation document for nitro, an attestation report for sev-snp. Verified against the vendor's root, never trusted on the agent's word.
29
+ */
30
+ evidence: string;
31
+ /**
32
+ * The request's nonce, echoed. A verifier checks the nonce inside the evidence, not this.
33
+ */
34
+ nonce: string;
35
+ /**
36
+ * The DID the evidence binds as its user data. A verifier checks the evidence binds it and that it is the response document's issuer.
37
+ */
38
+ vtaDid?: string;
39
+ /**
40
+ * When the evidence was produced. Informational: freshness comes from the nonce.
41
+ */
42
+ generatedAt: string;
43
+ /**
44
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
45
+ */
46
+ ext?: Ext;
47
+ }
48
+
49
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
50
+ export type { Ext };
51
+
52
+ /** Trust Task type URI. */
53
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/attestation/report/0.1" as const;
54
+
55
+ /** Stable alias for this specification's request payload shape. */
56
+ export type Payload = VTAAttestationReportPayload;
57
+
58
+ /** Trust Task response type URI (request type URI + "#response"). */
59
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/attestation/report/0.1#response" as const;
60
+
61
+ /** Stable alias for this specification's success-response payload shape. */
62
+ export type Response = VTAAttestationReportResponsePayload;
63
+
64
+ /**
65
+ * This specification's payload schema, as a value.
66
+ *
67
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
68
+ * rather than only as a `.json` file because TypeScript types are erased
69
+ * at runtime: without a schema a consumer has nothing to validate, and
70
+ * every REQUIRED payload member is optional in practice. Cross-file
71
+ * `$ref`s are already inlined, so it needs no resolver.
72
+ */
73
+ export const PAYLOAD_SCHEMA = {
74
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
75
+ "$id": "https://trusttasks.org/spec/vta/attestation/report/0.1",
76
+ "title": "VTA Attestation — Report — payload",
77
+ "description": "Asks an agent for fresh attestation evidence bound to a nonce the verifier chose. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "required": [
81
+ "nonce"
82
+ ],
83
+ "properties": {
84
+ "nonce": {
85
+ "type": "string",
86
+ "pattern": "^[0-9a-f]{64}$",
87
+ "description": "Thirty-two bytes the verifier generated for this request, lowercase hex. The agent binds exactly this into the evidence, so no earlier report can answer this request."
88
+ },
89
+ "ext": {
90
+ "$ref": "#/$defs/Ext",
91
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
92
+ }
93
+ },
94
+ "$defs": {
95
+ "Response": {
96
+ "$anchor": "response",
97
+ "title": "VTA Attestation Report — response payload",
98
+ "type": "object",
99
+ "additionalProperties": false,
100
+ "required": [
101
+ "teeType",
102
+ "evidence",
103
+ "nonce",
104
+ "generatedAt"
105
+ ],
106
+ "properties": {
107
+ "teeType": {
108
+ "type": "string",
109
+ "enum": [
110
+ "nitro",
111
+ "sev-snp",
112
+ "simulated"
113
+ ],
114
+ "description": "The platform that produced the evidence, and so how to verify it."
115
+ },
116
+ "evidence": {
117
+ "type": "string",
118
+ "minLength": 1,
119
+ "maxLength": 65536,
120
+ "pattern": "^[A-Za-z0-9+/_-]+={0,2}$",
121
+ "description": "The platform's quote, base64: a COSE_Sign1 attestation document for nitro, an attestation report for sev-snp. Verified against the vendor's root, never trusted on the agent's word."
122
+ },
123
+ "nonce": {
124
+ "type": "string",
125
+ "pattern": "^[0-9a-f]{64}$",
126
+ "description": "The request's nonce, echoed. A verifier checks the nonce inside the evidence, not this."
127
+ },
128
+ "vtaDid": {
129
+ "type": "string",
130
+ "minLength": 1,
131
+ "maxLength": 1000,
132
+ "description": "The DID the evidence binds as its user data. A verifier checks the evidence binds it and that it is the response document's issuer."
133
+ },
134
+ "generatedAt": {
135
+ "type": "string",
136
+ "format": "date-time",
137
+ "description": "When the evidence was produced. Informational: freshness comes from the nonce."
138
+ },
139
+ "ext": {
140
+ "$ref": "#/$defs/Ext",
141
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
142
+ }
143
+ }
144
+ },
145
+ "Ext": {
146
+ "title": "Ext",
147
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
148
+ "type": "object",
149
+ "minProperties": 1,
150
+ "additionalProperties": true,
151
+ "propertyNames": {
152
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
153
+ }
154
+ }
155
+ }
156
+ } as const;
157
+
158
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
159
+ export const RESPONSE_PAYLOAD_SCHEMA = {
160
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
161
+ "$ref": "#/$defs/Response",
162
+ "$defs": {
163
+ "Response": {
164
+ "$anchor": "response",
165
+ "title": "VTA Attestation Report — response payload",
166
+ "type": "object",
167
+ "additionalProperties": false,
168
+ "required": [
169
+ "teeType",
170
+ "evidence",
171
+ "nonce",
172
+ "generatedAt"
173
+ ],
174
+ "properties": {
175
+ "teeType": {
176
+ "type": "string",
177
+ "enum": [
178
+ "nitro",
179
+ "sev-snp",
180
+ "simulated"
181
+ ],
182
+ "description": "The platform that produced the evidence, and so how to verify it."
183
+ },
184
+ "evidence": {
185
+ "type": "string",
186
+ "minLength": 1,
187
+ "maxLength": 65536,
188
+ "pattern": "^[A-Za-z0-9+/_-]+={0,2}$",
189
+ "description": "The platform's quote, base64: a COSE_Sign1 attestation document for nitro, an attestation report for sev-snp. Verified against the vendor's root, never trusted on the agent's word."
190
+ },
191
+ "nonce": {
192
+ "type": "string",
193
+ "pattern": "^[0-9a-f]{64}$",
194
+ "description": "The request's nonce, echoed. A verifier checks the nonce inside the evidence, not this."
195
+ },
196
+ "vtaDid": {
197
+ "type": "string",
198
+ "minLength": 1,
199
+ "maxLength": 1000,
200
+ "description": "The DID the evidence binds as its user data. A verifier checks the evidence binds it and that it is the response document's issuer."
201
+ },
202
+ "generatedAt": {
203
+ "type": "string",
204
+ "format": "date-time",
205
+ "description": "When the evidence was produced. Informational: freshness comes from the nonce."
206
+ },
207
+ "ext": {
208
+ "$ref": "#/$defs/Ext",
209
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
210
+ }
211
+ }
212
+ },
213
+ "Ext": {
214
+ "title": "Ext",
215
+ "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
216
+ "type": "object",
217
+ "minProperties": 1,
218
+ "additionalProperties": true,
219
+ "propertyNames": {
220
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
221
+ }
222
+ }
223
+ }
224
+ } as const;
225
+
226
+ /**
227
+ * SPEC.md §7.2 policy for the request variant, from this specification's
228
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
229
+ * per-specification and cannot be derived from the document alone, and
230
+ * item 2 needs the schema this carries.
231
+ */
232
+ export const SPEC = {
233
+ typeUri: TYPE_URI,
234
+ isBearer: false,
235
+ isProofRequired: false,
236
+ isRecipientRequired: true,
237
+ isIssuedAtRequired: false,
238
+ payloadSchema: PAYLOAD_SCHEMA,
239
+ } as const;
240
+
241
+ /**
242
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
243
+ * tracks the *issuer* party's requirement because a response swaps the
244
+ * parties (§7.3 item 5).
245
+ */
246
+ export const RESPONSE_SPEC = {
247
+ typeUri: RESPONSE_TYPE_URI,
248
+ isBearer: false,
249
+ isProofRequired: true,
250
+ isRecipientRequired: true,
251
+ isIssuedAtRequired: false,
252
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
253
+ } as const;