tinfoil 0.9.1 → 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.
@@ -37,6 +37,9 @@ export interface VerificationDocument {
37
37
  verifyCode: VerificationStepState;
38
38
  verifyEnclave: VerificationStepState;
39
39
  compareMeasurements: VerificationStepState;
40
+ createTransport?: VerificationStepState;
41
+ verifyHPKEKey?: VerificationStepState;
42
+ otherError?: VerificationStepState;
40
43
  };
41
44
  }
42
45
  export interface MeasurementComparisonResult {
@@ -84,7 +87,7 @@ export declare class Verifier {
84
87
  private static executeWithWasm;
85
88
  /**
86
89
  * Fetch the latest release digest from GitHub
87
- * @param configRepo - Repository name (e.g., "tinfoilsh/confidential-inference-proxy")
90
+ * @param configRepo - Repository name (e.g., "tinfoilsh/confidential-model-router")
88
91
  * @returns The digest hash
89
92
  */
90
93
  fetchLatestDigest(configRepo?: string): Promise<string>;
package/dist/verifier.js CHANGED
@@ -163,7 +163,8 @@ function compareMeasurementsError(codeMeasurement, runtimeMeasurement) {
163
163
  }
164
164
  if (codeMeasurement.type === PLATFORM_TYPES.SNP_TDX_MULTI_PLATFORM_V1) {
165
165
  switch (runtimeMeasurement.type) {
166
- case PLATFORM_TYPES.TDX_GUEST_V1: {
166
+ case PLATFORM_TYPES.TDX_GUEST_V1:
167
+ case PLATFORM_TYPES.TDX_GUEST_V2: {
167
168
  if (codeMeasurement.registers.length < 3 || runtimeMeasurement.registers.length < 4) {
168
169
  return new Error(MEASUREMENT_ERROR_MESSAGES.FEW_REGISTERS);
169
170
  }
@@ -233,8 +234,10 @@ function compareMeasurements(codeMeasurement, runtimeMeasurement) {
233
234
  */
234
235
  class Verifier {
235
236
  constructor(options) {
236
- const serverURL = options?.serverURL ?? config_1.TINFOIL_CONFIG.INFERENCE_BASE_URL;
237
- this.serverURL = new URL(serverURL).hostname;
237
+ if (!options?.serverURL) {
238
+ throw new Error("serverURL is required for Verifier");
239
+ }
240
+ this.serverURL = new URL(options.serverURL).hostname;
238
241
  this.configRepo = options?.configRepo ?? config_1.TINFOIL_CONFIG.INFERENCE_PROXY_REPO;
239
242
  }
240
243
  /**
@@ -295,7 +298,7 @@ class Verifier {
295
298
  }
296
299
  /**
297
300
  * Fetch the latest release digest from GitHub
298
- * @param configRepo - Repository name (e.g., "tinfoilsh/confidential-inference-proxy")
301
+ * @param configRepo - Repository name (e.g., "tinfoilsh/confidential-model-router")
299
302
  * @returns The digest hash
300
303
  */
301
304
  async fetchLatestDigest(configRepo) {
@@ -478,6 +481,15 @@ class Verifier {
478
481
  }
479
482
  catch (error) {
480
483
  steps.fetchDigest = { status: 'failed', error: error.message };
484
+ this.lastVerificationDocument = {
485
+ configRepo: this.configRepo,
486
+ enclaveHost: this.serverURL,
487
+ releaseDigest: '',
488
+ codeMeasurement: { type: '', registers: [] },
489
+ enclaveMeasurement: { measurement: { type: '', registers: [] } },
490
+ securityVerified: false,
491
+ steps,
492
+ };
481
493
  throw error;
482
494
  }
483
495
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinfoil",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "description": "Tinfoil secure OpenAI client wrapper",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -81,7 +81,7 @@
81
81
  "@ai-sdk/openai-compatible": "^1.0.10",
82
82
  "ai": "^5.0.19",
83
83
  "dotenv": "^17.2.1",
84
- "ehbp": "^0.0.2",
84
+ "ehbp": "^0.0.4",
85
85
  "openai": "^5.13.1",
86
86
  "ts-node": "^10.9.2"
87
87
  },