@joclaim/attestor-core 0.2.5 → 0.3.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.
@@ -334,7 +334,7 @@ async function _createClaimOnAttestor({ name, params, secretParams, context, onS
334
334
  });
335
335
  }
336
336
  }
337
- if (provider.getResponseRedactions && redactionMode === 'zk') {
337
+ if (provider.getResponseRedactions) {
338
338
  serverPacketsToReveal = await getBlocksToReveal(serverBlocks, total => provider.getResponseRedactions({
339
339
  response: total,
340
340
  params,
@@ -342,10 +342,6 @@ async function _createClaimOnAttestor({ name, params, secretParams, context, onS
342
342
  ctx: PROVIDER_CTX
343
343
  }), performOprf);
344
344
  }
345
- else if (redactionMode !== 'zk') {
346
- // key-update mode: reveal all server responses directly (no ZK)
347
- serverPacketsToReveal = 'all';
348
- }
349
345
  const revealedPackets = packets
350
346
  .filter(p => p.sender === 'client');
351
347
  if (serverPacketsToReveal === 'all') {
@@ -1,3 +1,4 @@
1
+ import RE2 from 're2';
1
2
  import '../../providers/http/patch-parse5-tree.js';
2
3
  import type { ArraySlice, CompleteTLSPacket, ProviderParams, Transcript } from '../../types/index.js';
3
4
  import type { HttpRequest, HttpResponse } from '../../utils/index.js';
@@ -63,7 +64,7 @@ export declare function convertResponsePosToAbsolutePos(pos: number, bodyStartId
63
64
  */
64
65
  export declare function getRedactionsForChunkHeaders(from: number, to: number, chunks?: ArraySlice[]): ArraySlice[];
65
66
  export declare function parseHttpResponse(buff: Uint8Array): HttpResponse;
66
- export declare function makeRegex(str: string): RegExp;
67
+ export declare function makeRegex(str: string): RE2;
67
68
  /**
68
69
  * Try to match strings that contain templates like {{param}}
69
70
  * against redacted string that has *** instead of that param
@@ -227,14 +227,7 @@ export function parseHttpResponse(buff) {
227
227
  return parser.res;
228
228
  }
229
229
  export function makeRegex(str) {
230
- try {
231
- return RE2(str, 'sgiu');
232
- }
233
- catch {
234
- // RE2 is a native C++ addon unavailable in browser environments;
235
- // fall back to built-in RegExp
236
- return new RegExp(str, 'sgiu');
237
- }
230
+ return RE2(str, 'sgiu');
238
231
  }
239
232
  const TEMPLATE_START_CHARCODE = '{'.charCodeAt(0);
240
233
  const TEMPLATE_END_CHARCODE = '}'.charCodeAt(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joclaim/attestor-core",
3
- "version": "0.2.5",
3
+ "version": "0.3.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "imports": {
@@ -78,7 +78,7 @@
78
78
  "dependencies": {
79
79
  "@bufbuild/protobuf": "^2.9.0",
80
80
  "@joclaim/snarkjs": "0.1.0",
81
- "@joclaim/tls": "^0.2.0",
81
+ "@joclaim/tls": "0.3.2",
82
82
  "@joclaim/zk-symmetric-crypto": "0.1.0",
83
83
  "@peculiar/asn1-x509": "^2.5.0",
84
84
  "@peculiar/webcrypto": "^1.5.0",
@@ -135,4 +135,4 @@
135
135
  },
136
136
  "elliptic": "^v6.5.7"
137
137
  }
138
- }
138
+ }