/** * API Authentication Middleware * * Implements API key + HMAC signature validation for service-to-service auth. * Prevents replay attacks and validates request integrity. */ import type { Context, Next } from "hono"; export interface AuthConfig { /** Override API keys (for testing) */ apiKeys?: string[]; /** Override API secret (for testing) */ apiSecret?: string; /** Skip auth entirely (development only) */ skipAuth?: boolean; } /** * Validates API key and HMAC signature on requests. * * Required headers: * - X-API-Key: Valid API key from COMFYUI_API_KEYS * - X-Timestamp: Unix timestamp in milliseconds * - X-Signature: HMAC-SHA256 of "{timestamp}:{body}" using COMFYUI_API_SECRET */ export declare function createAuthMiddleware(config?: AuthConfig): (c: Context, next: Next) => Promise<(Response & import("hono").TypedResponse<{ error: string; }, 500, "json">) | (Response & import("hono").TypedResponse<{ error: string; }, 401, "json">) | undefined>; /** * Generate auth headers for a request to comfyui-mcp service. * Use this in landline-landing when calling the service. * * @example * ```typescript * const headers = generateAuthHeaders(body, apiKey, apiSecret); * fetch(url, { method: "POST", headers, body: JSON.stringify(body) }); * ``` */ export declare function generateAuthHeaders(body: unknown, apiKey: string, apiSecret: string): Record; export declare const authMiddleware: (c: Context, next: Next) => Promise<(Response & import("hono").TypedResponse<{ error: string; }, 500, "json">) | (Response & import("hono").TypedResponse<{ error: string; }, 401, "json">) | undefined>;