import type { DeviceRecord } from '../../storage/sqlite/device-access-repository.js'; export declare const REQUEST_PROOF_WINDOW_MS = 120000; export declare const PROOF_HEADER = "X-Xopc-Proof"; export declare const SIGNED_REQUEST_HEADERS: readonly ["content-type", "idempotency-key", "x-xopc-expected-session-key", "x-endpoint-id", "x-endpoint-upload-token"]; /** Bounds buffered uploads through route completion, after signature verification. */ export declare function acquireProofBodyBudget(deviceId: string): (() => void) | undefined; export declare function proofDigest(bytes: string | NodeJS.ArrayBufferView): string; export interface RequestProof { timestamp: number; nonce: string; digest: string; signature: string; } export declare function parseRequestProof(header: string | undefined): RequestProof | undefined; export declare function requestProofMessage(input: { gatewayId: string; credential: string; method: string; target: string; headers: (name: string) => string | undefined; proof: Pick; }): string; export declare function verifyRequestProofSignature(device: DeviceRecord, proof: RequestProof, message: string): boolean; /** The unique insert happens before business effects; expiry includes future-dated proofs. */ export declare function consumeRequestNonce(deviceId: string, proof: RequestProof, now?: number): boolean; /** Native WebSocket upgrades bind the first ticket to the device key without another round trip. */ export declare function verifyDeviceConnectionProof(principalId: string, ticket: string, path: string, header: string | undefined, requireScopedDevice?: boolean): boolean;