import { HttpHandler } from '@solid/community-server'; import type { HttpHandlerInput } from '@solid/community-server'; import { EdgeNodeRepository } from '../identity/drizzle/EdgeNodeRepository'; interface ClusterIngressRouterOptions { identityDbUrl: string; edgeNodesEnabled?: string | boolean; repository?: EdgeNodeRepository; clusterIngressDomain: string; skipAuthRedirect?: boolean; fetchImpl?: any; } /** * Cluster Ingress Router - 集群统一入口路由器 * * 实现我们设计的混合路由策略: * 1. 所有节点子域名DNS都指向集群入口 * 2. 认证请求路由到集群IDP * 3. 数据请求根据节点模式智能路由(307重定向 vs 代理) * * Note: WebSocket 代理由 ClusterWebSocketConfigurator 处理 */ export declare class ClusterIngressRouter extends HttpHandler { protected readonly logger: import("global-logger-factory").Logger; private readonly repository; private readonly enabled; private readonly clusterIngressDomain; private readonly skipAuthRedirect; private readonly fetchImpl; private readonly authPaths; constructor(options: ClusterIngressRouterOptions); canHandle({ request }: HttpHandlerInput): Promise; handle({ request, response }: HttpHandlerInput): Promise; /** * Handle authentication requests - always route to cluster IDP */ private handleAuthenticationRequest; /** * Handle data requests - route based on node access mode */ private handleDataRequest; /** * Handle direct mode - redirect to node's public IP */ private handleDirectModeRedirect; /** * Handle proxy mode - proxy the request through tunnel */ private handleProxyModeRequest; /** * Resolve upstream endpoint from node metadata */ private resolveUpstream; /** * Build headers for proxy request */ private buildProxyHeaders; /** * Read request body for proxy forwarding */ private readRequestBody; /** * Check if request path is for authentication */ private isAuthenticationRequest; /** * Rewrite the incoming request so downstream handlers treat it as cluster IDP traffic. */ private rewriteRequestForClusterIdp; /** * Extract node ID from hostname * e.g., "node1.cluster.example.com" -> "node1" */ private extractNodeIdFromHostname; /** * Extract hostname from request headers * Check for original host header first (set by ClusterHttpServerFactory) */ private extractHostname; /** * Parse request URL */ private parseUrl; /** * Normalize domain input; accept bare host or full URL. */ private normalizeDomain; /** * Normalize boolean values from string/boolean */ private normalizeBoolean; private normalizeMode; } export {};