@reclaimprotocol/attestor-core 5.0.5 → 5.0.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.
Files changed (86) hide show
  1. package/LICENSE +660 -660
  2. package/browser/resources/attestor-browser.min.mjs +31 -31
  3. package/lib/avs/client/create-claim-on-avs.d.ts +4 -4
  4. package/lib/avs/config.d.ts +1 -1
  5. package/lib/avs/types/index.d.ts +4 -4
  6. package/lib/avs/utils/contracts.d.ts +3 -3
  7. package/lib/avs/utils/register.d.ts +1 -1
  8. package/lib/avs/utils/tasks.d.ts +1 -1
  9. package/lib/client/create-claim.d.ts +2 -2
  10. package/lib/client/tunnels/make-rpc-tcp-tunnel.d.ts +2 -2
  11. package/lib/client/tunnels/make-rpc-tls-tunnel.d.ts +2 -2
  12. package/lib/client/utils/attestor-pool.d.ts +1 -1
  13. package/lib/client/utils/client-socket.d.ts +4 -4
  14. package/lib/client/utils/message-handler.d.ts +2 -2
  15. package/lib/config/index.d.ts +1 -1
  16. package/lib/external-rpc/handle-incoming-msg.d.ts +1 -1
  17. package/lib/external-rpc/index.js +25 -8
  18. package/lib/external-rpc/jsc-polyfills/1.d.ts +1 -1
  19. package/lib/external-rpc/jsc-polyfills/index.d.ts +2 -2
  20. package/lib/external-rpc/setup-browser.d.ts +1 -1
  21. package/lib/external-rpc/setup-jsc.d.ts +2 -2
  22. package/lib/external-rpc/types.d.ts +7 -7
  23. package/lib/external-rpc/utils.d.ts +2 -2
  24. package/lib/index.js +26 -9
  25. package/lib/mechain/client/create-claim-on-mechain.d.ts +3 -3
  26. package/lib/mechain/types/index.d.ts +2 -2
  27. package/lib/providers/http/index.d.ts +1 -1
  28. package/lib/providers/http/utils.d.ts +3 -3
  29. package/lib/providers/index.d.ts +1 -1
  30. package/lib/scripts/generate-receipt.d.ts +2 -2
  31. package/lib/scripts/jsc-cli-rpc.d.ts +1 -1
  32. package/lib/scripts/start-server.d.ts +1 -1
  33. package/lib/server/handlers/claimTeeBundle.d.ts +1 -1
  34. package/lib/server/handlers/claimTunnel.d.ts +1 -1
  35. package/lib/server/handlers/completeClaimOnChain.d.ts +1 -1
  36. package/lib/server/handlers/createClaimOnChain.d.ts +1 -1
  37. package/lib/server/handlers/createTaskOnMechain.d.ts +1 -1
  38. package/lib/server/handlers/createTunnel.d.ts +1 -1
  39. package/lib/server/handlers/disconnectTunnel.d.ts +1 -1
  40. package/lib/server/handlers/fetchCertificateBytes.d.ts +1 -1
  41. package/lib/server/handlers/index.d.ts +1 -1
  42. package/lib/server/handlers/init.d.ts +1 -1
  43. package/lib/server/handlers/toprf.d.ts +1 -1
  44. package/lib/server/socket.d.ts +4 -4
  45. package/lib/server/tunnels/make-tcp-tunnel.d.ts +3 -3
  46. package/lib/server/utils/assert-valid-claim-request.d.ts +4 -4
  47. package/lib/server/utils/gcp-attestation.d.ts +1 -1
  48. package/lib/server/utils/generics.d.ts +8 -2
  49. package/lib/server/utils/oprf-raw.d.ts +2 -2
  50. package/lib/server/utils/process-handshake.d.ts +2 -2
  51. package/lib/server/utils/tee-oprf-mpc-verification.d.ts +3 -3
  52. package/lib/server/utils/tee-oprf-verification.d.ts +3 -3
  53. package/lib/server/utils/tee-transcript-reconstruction.d.ts +3 -3
  54. package/lib/server/utils/tee-verification.d.ts +3 -3
  55. package/lib/server/utils/validation.d.ts +1 -1
  56. package/lib/types/claims.d.ts +6 -6
  57. package/lib/types/client.d.ts +5 -5
  58. package/lib/types/general.d.ts +1 -1
  59. package/lib/types/handlers.d.ts +3 -3
  60. package/lib/types/providers.d.ts +5 -5
  61. package/lib/types/rpc.d.ts +2 -2
  62. package/lib/types/tunnel.d.ts +1 -1
  63. package/lib/types/zk.d.ts +1 -1
  64. package/lib/utils/auth.d.ts +2 -2
  65. package/lib/utils/bgp-listener.d.ts +1 -1
  66. package/lib/utils/claims.d.ts +3 -3
  67. package/lib/utils/error.d.ts +1 -1
  68. package/lib/utils/generics.d.ts +2 -2
  69. package/lib/utils/http-parser.d.ts +1 -1
  70. package/lib/utils/logger.d.ts +1 -1
  71. package/lib/utils/prepare-packets.d.ts +2 -2
  72. package/lib/utils/redactions.d.ts +1 -1
  73. package/lib/utils/retries.d.ts +1 -1
  74. package/lib/utils/signatures/eth.d.ts +1 -1
  75. package/lib/utils/signatures/index.d.ts +2 -2
  76. package/lib/utils/socket-base.d.ts +3 -3
  77. package/lib/utils/zk.d.ts +4 -4
  78. package/package.json +4 -3
  79. package/lib/server/tee/acme-http-server.d.ts +0 -13
  80. package/lib/server/tee/attestation-generate.d.ts +0 -29
  81. package/lib/server/tee/bootstrap.d.ts +0 -11
  82. package/lib/server/tee/cert-manager.d.ts +0 -24
  83. package/lib/server/tee/cloud-logging.d.ts +0 -23
  84. package/lib/server/tee/secret-loader.d.ts +0 -10
  85. package/lib/server/tee/secret-manager.d.ts +0 -3
  86. package/lib/utils/gcp-attestation.d.ts +0 -23
