/** * Authentication Middleware * * Provides optional API key authentication for securing endpoints. * Authentication is disabled by default; enable by setting TX_API_KEY env var. */ import { HttpServerRequest, HttpServerResponse } from "@effect/platform"; import { Effect } from "effect"; /** * Check if authentication is enabled. */ export declare const isAuthEnabled: () => boolean; /** * Extract API key from request headers. * Supports both Authorization header (Bearer token) and X-Api-Key header. * @internal Exported for testing. */ export declare const extractApiKey: (headers: Record) => string | null; /** * Constant-time string comparison to prevent timing attacks. * Uses Node.js crypto.timingSafeEqual for proper constant-time comparison. * @internal Exported for testing. */ export declare const timingSafeEqual: (provided: string, expected: string) => boolean; /** * Effect HTTP authentication middleware. * Only validates if TX_API_KEY environment variable is set. * If not set, all requests pass through. */ export declare const authMiddleware: (httpApp: import("@effect/platform/HttpApp").Default) => Effect.Effect; //# sourceMappingURL=auth.d.ts.map