@reclaimprotocol/attestor-core 5.0.1-beta.5 → 5.0.1-beta.6

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.
@@ -12,7 +12,7 @@ import {
12
12
  matchRedactedStrings,
13
13
  parseHttpResponse
14
14
  } from "../../providers/http/utils.js";
15
- import { isValidProxySessionId } from "../../server/utils/proxy-session.js";
15
+ import { isValidProxySessionId } from "../../utils/generics.js";
16
16
  import {
17
17
  findIndexInUint8Array,
18
18
  getHttpRequestDataFromTranscript,
@@ -112,3 +112,8 @@ export declare function packRpcMessages(...msgs: Partial<RPCMessage>[]): RPCMess
112
112
  */
113
113
  export declare function ethersStructToPlainObject<T>(struct: T): T;
114
114
  export declare function isTls13Suite(suite: CipherSuite): suite is "TLS_CHACHA20_POLY1305_SHA256" | "TLS_AES_256_GCM_SHA384" | "TLS_AES_128_GCM_SHA256";
115
+ /**
116
+ * Validates a proxy session ID format.
117
+ * Must be 8-14 lowercase alphanumeric characters.
118
+ */
119
+ export declare function isValidProxySessionId(sessionId: string): boolean;
@@ -238,6 +238,9 @@ function ethersStructToPlainObject(struct) {
238
238
  function isTls13Suite(suite) {
239
239
  return suite === "TLS_AES_128_GCM_SHA256" || suite === "TLS_AES_256_GCM_SHA384" || suite === "TLS_CHACHA20_POLY1305_SHA256";
240
240
  }
241
+ function isValidProxySessionId(sessionId) {
242
+ return typeof sessionId === "string" && sessionId.length >= 8 && sessionId.length < 15 && /^[a-z0-9]+$/.test(sessionId);
243
+ }
241
244
  export {
242
245
  decryptDirect,
243
246
  ethersStructToPlainObject,
@@ -259,6 +262,7 @@ export {
259
262
  getZkAlgorithmForCipherSuite,
260
263
  isApplicationData,
261
264
  isTls13Suite,
265
+ isValidProxySessionId,
262
266
  makeRpcEvent,
263
267
  packRpcMessages,
264
268
  strToUint8Array,
@@ -12,7 +12,7 @@ import {
12
12
  matchRedactedStrings,
13
13
  parseHttpResponse
14
14
  } from "../../providers/http/utils.js";
15
- import { isValidProxySessionId } from "../../server/utils/proxy-session.js";
15
+ import { isValidProxySessionId } from "../../utils/generics.js";
16
16
  import {
17
17
  findIndexInUint8Array,
18
18
  getHttpRequestDataFromTranscript,
@@ -3,7 +3,7 @@ import { Socket } from "net";
3
3
  import { CONNECTION_TIMEOUT_MS } from "../../config/index.js";
4
4
  import { resolveHostnames } from "../../server/utils/dns.js";
5
5
  import { isValidCountryCode } from "../../server/utils/iso.js";
6
- import { isValidProxySessionId } from "../../server/utils/proxy-session.js";
6
+ import { isValidProxySessionId } from "../../utils/generics.js";
7
7
  import { getEnvVariable } from "../../utils/env.js";
8
8
  import { AttestorError } from "../../utils/index.js";
9
9
  const HTTPS_PROXY_URL = getEnvVariable("HTTPS_PROXY_URL");
@@ -1 +1 @@
1
- export declare function isValidProxySessionId(sessionId: string): boolean;
1
+ export { isValidProxySessionId } from '#src/utils/generics.ts';
@@ -1,6 +1,4 @@
1
- function isValidProxySessionId(sessionId) {
2
- return typeof sessionId === "string" && sessionId.length >= 8 && sessionId.length < 15 && /^[a-z0-9]+$/.test(sessionId);
3
- }
1
+ import { isValidProxySessionId } from "../../utils/generics.js";
4
2
  export {
5
3
  isValidProxySessionId
6
4
  };
@@ -112,3 +112,8 @@ export declare function packRpcMessages(...msgs: Partial<RPCMessage>[]): RPCMess
112
112
  */
113
113
  export declare function ethersStructToPlainObject<T>(struct: T): T;
114
114
  export declare function isTls13Suite(suite: CipherSuite): suite is "TLS_CHACHA20_POLY1305_SHA256" | "TLS_AES_256_GCM_SHA384" | "TLS_AES_128_GCM_SHA256";
115
+ /**
116
+ * Validates a proxy session ID format.
117
+ * Must be 8-14 lowercase alphanumeric characters.
118
+ */
119
+ export declare function isValidProxySessionId(sessionId: string): boolean;
@@ -238,6 +238,9 @@ function ethersStructToPlainObject(struct) {
238
238
  function isTls13Suite(suite) {
239
239
  return suite === "TLS_AES_128_GCM_SHA256" || suite === "TLS_AES_256_GCM_SHA384" || suite === "TLS_CHACHA20_POLY1305_SHA256";
240
240
  }
241
+ function isValidProxySessionId(sessionId) {
242
+ return typeof sessionId === "string" && sessionId.length >= 8 && sessionId.length < 15 && /^[a-z0-9]+$/.test(sessionId);
243
+ }
241
244
  export {
242
245
  decryptDirect,
243
246
  ethersStructToPlainObject,
@@ -259,6 +262,7 @@ export {
259
262
  getZkAlgorithmForCipherSuite,
260
263
  isApplicationData,
261
264
  isTls13Suite,
265
+ isValidProxySessionId,
262
266
  makeRpcEvent,
263
267
  packRpcMessages,
264
268
  strToUint8Array,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reclaimprotocol/attestor-core",
3
- "version": "5.0.1-beta.5",
3
+ "version": "5.0.1-beta.6",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "imports": {