@@ -6,9 +6,9 @@
6
6
  * are already trusted because they are included in TEE-signed payloads.
7
7
  * This module verifies that both TEEs computed identical outputs.
8
8
  */
9
- import type { KOutputPayload, TOutputPayload } from '#src/proto/tee-bundle.ts';
10
- import type { OprfVerificationResult } from '#src/server/utils/tee-oprf-verification.ts';
11
- import type { Logger } from '#src/types/general.ts';
9
+ import type { KOutputPayload, TOutputPayload } from '../../proto/tee-bundle.ts';
10
+ import type { OprfVerificationResult } from '../../server/utils/tee-oprf-verification.ts';
11
+ import type { Logger } from '../../types/general.ts';
12
12
  /**
13
13
  * Verifies OPRF MPC outputs from TEE_K and TEE_T match
14
14
  * Returns verified outputs for transcript replacement (same format as ZK OPRF)
@@ -2,9 +2,9 @@
2
2
  * TEE OPRF Verification and Replacement
3
3
  * Verifies OPRF proofs and replaces ranges in reconstructed plaintext
4
4
  */
5
- import type { OPRFVerificationData } from '#src/proto/tee-bundle.ts';
6
- import type { TeeBundleData } from '#src/server/utils/tee-verification.ts';
7
- import type { Logger } from '#src/types/general.ts';
5
+ import type { OPRFVerificationData } from '../../proto/tee-bundle.ts';
6
+ import type { TeeBundleData } from '../../server/utils/tee-verification.ts';
7
+ import type { Logger } from '../../types/general.ts';
8
8
  export interface OprfVerificationResult {
9
9
  position: number;
10
10
  length: number;
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * TLS Transcript Reconstruction from TEE data
3
3
  */
4
- import type { CertificateInfo } from '#src/proto/tee-bundle.ts';
5
- import type { TeeBundleData } from '#src/server/utils/tee-verification.ts';
6
- import type { Logger } from '#src/types/general.ts';
4
+ import type { CertificateInfo } from '../../proto/tee-bundle.ts';
5
+ import type { TeeBundleData } from '../../server/utils/tee-verification.ts';
6
+ import type { Logger } from '../../types/general.ts';
7
7
  export interface TeeTranscriptData {
8
8
  revealedRequest: Uint8Array;
9
9
  reconstructedResponse: Uint8Array;
@@ -2,9 +2,9 @@
2
2
  * TEE Bundle verification utilities
3
3
  * Handles validation of TEE verification bundles including attestations and signatures
4
4
  */
5
- import type { SignedMessage } from '#src/proto/tee-bundle.ts';
6
- import { KOutputPayload, TOutputPayload } from '#src/proto/tee-bundle.ts';
7
- import type { Logger } from '#src/types/general.ts';
5
+ import type { SignedMessage } from '../../proto/tee-bundle.ts';
6
+ import { KOutputPayload, TOutputPayload } from '../../proto/tee-bundle.ts';
7
+ import type { Logger } from '../../types/general.ts';
8
8
  export interface TeeBundleData {
9
9
  teekSigned: SignedMessage;
10
10
  teetSigned: SignedMessage;
@@ -1,2 +1,2 @@
1
- import type { ProviderName, ProviderParams } from '#src/types/index.ts';
1
+ import type { ProviderName, ProviderParams } from '../../types/index.ts';
2
2
  export declare function assertValidateProviderParams<T extends ProviderName>(name: T, params: unknown): asserts params is ProviderParams<T>;
@@ -1,9 +1,9 @@
1
- import type { ProviderClaimData } from '#src/proto/api.ts';
2
- import type { IAttestorClient, IAttestorClientInitParams } from '#src/types/client.ts';
3
- import type { CompleteTLSPacket, Logger } from '#src/types/general.ts';
4
- import type { ProofGenerationStep, ProviderName, ProviderParams, ProviderSecretParams } from '#src/types/providers.ts';
5
- import type { Transcript } from '#src/types/tunnel.ts';
6
- import type { PrepareZKProofsBaseOpts } from '#src/types/zk.ts';
1
+ import type { ProviderClaimData } from '../proto/api.ts';
2
+ import type { IAttestorClient, IAttestorClientInitParams } from '../types/client.ts';
3
+ import type { CompleteTLSPacket, Logger } from '../types/general.ts';
4
+ import type { ProofGenerationStep, ProviderName, ProviderParams, ProviderSecretParams } from '../types/providers.ts';
5
+ import type { Transcript } from '../types/tunnel.ts';
6
+ import type { PrepareZKProofsBaseOpts } from '../types/zk.ts';
7
7
  /**
8
8
  * Uniquely identifies a claim.
9
9
  * Hash of claim info.
@@ -1,10 +1,10 @@
1
1
  import type { IncomingMessage } from 'http';
2
2
  import type { WebSocket as WSWebSocket } from 'ws';
3
- import type { AuthenticationRequest, InitRequest, InitResponse, RPCMessage, RPCMessages, ServiceSignatureType, TunnelMessage } from '#src/proto/api.ts';
4
- import type { BGPListener } from '#src/types/bgp.ts';
5
- import type { Logger } from '#src/types/general.ts';
6
- import type { RPCEvent, RPCEventMap, RPCEventType, RPCRequestData, RPCResponseData, RPCType } from '#src/types/rpc.ts';
7
- import type { TCPSocketProperties, Tunnel } from '#src/types/tunnel.ts';
3
+ import type { AuthenticationRequest, InitRequest, InitResponse, RPCMessage, RPCMessages, ServiceSignatureType, TunnelMessage } from '../proto/api.ts';
4
+ import type { BGPListener } from '../types/bgp.ts';
5
+ import type { Logger } from '../types/general.ts';
6
+ import type { RPCEvent, RPCEventMap, RPCEventType, RPCRequestData, RPCResponseData, RPCType } from '../types/rpc.ts';
7
+ import type { TCPSocketProperties, Tunnel } from '../types/tunnel.ts';
8
8
  /**
9
9
  * Any WebSocket implementation -- either the native
10
10
  * WebSocket or the WebSocket from the `ws` package.
@@ -1,5 +1,5 @@
1
1
  import type { Logger as TLSLogger, TLSPacketContext, TLSProtocolVersion } from '@reclaimprotocol/tls';
2
- import type { OPRFRawMarker, TOPRFProofParams } from '#src/types/zk.ts';
2
+ import type { OPRFRawMarker, TOPRFProofParams } from '../types/zk.ts';
3
3
  /**
4
4
  * Represents a slice of any array or string
5
5
  */
@@ -1,7 +1,7 @@
1
1
  import type { Transaction } from 'elastic-apm-node';
2
- import type { IAttestorServerSocket } from '#src/types/client.ts';
3
- import type { Logger } from '#src/types/general.ts';
4
- import type { RPCRequestData, RPCResponseData, RPCType } from '#src/types/rpc.ts';
2
+ import type { IAttestorServerSocket } from '../types/client.ts';
3
+ import type { Logger } from '../types/general.ts';
4
+ import type { RPCRequestData, RPCResponseData, RPCType } from '../types/rpc.ts';
5
5
  export type RPCHandlerMetadata = {
6
6
  logger: Logger;
7
7
  tx?: Transaction;
@@ -1,9 +1,9 @@
1
1
  import type { TLSConnectionOptions } from '@reclaimprotocol/tls';
2
- import type { AttestorVersion, ProviderClaimData } from '#src/proto/api.ts';
3
- import type { ArraySlice, Logger, RedactedOrHashedArraySlice } from '#src/types/general.ts';
4
- import type { ProvidersConfig } from '#src/types/providers.gen.ts';
5
- import type { Awaitable } from '#src/types/signatures.ts';
6
- import type { Transcript } from '#src/types/tunnel.ts';
2
+ import type { AttestorVersion, ProviderClaimData } from '../proto/api.ts';
3
+ import type { ArraySlice, Logger, RedactedOrHashedArraySlice } from '../types/general.ts';
4
+ import type { ProvidersConfig } from '../types/providers.gen.ts';
5
+ import type { Awaitable } from '../types/signatures.ts';
6
+ import type { Transcript } from '../types/tunnel.ts';
7
7
  export type AttestorData = {
8
8
  id: string;
9
9
  url: string;
@@ -1,5 +1,5 @@
1
- import type { RPCMessage, TunnelDisconnectEvent, TunnelMessage } from '#src/proto/api.ts';
2
- import type { AttestorError } from '#src/utils/error.ts';
1
+ import type { RPCMessage, TunnelDisconnectEvent, TunnelMessage } from '../proto/api.ts';
2
+ import type { AttestorError } from '../utils/error.ts';
3
3
  type ExtractPrefix<T, S extends string> = T extends `${infer _}${S}` ? _ : never;
4
4
  export type RPCType = ExtractPrefix<keyof RPCMessage, 'Request'>;
5
5
  type RPCRequestType<T extends RPCType> = `${T}Request`;
@@ -1,4 +1,4 @@
1
- import type { CreateTunnelRequest } from '#src/proto/api.ts';
1
+ import type { CreateTunnelRequest } from '../proto/api.ts';
2
2
  export type MakeTunnelBaseOpts<O> = O & {
3
3
  onClose?(err?: Error): void;
4
4
  onMessage?(data: Uint8Array): void;
package/lib/types/zk.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { EncryptionAlgorithm, OPRFOperator, ZKEngine, ZKOperator } from '@reclaimprotocol/zk-symmetric-crypto';
2
- import type { TOPRFPayload } from '#src/proto/api.ts';
2
+ import type { TOPRFPayload } from '../proto/api.ts';
3
3
  export type ZKOperators = {
4
4
  [E in EncryptionAlgorithm]?: ZKOperator;
5
5
  };
@@ -1,5 +1,5 @@
1
- import type { AuthenticationRequest, ServiceSignatureType } from '#src/proto/api.ts';
2
- import { AuthenticatedUserData } from '#src/proto/api.ts';
1
+ import type { AuthenticationRequest, ServiceSignatureType } from '../proto/api.ts';
2
+ import { AuthenticatedUserData } from '../proto/api.ts';
3
3
  export declare function assertValidAuthRequest(request: AuthenticationRequest | undefined, signatureType: ServiceSignatureType): Promise<void>;
4
4
  /**
5
5
  * Create an authentication request with the given data and private key,
@@ -1,5 +1,5 @@
1
1
  import type { Logger } from 'pino';
2
- import type { BGPListener } from '#src/types/index.ts';
2
+ import type { BGPListener } from '../types/index.ts';
3
3
  /**
4
4
  * Listens for BGP announcements and emits events whenever
5
5
  * an announcement overlaps with a target IP.
@@ -1,5 +1,5 @@
1
- import { ClaimTunnelResponse } from '#src/proto/api.ts';
2
- import type { ClaimID, ClaimInfo, CompleteClaimData, ProviderParams } from '#src/types/index.ts';
1
+ import { ClaimTunnelResponse } from '../proto/api.ts';
2
+ import type { ClaimID, ClaimInfo, CompleteClaimData, ProviderParams } from '../types/index.ts';
3
3
  /**
4
4
  * Creates the standard string to sign for a claim.
5
5
  * This data is what the attestor will sign when it successfully
@@ -16,7 +16,7 @@ export declare function createSignDataForClaim(data: CompleteClaimData): string;
16
16
  * The successful run of this function means that the claim
17
17
  * is valid, and the attestor that signed the claim is valid.
18
18
  */
19
- export declare function assertValidClaimSignatures({ signatures, ...res }: Partial<ClaimTunnelResponse>, metadata?: import("#src/proto/api.ts").InitRequest): Promise<void>;
19
+ export declare function assertValidClaimSignatures({ signatures, ...res }: Partial<ClaimTunnelResponse>, metadata?: import("../proto/api.ts").InitRequest): Promise<void>;
20
20
  /**
21
21
  * Generates a unique identifier for given claim info
22
22
  * @param info
@@ -1,4 +1,4 @@
1
- import { ErrorCode, ErrorData } from '#src/proto/api.ts';
1
+ import { ErrorCode, ErrorData } from '../proto/api.ts';
2
2
  /**
3
3
  * Represents an error that can be thrown by the Attestor Core
4
4
  * or server. Provides a code, and optional data
@@ -1,7 +1,7 @@
1
1
  import type { CipherSuite, TLSProtocolVersion } from '@reclaimprotocol/tls';
2
2
  import { uint8ArrayToBinaryStr } from '@reclaimprotocol/tls';
3
- import { RPCMessage, RPCMessages } from '#src/proto/api.ts';
4
- import type { CompleteTLSPacket, IDecryptedTranscript, IDecryptedTranscriptMessage, ProviderField, RPCEvent, RPCEventMap, RPCEventType, RPCType, Transcript } from '#src/types/index.ts';
3
+ import { RPCMessage, RPCMessages } from '../proto/api.ts';
4
+ import type { CompleteTLSPacket, IDecryptedTranscript, IDecryptedTranscriptMessage, ProviderField, RPCEvent, RPCEventMap, RPCEventType, RPCType, Transcript } from '../types/index.ts';
5
5
  export { uint8ArrayToBinaryStr };
6
6
  /**
7
7
  * Decodes a Uint8Array to a UTF-8 string.
@@ -1,5 +1,5 @@
1
1
  import type { IncomingHttpHeaders } from 'http';
2
- import type { ArraySlice, Transcript } from '#src/types/index.ts';
2
+ import type { ArraySlice, Transcript } from '../types/index.ts';
3
3
  export type HttpRequest = {
4
4
  method: string;
5
5
  url: string;
@@ -1,4 +1,4 @@
1
- import type { LogLevel } from '#src/types/index.ts';
1
+ import type { LogLevel } from '../types/index.ts';
2
2
  export declare let logger: import("pino").Logger<never, boolean>;
3
3
  /**
4
4
  * Creates a logger instance with optional redaction of PII.
@@ -1,6 +1,6 @@
1
1
  import type { CipherSuite, TLSPacketContext } from '@reclaimprotocol/tls';
2
- import type { ClaimTunnelRequest_TranscriptMessage as TranscriptMessage } from '#src/proto/api.ts';
3
- import type { CompleteTLSPacket, Logger, MessageRevealInfo, PrepareZKProofsBaseOpts, Transcript } from '#src/types/index.ts';
2
+ import type { ClaimTunnelRequest_TranscriptMessage as TranscriptMessage } from '../proto/api.ts';
3
+ import type { CompleteTLSPacket, Logger, MessageRevealInfo, PrepareZKProofsBaseOpts, Transcript } from '../types/index.ts';
4
4
  export type PreparePacketsForRevealOpts = {
5
5
  cipherSuite: CipherSuite;
6
6
  logger: Logger;
@@ -1,4 +1,4 @@
1
- import type { ArraySlice, OPRFRawMarker, RedactedOrHashedArraySlice, TOPRFProofParams } from '#src/types/index.ts';
1
+ import type { ArraySlice, OPRFRawMarker, RedactedOrHashedArraySlice, TOPRFProofParams } from '../types/index.ts';
2
2
  export declare const REDACTION_CHAR = "*";
3
3
  export declare const REDACTION_CHAR_CODE: number;
4
4
  type SliceWithReveal<T> = {
@@ -1,4 +1,4 @@
1
- import type { Logger } from '#src/types/index.ts';
1
+ import type { Logger } from '../types/index.ts';
2
2
  type RetryLoopOptions = {
3
3
  maxRetries?: number;
4
4
  logger: Logger;
@@ -1,2 +1,2 @@
1
- import type { ServiceSignatureProvider } from '#src/types/index.ts';
1
+ import type { ServiceSignatureProvider } from '../../types/index.ts';
2
2
  export declare const ETH_SIGNATURE_PROVIDER: ServiceSignatureProvider;
@@ -1,5 +1,5 @@
1
- import { ServiceSignatureType } from '#src/proto/api.ts';
2
- import type { ServiceSignatureProvider } from '#src/types/index.ts';
1
+ import { ServiceSignatureType } from '../../proto/api.ts';
2
+ import type { ServiceSignatureProvider } from '../../types/index.ts';
3
3
  export declare const SIGNATURES: { [key in ServiceSignatureType]: ServiceSignatureProvider; };
4
4
  export declare const SelectedServiceSignatureType: 1;
5
5
  export declare const SelectedServiceSignature: ServiceSignatureProvider;
@@ -1,7 +1,7 @@
1
1
  import type { WebSocket as WSWebSocket } from 'ws';
2
- import type { InitRequest, RPCMessage } from '#src/proto/api.ts';
3
- import { RPCMessages } from '#src/proto/api.ts';
4
- import type { IAttestorSocket, Logger, RPCEvent, RPCEventMap } from '#src/types/index.ts';
2
+ import type { InitRequest, RPCMessage } from '../proto/api.ts';
3
+ import { RPCMessages } from '../proto/api.ts';
4
+ import type { IAttestorSocket, Logger, RPCEvent, RPCEventMap } from '../types/index.ts';
5
5
  /**
6
6
  * Common AttestorSocket class used on the client & server side as the
7
7
  * base for their respective socket implementations.
package/lib/utils/zk.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import type { CipherSuite } from '@reclaimprotocol/tls';
2
2
  import type { EncryptionAlgorithm, OPRFOperator, PrivateInput, PublicInput, ZKEngine, ZKOperator } from '@reclaimprotocol/zk-symmetric-crypto';
3
- import type { MessageReveal_MessageRevealZk as ZKReveal, MessageReveal_TOPRFProof as TOPRFProof, MessageReveal_ZKProof as ZKProof } from '#src/proto/api.ts';
4
- import { ZKProofEngine } from '#src/proto/api.ts';
5
- import type { CompleteTLSPacket, Logger, OPRFOperators, PrepareZKProofsBaseOpts, TOPRFProofParams, ZKOperators, ZKRevealInfo } from '#src/types/index.ts';
3
+ import type { MessageReveal_MessageRevealZk as ZKReveal, MessageReveal_TOPRFProof as TOPRFProof, MessageReveal_ZKProof as ZKProof } from '../proto/api.ts';
4
+ import { ZKProofEngine } from '../proto/api.ts';
5
+ import type { CompleteTLSPacket, Logger, OPRFOperators, PrepareZKProofsBaseOpts, TOPRFProofParams, ZKOperators, ZKRevealInfo } from '../types/index.ts';
6
6
  type PrepareZKProofsOpts = {
7
7
  logger?: Logger;
8
8
  cipherSuite: CipherSuite;
@@ -62,7 +62,7 @@ export declare function makeZkProofGenerator({ zkOperators, oprfOperators, logge
62
62
  */
63
63
  export declare function verifyZkPacket({ cipherSuite, ciphertext, zkReveal, zkOperators, oprfOperators, logger, zkEngine, iv, recordNumber, toprfOvershotNullifier, getNextPacket }: ZKVerifyOpts): Promise<{
64
64
  redactedPlaintext: Uint8Array<ArrayBuffer>;
65
- oprfRawMarkers: import("#src/proto/api.ts").MessageReveal_OPRFRawMarker[];
65
+ oprfRawMarkers: import("../proto/api.ts").MessageReveal_OPRFRawMarker[];
66
66
  }>;
67
67
  export declare function makeDefaultZkOperator(algorithm: EncryptionAlgorithm, zkEngine: ZKEngine, logger: Logger): ZKOperator;
68
68
  export declare function makeDefaultOPRFOperator(algorithm: EncryptionAlgorithm, zkEngine: ZKEngine, logger: Logger): OPRFOperator;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reclaimprotocol/attestor-core",
3
- "version": "5.0.5",
3
+ "version": "5.0.6",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "imports": {
@@ -21,7 +21,7 @@
21
21
  }
22
22
  },
23
23
  "scripts": {
24
- "build": "tsc -p tsconfig.build.json && npm run run:tsc -- src/scripts/build-lib.ts",
24
+ "build": "tsc -p tsconfig.build.json && tsc-alias && npm run run:tsc -- src/scripts/build-lib.ts",
25
25
  "build:browser": "sh ./src/scripts/build-browser.sh",
26
26
  "run:tsc": "node --experimental-strip-types",
27
27
  "start": "npm run run:tsc -- src/scripts/start-server.ts",
@@ -105,7 +105,7 @@
105
105
  "parse5": "^8.0.0",
106
106
  "parse5-htmlparser2-tree-adapter": "^8.0.0",
107
107
  "pino": "^9.14.0",
108
- "re2": "^1.23.3",
108
+ "re2": "^1.24.0",
109
109
  "serve-static": "^1.16.3",
110
110
  "snarkjs": "^0.7.6",
111
111
  "ws": "^8.20.0",
@@ -131,6 +131,7 @@
131
131
  "json-schema-to-typescript": "^15.0.4",
132
132
  "ts-jest": "^29.4.6",
133
133
  "ts-proto": "^2.11.6",
134
+ "tsc-alias": "^1.8.17",
134
135
  "typechain": "^8.3.2",
135
136
  "typescript": "^5.9.3",
136
137
  "whatwg-url": "^14.2.0",
@@ -1,13 +0,0 @@
1
- /**
2
- * Ephemeral HTTP server that answers ACME HTTP-01 challenges. Started right
3
- * before an order is placed and stopped as soon as the order is finalized,
4
- * so the attestor does not keep port 80 bound during normal operation.
5
- */
6
- export declare class AcmeChallengeServer {
7
- private readonly tokens;
8
- private server?;
9
- add(token: string, keyAuthorization: string): void;
10
- remove(token: string): void;
11
- start(port: number): Promise<void>;
12
- stop(): Promise<void>;
13
- }
@@ -1,29 +0,0 @@
1
- import type { AttestationReport } from '#src/proto/tee-bundle.ts';
2
- /**
3
- * Requests a custom attestation token from the Confidential Space launcher
4
- * over the unix domain socket. Mirrors reclaim-tee's shared/gcp_attestation.go.
5
- */
6
- export declare function generateAttestationJwt(nonces: string[]): Promise<Uint8Array>;
7
- export interface AttestationContext {
8
- attestorAddress: string;
9
- tlsCertSha256Hex: () => string | undefined;
10
- }
11
- /**
12
- * Starts the background attestation refresh loop. The first attestation is
13
- * generated synchronously so getCachedAttestationJwt() is ready by the time
14
- * the server begins handling claims.
15
- */
16
- export declare function startAttestationRefresh(ctx: AttestationContext): Promise<void>;
17
- export declare function stopAttestationRefresh(): void;
18
- /**
19
- * Returns the currently-cached attestation JWT bytes, or undefined if no
20
- * attestation has been generated yet or the cache has expired without a
21
- * successful refresh.
22
- */
23
- export declare function getCachedAttestationJwt(): Uint8Array | undefined;
24
- /**
25
- * Returns an AttestationReport ready to embed in a claim response, or
26
- * undefined when no attestation is available (i.e. attestor is not running
27
- * inside a TEE, or the refresh loop has not produced one yet).
28
- */
29
- export declare function makeClaimAttestation(): AttestationReport | undefined;
@@ -1,11 +0,0 @@
1
- /**
2
- * Brings the attestor up in TEE mode:
3
- * 1. Pull signing/OPRF secrets from GCP Secret Manager into process.env.
4
- * 2. Load (or obtain via ACME) the TLS cert and start the renewal loop.
5
- * 3. Start the attestation refresh loop, with the public key + cert hash
6
- * as nonces.
7
- *
8
- * Must run before #src/server/index.ts is imported, since modules in that
9
- * tree read PRIVATE_KEY at module load.
10
- */
11
- export declare function bootstrapTee(): Promise<void>;
@@ -1,24 +0,0 @@
1
- import tls from 'tls';
2
- export interface CertManagerConfig {
3
- projectId: string;
4
- domain: string;
5
- email: string;
6
- directoryUrl: string;
7
- httpChallengePort: number;
8
- }
9
- export interface ActiveCertificate {
10
- certPem: string;
11
- keyPem: string;
12
- notAfter: Date;
13
- sha256Hex: string;
14
- secureContext: tls.SecureContext;
15
- }
16
- /**
17
- * Bootstraps the TLS certificate. Tries Secret Manager first; if absent or
18
- * expiring within the renewal window, runs ACME against the configured
19
- * directory URL and persists the result.
20
- */
21
- export declare function bootstrapCertificate(cfg: CertManagerConfig): Promise<ActiveCertificate>;
22
- export declare function startRenewalLoop(cfg: CertManagerConfig): void;
23
- export declare function stopRenewalLoop(): void;
24
- export declare function getActiveCertificate(): ActiveCertificate | undefined;
@@ -1,23 +0,0 @@
1
- import type { LogLevel } from '#src/types/index.ts';
2
- interface CloudLoggingOptions {
3
- projectId: string;
4
- logName: string;
5
- level?: LogLevel;
6
- }
7
- /**
8
- * Replaces the default pino logger with one that forwards every log line
9
- * to GCP Cloud Logging under the given log name. Idempotent.
10
- *
11
- * Probes the Cloud Logging client first by writing a no-op entry; if
12
- * authentication or transport fails, leaves the default stdout logger in
13
- * place rather than crashing the process. On Confidential Space VMs the
14
- * launcher's `tee-container-log-redirect` ships stdout to Cloud Logging
15
- * anyway, so the worst case is logs appear under
16
- * `confidential-space-launcher` rather than the configured `logName`.
17
- *
18
- * We also install a process-wide `unhandledRejection` filter that
19
- * swallows errors originating in `@google-cloud/logging`, since the SDK
20
- * has internal lazy gRPC init that escapes our local `.catch()`.
21
- */
22
- export declare function installCloudLogging(opts: CloudLoggingOptions): void;
23
- export {};
@@ -1,10 +0,0 @@
1
- /**
2
- * Fetches the attestor's signing key and OPRF key material from GCP
3
- * Secret Manager and writes them into process.env, so that the rest of
4
- * the server (which reads these via getEnvVariable at module load) sees
5
- * them as if they had been set in the environment.
6
- *
7
- * Must be called before any module that reads PRIVATE_KEY / TOPRF_* is
8
- * imported, otherwise the reads happen before the values are populated.
9
- */
10
- export declare function loadSecretsIntoEnv(projectId: string): Promise<void>;
@@ -1,3 +0,0 @@
1
- export declare function accessLatestSecret(projectId: string, secretId: string): Promise<Uint8Array>;
2
- export declare function createSecretIfNotExists(projectId: string, secretId: string): Promise<void>;
3
- export declare function addSecretVersion(projectId: string, secretId: string, payload: Uint8Array): Promise<void>;
@@ -1,23 +0,0 @@
1
- /**
2
- * GCP attestation validation utilities.
3
- *
4
- * Validates JWT attestation tokens from GCP Confidential Computing
5
- * (Confidential Space). Browser-safe: uses `@peculiar/x509` for chain
6
- * verification and `globalThis.crypto.subtle` for JWT signature
7
- * verification. Both are available in Node 19+ and modern browsers.
8
- */
9
- import type { Logger } from '#src/types/general.ts';
10
- export interface GcpValidationResult {
11
- isValid: boolean;
12
- errors: string[];
13
- ethAddress?: Uint8Array;
14
- userDataType?: string;
15
- pcr0?: string;
16
- envVars?: Record<string, string>;
17
- }
18
- export declare function validateGcpAttestationAndExtractKey(attestation: Uint8Array | string, logger?: Logger): Promise<GcpValidationResult>;
19
- /**
20
- * Extracts the container image digest from a previously-validated GCP
21
- * attestation token. Re-validates the JWT before reading.
22
- */
23
- export declare function extractImageDigestFromGCPAttestation(token: Uint8Array | string, logger?: Logger): Promise<string>;