@clawbureau/clawverify-core 0.1.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.
Files changed (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +40 -0
  3. package/dist/crypto.d.ts +27 -0
  4. package/dist/crypto.d.ts.map +1 -0
  5. package/dist/crypto.js +124 -0
  6. package/dist/crypto.js.map +1 -0
  7. package/dist/index.d.ts +27 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +24 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/jcs.d.ts +13 -0
  12. package/dist/jcs.d.ts.map +1 -0
  13. package/dist/jcs.js +43 -0
  14. package/dist/jcs.js.map +1 -0
  15. package/dist/model-identity.d.ts +46 -0
  16. package/dist/model-identity.d.ts.map +1 -0
  17. package/dist/model-identity.js +233 -0
  18. package/dist/model-identity.js.map +1 -0
  19. package/dist/schema-registry.d.ts +99 -0
  20. package/dist/schema-registry.d.ts.map +1 -0
  21. package/dist/schema-registry.js +259 -0
  22. package/dist/schema-registry.js.map +1 -0
  23. package/dist/schema-validation.d.ts +35 -0
  24. package/dist/schema-validation.d.ts.map +1 -0
  25. package/dist/schema-validation.js +156 -0
  26. package/dist/schema-validation.js.map +1 -0
  27. package/dist/schema-validators.generated.d.ts +158 -0
  28. package/dist/schema-validators.generated.d.ts.map +1 -0
  29. package/dist/schema-validators.generated.js +19186 -0
  30. package/dist/schema-validators.generated.js.map +1 -0
  31. package/dist/types.d.ts +910 -0
  32. package/dist/types.d.ts.map +1 -0
  33. package/dist/types.js +33 -0
  34. package/dist/types.js.map +1 -0
  35. package/dist/verify-audit-result-attestation.d.ts +32 -0
  36. package/dist/verify-audit-result-attestation.d.ts.map +1 -0
  37. package/dist/verify-audit-result-attestation.js +396 -0
  38. package/dist/verify-audit-result-attestation.js.map +1 -0
  39. package/dist/verify-derivation-attestation.d.ts +30 -0
  40. package/dist/verify-derivation-attestation.d.ts.map +1 -0
  41. package/dist/verify-derivation-attestation.js +371 -0
  42. package/dist/verify-derivation-attestation.js.map +1 -0
  43. package/dist/verify-execution-attestation.d.ts +32 -0
  44. package/dist/verify-execution-attestation.d.ts.map +1 -0
  45. package/dist/verify-execution-attestation.js +578 -0
  46. package/dist/verify-execution-attestation.js.map +1 -0
  47. package/dist/verify-export-bundle.d.ts +14 -0
  48. package/dist/verify-export-bundle.d.ts.map +1 -0
  49. package/dist/verify-export-bundle.js +307 -0
  50. package/dist/verify-export-bundle.js.map +1 -0
  51. package/dist/verify-log-inclusion-proof.d.ts +16 -0
  52. package/dist/verify-log-inclusion-proof.d.ts.map +1 -0
  53. package/dist/verify-log-inclusion-proof.js +216 -0
  54. package/dist/verify-log-inclusion-proof.js.map +1 -0
  55. package/dist/verify-proof-bundle.d.ts +48 -0
  56. package/dist/verify-proof-bundle.d.ts.map +1 -0
  57. package/dist/verify-proof-bundle.js +1708 -0
  58. package/dist/verify-proof-bundle.js.map +1 -0
  59. package/dist/verify-receipt.d.ts +30 -0
  60. package/dist/verify-receipt.d.ts.map +1 -0
  61. package/dist/verify-receipt.js +408 -0
  62. package/dist/verify-receipt.js.map +1 -0
  63. package/dist/verify-web-receipt.d.ts +21 -0
  64. package/dist/verify-web-receipt.d.ts.map +1 -0
  65. package/dist/verify-web-receipt.js +341 -0
  66. package/dist/verify-web-receipt.js.map +1 -0
  67. package/package.json +54 -0
@@ -0,0 +1,578 @@
1
+ /**
2
+ * Execution Attestation Verification
3
+ * CEA-US-010: Verify sandbox execution attestations
4
+ */
5
+ import { isAllowedVersion, isAllowedType, isAllowedAlgorithm, isAllowedHashAlgorithm, isValidDidFormat, isValidBase64Url, isValidIsoDate, } from './schema-registry.js';
6
+ import { computeHash, base64UrlDecode, extractPublicKeyFromDidKey, verifySignature, } from './crypto.js';
7
+ import { validateExecutionAttestationEnvelopeV1 } from './schema-validation.js';
8
+ function validateEnvelopeStructure(envelope) {
9
+ if (typeof envelope !== 'object' || envelope === null)
10
+ return false;
11
+ const e = envelope;
12
+ return ('envelope_version' in e &&
13
+ 'envelope_type' in e &&
14
+ 'payload' in e &&
15
+ 'payload_hash_b64u' in e &&
16
+ 'hash_algorithm' in e &&
17
+ 'signature_b64u' in e &&
18
+ 'algorithm' in e &&
19
+ 'signer_did' in e &&
20
+ 'issued_at' in e);
21
+ }
22
+ function validatePayload(payload) {
23
+ if (typeof payload !== 'object' || payload === null)
24
+ return false;
25
+ const p = payload;
26
+ if (p.attestation_version !== '1')
27
+ return false;
28
+ if (typeof p.attestation_id !== 'string' || p.attestation_id.trim().length === 0)
29
+ return false;
30
+ if (p.execution_type !== 'sandbox_execution' && p.execution_type !== 'tee_execution')
31
+ return false;
32
+ if (!isValidDidFormat(p.agent_did))
33
+ return false;
34
+ if (!isValidDidFormat(p.attester_did))
35
+ return false;
36
+ // CEA-US-010: require run binding + proof bundle binding
37
+ if (typeof p.run_id !== 'string' || p.run_id.trim().length === 0)
38
+ return false;
39
+ if (typeof p.proof_bundle_hash_b64u !== 'string' ||
40
+ p.proof_bundle_hash_b64u.trim().length < 8 ||
41
+ !isValidBase64Url(p.proof_bundle_hash_b64u))
42
+ return false;
43
+ if (!isValidIsoDate(p.issued_at))
44
+ return false;
45
+ if ('expires_at' in p && p.expires_at !== undefined && !isValidIsoDate(p.expires_at))
46
+ return false;
47
+ return true;
48
+ }
49
+ function asObject(value) {
50
+ return typeof value === 'object' && value !== null ? value : null;
51
+ }
52
+ function extractTeeClaims(payload) {
53
+ const runtimeMetadata = asObject(payload.runtime_metadata);
54
+ if (!runtimeMetadata)
55
+ return null;
56
+ const tee = asObject(runtimeMetadata.tee);
57
+ if (!tee)
58
+ return null;
59
+ const rootId = typeof tee.root_id === 'string' ? tee.root_id.trim() : '';
60
+ const tcbVersion = typeof tee.tcb_version === 'string' ? tee.tcb_version.trim() : '';
61
+ if (rootId.length === 0 || tcbVersion.length === 0)
62
+ return null;
63
+ return { rootId, tcbVersion };
64
+ }
65
+ export async function verifyExecutionAttestation(envelope, options = {}) {
66
+ const now = new Date().toISOString();
67
+ // 1) Envelope structure
68
+ if (!validateEnvelopeStructure(envelope)) {
69
+ return {
70
+ result: {
71
+ status: 'INVALID',
72
+ reason: 'Malformed envelope: missing required fields',
73
+ verified_at: now,
74
+ },
75
+ error: {
76
+ code: 'MALFORMED_ENVELOPE',
77
+ message: 'Envelope is missing required fields or has invalid structure',
78
+ },
79
+ };
80
+ }
81
+ // 2) Version/type allowlist
82
+ if (!isAllowedVersion(envelope.envelope_version)) {
83
+ return {
84
+ result: {
85
+ status: 'INVALID',
86
+ reason: `Unknown envelope version: ${envelope.envelope_version}`,
87
+ verified_at: now,
88
+ },
89
+ error: {
90
+ code: 'UNKNOWN_ENVELOPE_VERSION',
91
+ message: `Envelope version "${envelope.envelope_version}" is not in the allowlist`,
92
+ field: 'envelope_version',
93
+ },
94
+ };
95
+ }
96
+ if (!isAllowedType(envelope.envelope_type)) {
97
+ return {
98
+ result: {
99
+ status: 'INVALID',
100
+ reason: `Unknown envelope type: ${envelope.envelope_type}`,
101
+ verified_at: now,
102
+ },
103
+ error: {
104
+ code: 'UNKNOWN_ENVELOPE_TYPE',
105
+ message: `Envelope type "${envelope.envelope_type}" is not in the allowlist`,
106
+ field: 'envelope_type',
107
+ },
108
+ };
109
+ }
110
+ if (envelope.envelope_type !== 'execution_attestation') {
111
+ return {
112
+ result: {
113
+ status: 'INVALID',
114
+ reason: `Expected execution_attestation envelope, got: ${envelope.envelope_type}`,
115
+ verified_at: now,
116
+ },
117
+ error: {
118
+ code: 'UNKNOWN_ENVELOPE_TYPE',
119
+ message: 'This endpoint only accepts execution_attestation envelopes',
120
+ field: 'envelope_type',
121
+ },
122
+ };
123
+ }
124
+ // 3) Algorithm allowlist
125
+ if (!isAllowedAlgorithm(envelope.algorithm)) {
126
+ return {
127
+ result: {
128
+ status: 'INVALID',
129
+ reason: `Unknown signature algorithm: ${envelope.algorithm}`,
130
+ verified_at: now,
131
+ },
132
+ error: {
133
+ code: 'UNKNOWN_ALGORITHM',
134
+ message: `Signature algorithm "${envelope.algorithm}" is not in the allowlist`,
135
+ field: 'algorithm',
136
+ },
137
+ };
138
+ }
139
+ if (!isAllowedHashAlgorithm(envelope.hash_algorithm)) {
140
+ return {
141
+ result: {
142
+ status: 'INVALID',
143
+ reason: `Unknown hash algorithm: ${envelope.hash_algorithm}`,
144
+ verified_at: now,
145
+ },
146
+ error: {
147
+ code: 'UNKNOWN_HASH_ALGORITHM',
148
+ message: `Hash algorithm "${envelope.hash_algorithm}" is not in the allowlist`,
149
+ field: 'hash_algorithm',
150
+ },
151
+ };
152
+ }
153
+ // 3.5) Strict schema validation (Ajv standalone)
154
+ const schemaResult = validateExecutionAttestationEnvelopeV1(envelope);
155
+ if (!schemaResult.valid) {
156
+ return {
157
+ result: {
158
+ status: 'INVALID',
159
+ reason: schemaResult.message,
160
+ envelope_type: envelope.envelope_type,
161
+ signer_did: envelope.signer_did,
162
+ verified_at: now,
163
+ },
164
+ error: {
165
+ code: 'SCHEMA_VALIDATION_FAILED',
166
+ message: schemaResult.message,
167
+ field: schemaResult.field,
168
+ },
169
+ };
170
+ }
171
+ // 4) Signer DID validation
172
+ if (!isValidDidFormat(envelope.signer_did)) {
173
+ return {
174
+ result: {
175
+ status: 'INVALID',
176
+ reason: `Invalid DID format: ${envelope.signer_did}`,
177
+ verified_at: now,
178
+ },
179
+ signer_did: envelope.signer_did,
180
+ error: {
181
+ code: 'INVALID_DID_FORMAT',
182
+ message: 'Signer DID does not match expected format (did:key:... or did:web:...)',
183
+ field: 'signer_did',
184
+ },
185
+ };
186
+ }
187
+ // 5) Fail-closed: require allowlisted signer DID(s)
188
+ if (!options.allowlistedSignerDids || options.allowlistedSignerDids.length === 0) {
189
+ return {
190
+ result: {
191
+ status: 'INVALID',
192
+ reason: 'Execution attestation signer allowlist not configured',
193
+ envelope_type: envelope.envelope_type,
194
+ signer_did: envelope.signer_did,
195
+ verified_at: now,
196
+ },
197
+ signer_did: envelope.signer_did,
198
+ error: {
199
+ code: 'DEPENDENCY_NOT_CONFIGURED',
200
+ message: 'Execution attestation signer allowlist is not configured. Set EXECUTION_ATTESTATION_SIGNER_DIDS to enable verification.',
201
+ field: 'env.EXECUTION_ATTESTATION_SIGNER_DIDS',
202
+ },
203
+ };
204
+ }
205
+ const allowlisted = options.allowlistedSignerDids.includes(envelope.signer_did);
206
+ if (!allowlisted) {
207
+ return {
208
+ result: {
209
+ status: 'INVALID',
210
+ reason: 'Execution attestation signer DID is not allowlisted',
211
+ envelope_type: envelope.envelope_type,
212
+ signer_did: envelope.signer_did,
213
+ verified_at: now,
214
+ },
215
+ signer_did: envelope.signer_did,
216
+ allowlisted,
217
+ error: {
218
+ code: 'CLAIM_NOT_FOUND',
219
+ message: `Signer DID '${envelope.signer_did}' is not in the allowlisted execution attestation signer list`,
220
+ field: 'signer_did',
221
+ },
222
+ };
223
+ }
224
+ // 6) Validate issued_at + base64url fields
225
+ if (!isValidIsoDate(envelope.issued_at)) {
226
+ return {
227
+ result: {
228
+ status: 'INVALID',
229
+ reason: 'Invalid issued_at date format',
230
+ verified_at: now,
231
+ },
232
+ signer_did: envelope.signer_did,
233
+ allowlisted,
234
+ error: {
235
+ code: 'MALFORMED_ENVELOPE',
236
+ message: 'issued_at must be a valid ISO 8601 date string',
237
+ field: 'issued_at',
238
+ },
239
+ };
240
+ }
241
+ if (!isValidBase64Url(envelope.payload_hash_b64u)) {
242
+ return {
243
+ result: {
244
+ status: 'INVALID',
245
+ reason: 'Invalid payload_hash_b64u format',
246
+ verified_at: now,
247
+ },
248
+ signer_did: envelope.signer_did,
249
+ allowlisted,
250
+ error: {
251
+ code: 'MALFORMED_ENVELOPE',
252
+ message: 'payload_hash_b64u must be a valid base64url string',
253
+ field: 'payload_hash_b64u',
254
+ },
255
+ };
256
+ }
257
+ if (!isValidBase64Url(envelope.signature_b64u)) {
258
+ return {
259
+ result: {
260
+ status: 'INVALID',
261
+ reason: 'Invalid signature_b64u format',
262
+ verified_at: now,
263
+ },
264
+ signer_did: envelope.signer_did,
265
+ allowlisted,
266
+ error: {
267
+ code: 'MALFORMED_ENVELOPE',
268
+ message: 'signature_b64u must be a valid base64url string',
269
+ field: 'signature_b64u',
270
+ },
271
+ };
272
+ }
273
+ // 7) Payload validation
274
+ if (!validatePayload(envelope.payload)) {
275
+ return {
276
+ result: {
277
+ status: 'INVALID',
278
+ reason: 'Invalid execution attestation payload structure',
279
+ verified_at: now,
280
+ },
281
+ signer_did: envelope.signer_did,
282
+ allowlisted,
283
+ error: {
284
+ code: 'SCHEMA_VALIDATION_FAILED',
285
+ message: 'Payload does not match execution_attestation.v1 constraints',
286
+ field: 'payload',
287
+ },
288
+ };
289
+ }
290
+ const payload = envelope.payload;
291
+ // 8) Internal consistency: payload.attester_did must match signer_did
292
+ if (payload.attester_did !== envelope.signer_did) {
293
+ return {
294
+ result: {
295
+ status: 'INVALID',
296
+ reason: 'Payload attester_did does not match envelope signer_did',
297
+ verified_at: now,
298
+ },
299
+ signer_did: envelope.signer_did,
300
+ allowlisted,
301
+ attester_did: payload.attester_did,
302
+ error: {
303
+ code: 'SIGNATURE_INVALID',
304
+ message: 'payload.attester_did must equal envelope.signer_did',
305
+ field: 'payload.attester_did',
306
+ },
307
+ };
308
+ }
309
+ // 9) Verify payload hash
310
+ let computedHash;
311
+ try {
312
+ computedHash = await computeHash(payload, envelope.hash_algorithm);
313
+ }
314
+ catch (err) {
315
+ return {
316
+ result: {
317
+ status: 'INVALID',
318
+ reason: 'Failed to compute payload hash',
319
+ verified_at: now,
320
+ },
321
+ signer_did: envelope.signer_did,
322
+ allowlisted,
323
+ error: {
324
+ code: 'HASH_MISMATCH',
325
+ message: `Failed to compute hash: ${err instanceof Error ? err.message : 'unknown error'}`,
326
+ field: 'payload',
327
+ },
328
+ };
329
+ }
330
+ if (computedHash !== envelope.payload_hash_b64u) {
331
+ return {
332
+ result: {
333
+ status: 'INVALID',
334
+ reason: 'Payload hash mismatch',
335
+ verified_at: now,
336
+ },
337
+ signer_did: envelope.signer_did,
338
+ allowlisted,
339
+ error: {
340
+ code: 'HASH_MISMATCH',
341
+ message: 'Computed payload hash does not match payload_hash_b64u',
342
+ field: 'payload_hash_b64u',
343
+ },
344
+ };
345
+ }
346
+ // 10) Verify signature over payload_hash_b64u
347
+ const pub = extractPublicKeyFromDidKey(envelope.signer_did);
348
+ if (!pub) {
349
+ return {
350
+ result: {
351
+ status: 'INVALID',
352
+ reason: 'Unable to extract public key from signer_did',
353
+ verified_at: now,
354
+ },
355
+ signer_did: envelope.signer_did,
356
+ allowlisted,
357
+ error: {
358
+ code: 'INVALID_DID_FORMAT',
359
+ message: 'Unable to extract Ed25519 public key from signer_did (expected did:key with 0xed01 multicodec prefix)',
360
+ field: 'signer_did',
361
+ },
362
+ };
363
+ }
364
+ try {
365
+ const sigBytes = base64UrlDecode(envelope.signature_b64u);
366
+ if (sigBytes.length !== 64) {
367
+ return {
368
+ result: {
369
+ status: 'INVALID',
370
+ reason: 'Invalid signature length',
371
+ verified_at: now,
372
+ },
373
+ signer_did: envelope.signer_did,
374
+ allowlisted,
375
+ error: {
376
+ code: 'SIGNATURE_INVALID',
377
+ message: 'Invalid signature length (expected 64 bytes for Ed25519)',
378
+ field: 'signature_b64u',
379
+ },
380
+ };
381
+ }
382
+ const msgBytes = new TextEncoder().encode(envelope.payload_hash_b64u);
383
+ const signatureOk = await verifySignature(envelope.algorithm, pub, sigBytes, msgBytes);
384
+ if (!signatureOk) {
385
+ return {
386
+ result: {
387
+ status: 'INVALID',
388
+ reason: 'Signature verification failed',
389
+ verified_at: now,
390
+ },
391
+ signer_did: envelope.signer_did,
392
+ allowlisted,
393
+ error: {
394
+ code: 'SIGNATURE_INVALID',
395
+ message: 'Signature verification failed',
396
+ field: 'signature_b64u',
397
+ },
398
+ };
399
+ }
400
+ }
401
+ catch (err) {
402
+ return {
403
+ result: {
404
+ status: 'INVALID',
405
+ reason: 'Signature verification error',
406
+ verified_at: now,
407
+ },
408
+ signer_did: envelope.signer_did,
409
+ allowlisted,
410
+ error: {
411
+ code: 'SIGNATURE_INVALID',
412
+ message: `Signature verification error: ${err instanceof Error ? err.message : 'unknown error'}`,
413
+ field: 'signature_b64u',
414
+ },
415
+ };
416
+ }
417
+ let teeClaims;
418
+ if (payload.execution_type === 'tee_execution') {
419
+ const extracted = extractTeeClaims(payload);
420
+ if (!extracted) {
421
+ return {
422
+ result: {
423
+ status: 'INVALID',
424
+ reason: 'Missing required TEE runtime metadata claims',
425
+ verified_at: now,
426
+ },
427
+ signer_did: envelope.signer_did,
428
+ allowlisted,
429
+ error: {
430
+ code: 'SCHEMA_VALIDATION_FAILED',
431
+ message: 'tee_execution requires runtime_metadata.tee.{attestation_type,root_id,tcb_version,evidence_ref,measurements}',
432
+ field: 'payload.runtime_metadata.tee',
433
+ },
434
+ };
435
+ }
436
+ teeClaims = extracted;
437
+ if (!options.teeRootAllowlist || options.teeRootAllowlist.length === 0) {
438
+ return {
439
+ result: {
440
+ status: 'INVALID',
441
+ reason: 'TEE root allowlist not configured',
442
+ envelope_type: envelope.envelope_type,
443
+ signer_did: envelope.signer_did,
444
+ verified_at: now,
445
+ },
446
+ signer_did: envelope.signer_did,
447
+ allowlisted,
448
+ tee_root_id: teeClaims.rootId,
449
+ tee_tcb_version: teeClaims.tcbVersion,
450
+ error: {
451
+ code: 'DEPENDENCY_NOT_CONFIGURED',
452
+ message: 'TEE root allowlist is not configured. Set TEE_ATTESTATION_ROOT_ALLOWLIST to enable tee_execution verification.',
453
+ field: 'env.TEE_ATTESTATION_ROOT_ALLOWLIST',
454
+ },
455
+ };
456
+ }
457
+ if (!options.teeTcbAllowlist || options.teeTcbAllowlist.length === 0) {
458
+ return {
459
+ result: {
460
+ status: 'INVALID',
461
+ reason: 'TEE TCB allowlist not configured',
462
+ envelope_type: envelope.envelope_type,
463
+ signer_did: envelope.signer_did,
464
+ verified_at: now,
465
+ },
466
+ signer_did: envelope.signer_did,
467
+ allowlisted,
468
+ tee_root_id: teeClaims.rootId,
469
+ tee_tcb_version: teeClaims.tcbVersion,
470
+ error: {
471
+ code: 'DEPENDENCY_NOT_CONFIGURED',
472
+ message: 'TEE TCB allowlist is not configured. Set TEE_ATTESTATION_TCB_ALLOWLIST to enable tee_execution verification.',
473
+ field: 'env.TEE_ATTESTATION_TCB_ALLOWLIST',
474
+ },
475
+ };
476
+ }
477
+ if (options.teeRootRevoked?.includes(teeClaims.rootId)) {
478
+ return {
479
+ result: {
480
+ status: 'INVALID',
481
+ reason: 'TEE root is revoked',
482
+ envelope_type: envelope.envelope_type,
483
+ signer_did: envelope.signer_did,
484
+ verified_at: now,
485
+ },
486
+ signer_did: envelope.signer_did,
487
+ allowlisted,
488
+ tee_root_id: teeClaims.rootId,
489
+ tee_tcb_version: teeClaims.tcbVersion,
490
+ error: {
491
+ code: 'REVOKED',
492
+ message: `TEE root '${teeClaims.rootId}' is revoked`,
493
+ field: 'payload.runtime_metadata.tee.root_id',
494
+ },
495
+ };
496
+ }
497
+ if (options.teeTcbRevoked?.includes(teeClaims.tcbVersion)) {
498
+ return {
499
+ result: {
500
+ status: 'INVALID',
501
+ reason: 'TEE TCB version is revoked',
502
+ envelope_type: envelope.envelope_type,
503
+ signer_did: envelope.signer_did,
504
+ verified_at: now,
505
+ },
506
+ signer_did: envelope.signer_did,
507
+ allowlisted,
508
+ tee_root_id: teeClaims.rootId,
509
+ tee_tcb_version: teeClaims.tcbVersion,
510
+ error: {
511
+ code: 'REVOKED',
512
+ message: `TEE TCB version '${teeClaims.tcbVersion}' is revoked`,
513
+ field: 'payload.runtime_metadata.tee.tcb_version',
514
+ },
515
+ };
516
+ }
517
+ if (!options.teeRootAllowlist.includes(teeClaims.rootId)) {
518
+ return {
519
+ result: {
520
+ status: 'INVALID',
521
+ reason: 'TEE root is not allowlisted',
522
+ envelope_type: envelope.envelope_type,
523
+ signer_did: envelope.signer_did,
524
+ verified_at: now,
525
+ },
526
+ signer_did: envelope.signer_did,
527
+ allowlisted,
528
+ tee_root_id: teeClaims.rootId,
529
+ tee_tcb_version: teeClaims.tcbVersion,
530
+ error: {
531
+ code: 'CLAIM_NOT_FOUND',
532
+ message: `TEE root '${teeClaims.rootId}' is not in TEE_ATTESTATION_ROOT_ALLOWLIST`,
533
+ field: 'payload.runtime_metadata.tee.root_id',
534
+ },
535
+ };
536
+ }
537
+ if (!options.teeTcbAllowlist.includes(teeClaims.tcbVersion)) {
538
+ return {
539
+ result: {
540
+ status: 'INVALID',
541
+ reason: 'TEE TCB version is not allowlisted',
542
+ envelope_type: envelope.envelope_type,
543
+ signer_did: envelope.signer_did,
544
+ verified_at: now,
545
+ },
546
+ signer_did: envelope.signer_did,
547
+ allowlisted,
548
+ tee_root_id: teeClaims.rootId,
549
+ tee_tcb_version: teeClaims.tcbVersion,
550
+ error: {
551
+ code: 'CLAIM_NOT_FOUND',
552
+ message: `TEE TCB version '${teeClaims.tcbVersion}' is not in TEE_ATTESTATION_TCB_ALLOWLIST`,
553
+ field: 'payload.runtime_metadata.tee.tcb_version',
554
+ },
555
+ };
556
+ }
557
+ }
558
+ return {
559
+ result: {
560
+ status: 'VALID',
561
+ reason: 'Execution attestation verified successfully',
562
+ verified_at: now,
563
+ envelope_type: envelope.envelope_type,
564
+ signer_did: envelope.signer_did,
565
+ },
566
+ signer_did: envelope.signer_did,
567
+ allowlisted,
568
+ attestation_id: payload.attestation_id,
569
+ execution_type: payload.execution_type,
570
+ agent_did: payload.agent_did,
571
+ attester_did: payload.attester_did,
572
+ run_id: payload.run_id,
573
+ proof_bundle_hash_b64u: payload.proof_bundle_hash_b64u,
574
+ tee_root_id: teeClaims?.rootId,
575
+ tee_tcb_version: teeClaims?.tcbVersion,
576
+ };
577
+ }
578
+ //# sourceMappingURL=verify-execution-attestation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-execution-attestation.js","sourceRoot":"","sources":["../src/verify-execution-attestation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,sBAAs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U,CAAC,EAAE,CAAC;YAC5D,OAAO;gBACL,MAAM,EAAE;oBACN,MAAM,EAAE,SAAS;oBACjB,MAAM,EAAE,oCAAoC;oBAC5C,aAAa,EAAE,QAAQ,CAAC,aAAa;oBACrC,UAAU,EAAE,QAAQ,CAAC,UAAU;oBAC/B,WAAW,EAAE,GAAG;iBACjB;gBACD,UAAU,EAAE,QAAQ,CAAC,UAAU;gBAC/B,WAAW;gBACX,WAAW,EAAE,SAAS,CAAC,MAAM;gBAC7B,eAAe,EAAE,SAAS,CAAC,UAAU;gBACrC,KAAK,EAAE;oBACL,IAAI,EAAE,iBAAiB;oBACvB,OAAO,EAAE,oBAAoB,SAAS,CAAC,UAAU,2CAA2C;oBAC5F,KAAK,EAAE,0CAA0C;iBAClD;aACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE;YACN,MAAM,EAAE,OAAO;YACf,MAAM,EAAE,6CAA6C;YACrD,WAAW,EAAE,GAAG;YAChB,aAAa,EAAE,QAAQ,CAAC,aAAa;YACrC,UAAU,EAAE,QAAQ,CAAC,UAAU;SAChC;QACD,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,WAAW;QACX,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,sBAAsB,EAAE,OAAO,CAAC,sBAAsB;QACtD,WAAW,EAAE,SAAS,EAAE,MAAM;QAC9B,eAAe,EAAE,SAAS,EAAE,UAAU;KACvC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Export Bundle Verification
3
+ * POHVN-US-007: Audit-ready export bundles (offline verifiability)
4
+ */
5
+ import type { VerifyExportBundleResponse } from './types.js';
6
+ export interface VerifyExportBundleOptions {
7
+ allowlistedReceiptSignerDids?: readonly string[];
8
+ allowlistedAttesterDids?: readonly string[];
9
+ allowlistedExecutionAttestationSignerDids?: readonly string[];
10
+ allowlistedDerivationAttestationSignerDids?: readonly string[];
11
+ allowlistedAuditResultAttestationSignerDids?: readonly string[];
12
+ }
13
+ export declare function verifyExportBundle(bundleInput: unknown, options?: VerifyExportBundleOptions): Promise<VerifyExportBundleResponse>;
14
+ //# sourceMappingURL=verify-export-bundle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-export-bundle.d.ts","sourceRoot":"","sources":["../src/verify-export-bundle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAGV,0BAA0B,EAE3B,MAAM,YAAY,CAAC;AAepB,MAAM,WAAW,yBAAyB;IACxC,4BAA4B,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjD,uBAAuB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,yCAAyC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9D,0CAA0C,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/D,2CAA2C,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACjE;AA8HD,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,OAAO,EACpB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,0BAA0B,CAAC,CA6PrC"}