/** * Test Utilities * Shared helper functions for testing */ /// /// import { type JWTPayload } from 'jose'; import type { DPoPKeyPair } from './types.js'; /** * Base64url encode (URL-safe base64) */ export declare function base64UrlEncode(buffer: Buffer): string; /** * Base64url decode */ export declare function base64UrlDecode(str: string): Buffer; /** * Verify JWT signature and return payload */ export declare function verifyJWT(jwt: string, publicKey: CryptoKey): Promise; /** * Verify DPoP JWT signature */ export declare function verifyDPoPJWT(jwt: string, keyPair: DPoPKeyPair): Promise; /** * Generate SHA256 hash and base64url encode (same as S256 PKCE challenge) */ export declare function sha256Base64Url(input: string): string; /** * Generate test ES256 key pair */ export declare function generateTestKeyPair(): Promise; /** * Export public key as JWK */ export declare function exportPublicKeyAsJWK(publicKey: CryptoKey): Promise>; /** * Create mock HTTP response headers */ export declare function createMockHeaders(headers?: Record): Record; /** * Create mock HTTP response with DPoP nonce */ export declare function createMockResponseWithNonce(body: unknown, nonce: string): { statusCode: number; headers: Record; body: string; }; /** * Create mock HTTP error response with use_dpop_nonce */ export declare function createMockDPoPNonceError(nonce: string, statusCode?: number): { statusCode: number; headers: Record; body: string; }; /** * Sleep utility for testing async behavior */ export declare function sleep(ms: number): Promise; /** * Generate random string for testing */ export declare function randomString(length?: number): string; //# sourceMappingURL=test-utils.d.ts.map